void sub_m64abs_imm32(unsigned long long *m64, unsigned int imm32) {
  if ((long)m64 & 0xFFFFFFFF80000000LL) {
    printf("Error: destination %lx not in lower 2GB for sub_m64abs_imm32()\n",
           (long)m64);
    asm(" int $3; ");
  }
  put8(0x48);
  put8(0x81);
  put8(0x2C);
  put8(0x25);
  put32((int)(unsigned long)m64);
  put32(imm32);
}


x86 assembly (clang, -O0):
<sub_m64abs_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffff80000000,%rax
cmp    $0x0,%rax
je     1166 <sub_m64abs_imm32+0x36>
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
int3
mov    $0x48,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x81,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x2c,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x25,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    $0x0,%al
call   1050 <put32@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_m64abs_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0xffffffff80000000,%rdi
je     1153 <sub_m64abs_imm32+0x23>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
int3
mov    $0x48,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x81,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x2c,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x25,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <put32@plt>
mov    %ebp,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <put32@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Error: destination %lx not in lower 2GB for sub_m64abs_imm32()\0A\00"
define void @sub_m64abs_imm32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = ptrtoint i64* %5 to i64
%7 = and i64 %6, -2147483648
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64*, i64** %3
%11 = ptrtoint i64* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %9, %2
%14 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 72)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 129)
%16 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 44)
%17 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%18 = load i64*, i64** %3
%19 = ptrtoint i64* %18 to i64
%20 = trunc i64 %19 to i32
%21 = call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %20)
%22 = load i32, i32* %4
%23 = call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"Error: destination %lx not in lower 2GB for sub_m64abs_imm32()\0A\00"
define void @sub_m64abs_imm32(i64* %0, i32 %1) {
%3 = ptrtoint i64* %0 to i64
%4 = icmp ult i64* %0, inttoptr (i64 2147483648 to i64*)
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i64 %3)
tail call void asm sideeffect " int $$3; ", "~{dirflag},~{fpsr},~{flags}"()
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 72)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 129)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 44)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%12 = trunc i64 %3 to i32
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %12)
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %1)
ret void
}