void *of_claim(unsigned int vaddr, unsigned int size, unsigned int align) {
  struct {
    const char *name;
    int num_args;
    int num_returns;
    unsigned int vaddr;
    unsigned int size;
    unsigned int align;
    void *ret;
  } args;
  args.name = "claim";
  args.num_args = 3;
  args.num_returns = 1;
  args.vaddr = vaddr;
  args.size = size;
  args.align = align;
  of(&args);
  return args.ret;
}


x86 assembly (clang, -O0):
<of_claim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x3,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x38(%rbp),%rdi
mov    $0x0,%al
call   1030 <of@plt>
mov    -0x18(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_claim>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movabs $0x100000003,%rax
mov    %rax,0x8(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x18(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <of@plt>
mov    0x20(%rsp),%rax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32, i32, i32, i32, i8* }
@.str = [6 x i8] c"claim\00"
define i8* @of_claim(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.anon
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
store i32 3, i32* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 2
store i32 1, i32* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 3
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 4
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 5
store i32 %15, i32* %16
%17 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %7)
%18 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 6
%19 = load i8*, i8** %18
ret i8* %19
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32, i32, i32, i32, i8* }
@.str = [6 x i8] c"claim\00"
define i8* @of_claim(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.anon
%5 = bitcast %struct.anon* %4 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 1
store i32 3, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 2
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 3
store i32 %0, i32* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 4
store i32 %1, i32* %10
%11 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 5
store i32 %2, i32* %11
%12 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %4)
%13 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 6
%14 = load i8*, i8** %13
ret i8* %14
}