Problems in the transformation from LLVM IR code to x86-64 executable file

LLVM uses opaque pointers.

ptr is a pointer. addrspace(4) does not say anything about the type.

%a3 = load i32, ptr %a, align 4

In the load instruction, you specify the type.