xunge/DecIR huggingface dataset:
float gasdev(long *idum) {}


x86 assembly (clang, -O0):
<gasdev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gasdev>:
ret

LLVM IR (-O0):
define float @gasdev(i64* %0) {
%2 = alloca float
%3 = alloca i64*
store i64* %0, i64** %3
%4 = load float, float* %2
ret float %4
}

LLVM IR (-O2):
define float @gasdev(i64* nocapture readnone %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_IO_init(__attribute__((unused)) int argc,
                 __attribute__((unused)) char *argv[]) {
  Init();
}


x86 assembly (clang, -O0):
<_M2_IO_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_M2_IO_init>:
xor    %eax,%eax
jmp    1030 <Init@plt>

LLVM IR (-O0):
define void @_M2_IO_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @Init()
ret void
}

LLVM IR (-O2):
define void @_M2_IO_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
/* Variables and functions */
float sin(float);
float func(float x) { return x * x * (x * x - 2.) * sin(x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fsub double %10, 2.000000e+00
%12 = fmul double %6, %11
%13 = load float, float* %2
%14 = call float @sin(float %13)
%15 = fpext float %14 to double
%16 = fmul double %12, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fadd double %3, -2.000000e+00
%5 = fmul double %4, %3
%6 = tail call float @sin(float %0)
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}
int isSorted(long int *arr, int size) {
  for (int i = 0; i < size - 1; ++i) {
    if (arr[i] > arr[i + 1]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1165 <isSorted+0x65>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,8),%rax
jle    1152 <isSorted+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116c <isSorted+0x6c>
jmp    1157 <isSorted+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isSorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSorted>:
add    $0xffffffff,%esi
xor    %edx,%edx
test   %esi,%esi
mov    $0x0,%r8d
cmovg  %esi,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rcx
cmp    %rdx,%r8
je     1137 <isSorted+0x37>
mov    (%rdi,%rcx,8),%rax
lea    0x1(%rcx),%rdx
cmp    0x8(%rdi,%rcx,8),%rax
jle    1120 <isSorted+0x20>
movslq %esi,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
setge  %al
ret

LLVM IR (-O0):
define i32 @isSorted(i64* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = load i64*, i64** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %13, i64 %15
%17 = load i64, i64* %16
%18 = load i64*, i64** %4
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %18, i64 %21
%23 = load i64, i64* %22
%24 = icmp sgt i64 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %12
store i32 0, i32* %3
br label %31
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
store i32 1, i32* %3
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @isSorted(i64* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i64, i64* %0, i64 %7
%11 = load i64, i64* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i64, i64* %0, i64 %12
%14 = load i64, i64* %13
%15 = icmp sgt i64 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %9, %6
%17 = sext i32 %3 to i64
%18 = icmp sge i64 %7, %17
%19 = zext i1 %18 to i32
ret i32 %19
}
char *langRomTypeNms8280Digitiz() { return "Philips NMS-8280 Digitizer"; }


x86 assembly (clang, -O0):
<langRomTypeNms8280Digitiz>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeNms8280Digitiz>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Philips NMS-8280 Digitizer\00"
define i8* @langRomTypeNms8280Digitiz() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"Philips NMS-8280 Digitizer\00"
define i8* @langRomTypeNms8280Digitiz() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
void __DELETE_java_lang_RuntimePermission(void *me, void *client_data) {}


x86 assembly (clang, -O0):
<__DELETE_java_lang_RuntimePermission>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__DELETE_java_lang_RuntimePermission>:
ret

LLVM IR (-O0):
define void @__DELETE_java_lang_RuntimePermission(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_RuntimePermission(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int ceil(int n, int d) { return n / d + (n % d == 0 ? 0 : 1); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %edx,%esi
mov    $0x1,%ecx
xor    %edx,%edx
cmp    $0x0,%esi
cmove  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
%14 = add nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ceil(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("Hola %s!\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hola %s!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hola %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void LedsP$Led2$clr(void) { ReverseGPIOP$1$Out$clr(); }


x86 assembly (clang, -O0):
<LedsP$Led2$clr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ReverseGPIOP$1$Out$clr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedsP$Led2$clr>:
xor    %eax,%eax
jmp    1030 <ReverseGPIOP$1$Out$clr@plt>

LLVM IR (-O0):
define void @"LedsP$Led2$clr"() {
%1 = call i32 (...) @"ReverseGPIOP$1$Out$clr"()
ret void
}

LLVM IR (-O2):
define void @"LedsP$Led2$clr"() {
%1 = tail call i32 (...) @"ReverseGPIOP$1$Out$clr"()
ret void
}
void *octave_block_child(void) { return 0; }


x86 assembly (clang, -O0):
<octave_block_child>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_block_child>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @octave_block_child() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @octave_block_child() {
ret i8* null
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct slName {
  int dummy;
};

/* Variables and functions */
struct slName *extNamesForId(struct sqlConnection *, int, char *);
struct slName *genePixUniProt(struct sqlConnection *conn, int id) {
  return extNamesForId(conn, id, "uniProt");
}


x86 assembly (clang, -O0):
<genePixUniProt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <extNamesForId@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixUniProt>:
lea    0xee9(%rip),%rdx
jmp    1030 <extNamesForId@plt>

LLVM IR (-O0):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"uniProt\00"
define %struct.slName* @genePixUniProt(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call %struct.slName* @extNamesForId(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %7
}

LLVM IR (-O2):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"uniProt\00"
define %struct.slName* @genePixUniProt(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call %struct.slName* @extNamesForId(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %3
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void indent(uint32_t depth) {
  for (uint64_t i = 0; i < 2 * depth; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    114b <indent+0x3b>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbx
test   %edi,%edi
jle    113f <indent+0x2f>
add    %edi,%edi
cmp    $0x2,%edi
mov    $0x1,%ebx
cmovge %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @indent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = call i32 @putchar(i8 signext 32)
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = call i32 @llvm.smax.i32(i32 %4, i32 1)
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @putchar(i8 signext 32)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %5
br i1 %11, label %6, label %7
}
void gtk_window_set_modal() {}


x86 assembly (clang, -O0):
<gtk_window_set_modal>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_window_set_modal>:
ret

LLVM IR (-O0):
define void @gtk_window_set_modal() {
ret void
}

LLVM IR (-O2):
define void @gtk_window_set_modal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int read_int_dec_or_hex(char *);
int send_req(int, int, int, int /*<<< orphan*/);
int u_reg_read(int fd, char **argv) {
  int addr;
  addr = read_int_dec_or_hex(argv[0]);
  printf("0x%08x\n", send_req(fd, addr, -1, 0));
  return 0;
}


x86 assembly (clang, -O0):
<u_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <read_int_dec_or_hex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1040 <send_req@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_reg_read>:
push   %rbx
mov    %edi,%ebx
mov    (%rsi),%rdi
call   1050 <read_int_dec_or_hex@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1040 <send_req@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"0x%08x\0A\00"
define i32 @u_reg_read(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @read_int_dec_or_hex(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @send_req(i32 %10, i32 %11, i32 -1, i32 0)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%08x\0A\00"
define i32 @u_reg_read(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @read_int_dec_or_hex(i8* %3)
%5 = tail call i32 @send_req(i32 %0, i32 %4, i32 -1, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void gtk_calendar_set_display_options() {}


x86 assembly (clang, -O0):
<gtk_calendar_set_display_options>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_calendar_set_display_options>:
ret

LLVM IR (-O0):
define void @gtk_calendar_set_display_options() {
ret void
}

LLVM IR (-O2):
define void @gtk_calendar_set_display_options() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GETVAL;
int semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int get_semvalue(int sem_id, int idx) { return semctl(sem_id, idx, GETVAL, 0); }


x86 assembly (clang, -O0):
<get_semvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_semvalue>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@GETVAL = global i32 0
define i32 @get_semvalue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @GETVAL
%8 = call i32 @semctl(i32 %5, i32 %6, i32 %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@GETVAL = global i32 0
define i32 @get_semvalue(i32 %0, i32 %1) {
%3 = load i32, i32* @GETVAL
%4 = tail call i32 @semctl(i32 %0, i32 %1, i32 %3, i32 0)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ x;
typedef int __u16;

/* Variables and functions */
unsigned short __swap16(unsigned short x) {
  return (((__u16)(x)&0xFF) << 8) | (((__u16)(x)&0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<__swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swap16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @__swap16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @__swap16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void call_update_id(int old_id, int new_id) {}


x86 assembly (clang, -O0):
<call_update_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_update_id>:
ret

LLVM IR (-O0):
define void @call_update_id(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @call_update_id(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bootstrapMatrix();
int /*<<< orphan*/ callColorFill(int, int, int);
int /*<<< orphan*/ printImg();
int /*<<< orphan*/ printf(char *);
int main() {
  bootstrapMatrix();
  int crow = 1;
  int ccol = 1;
  int ccolor = 4;
  callColorFill(crow, ccol, ccolor);
  printf("\n");
  printImg();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bootstrapMatrix@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <callColorFill@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <printImg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bootstrapMatrix@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   1060 <callColorFill@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <printImg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @bootstrapMatrix()
store i32 1, i32* %1
store i32 1, i32* %2
store i32 4, i32* %3
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @callColorFill(i32 %5, i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @printImg()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bootstrapMatrix()
%2 = tail call i32 @callColorFill(i32 1, i32 1, i32 4)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @printImg()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_header(FILE *f, const char *name) {
  fprintf(f,
          "F3 %s "
          "8.0"
          "\n"
          "Copyright (C) 2010 Digirati Internet LTDA.\n"
          "This is free software; see the source for copying conditions.\n"
          "\n",
          name);
}


x86 assembly (clang, -O0):
<print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_header>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [117 x i8] c"F3 %s 8.0\0ACopyright (C) 2010 Digirati Internet LTDA.\0AThis is free software; see the source for copying conditions.\0A\0A\00"
define void @print_header(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [117 x i8] c"F3 %s 8.0\0ACopyright (C) 2010 Digirati Internet LTDA.\0AThis is free software; see the source for copying conditions.\0A\0A\00"
define void @print_header(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t VGA_make_entry(char c, uint8_t color) {
  uint16_t c_16b = c;
  uint16_t color_16b = color;
  return c_16b | color_16b << 8;
}


x86 assembly (clang, -O0):
<VGA_make_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VGA_make_entry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @VGA_make_entry(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @VGA_make_entry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int mmio_read(int);
int /*<<< orphan*/ mmio_write(int, int);
void mbox_write(uint8_t channel, uint32_t data) {
  while (mmio_read(0x2000b880 + 0x18) & 0x80000000)
    ;
  mmio_write(0x2000b880 + 0x20,
             (data & 0xfffffff0) | (uint32_t)(channel & 0xf));
}


x86 assembly (clang, -O0):
<mbox_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2000b898,%edi
call   1030 <mmio_read@plt>
and    $0x80000000,%eax
cmp    $0x0,%eax
je     114b <mbox_write+0x2b>
jmp    112e <mbox_write+0xe>
mov    -0x8(%rbp),%esi
and    $0xfffffff0,%esi
mov    -0x4(%rbp),%eax
and    $0xf,%eax
or     %eax,%esi
mov    $0x2000b8a0,%edi
call   1040 <mmio_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbox_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2000b898,%edi
call   1030 <mmio_read@plt>
test   %eax,%eax
js     1130 <mbox_write+0x10>
and    $0xfffffff0,%ebp
and    $0xf,%ebx
or     %ebp,%ebx
mov    $0x2000b8a0,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mmio_write@plt>

LLVM IR (-O0):
define void @mbox_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = call i32 @mmio_read(i32 536918168)
%7 = and i32 %6, -2147483648
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32, i32* %4
%12 = and i32 %11, -16
%13 = load i32, i32* %3
%14 = and i32 %13, 15
%15 = or i32 %12, %14
%16 = call i32 @mmio_write(i32 536918176, i32 %15)
ret void
}

LLVM IR (-O2):
define void @mbox_write(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @mmio_read(i32 536918168)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = and i32 %1, -16
%8 = and i32 %0, 15
%9 = or i32 %7, %8
%10 = tail call i32 @mmio_write(i32 536918176, i32 %9)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void m2_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0((val & 0xF) << 14);
}


x86 assembly (clang, -O0):
<m2_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m2_setParams>:
mov    %esi,%edi
and    $0xf,%edi
shl    $0xe,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @m2_setParams(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 15
%8 = shl i32 %7, 14
%9 = call i32 @prg16setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m2_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = and i32 %3, 245760
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
int is_vowel(char ch) {
  return ((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') ||
          (ch == 'u'));
}


x86 assembly (clang, -O0):
<is_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x69,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6f,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_vowel+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vowel>:
lea    -0x61(%rdi),%eax
ror    %al
cmp    $0x8,%al
jae    111b <is_vowel+0x1b>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x95,%edx
bt     %ecx,%edx
jb     1124 <is_vowel+0x24>
xor    %eax,%eax
cmp    $0x75,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_vowel(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 97
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 101
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 111
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 117
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_vowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 8
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i8 %0, 117
%7 = zext i1 %6 to i32
br label %12
8: ; preds = %1
%9 = lshr i8 -107, %3
%10 = and i8 %9, 1
%11 = icmp eq i8 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bt_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<bt_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @bt_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @bt_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int rand();
int getRandomNumber(int minNum, int maxNum) {
  maxNum++;
  return (rand() % maxNum + minNum);
}


x86 assembly (clang, -O0):
<getRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandomNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = call i32 (...) @rand()
%8 = load i32, i32* %4
%9 = srem i32 %7, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getRandomNumber(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %3
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void file_error(char *name) { error("Could not open file: %s\n", name); }


x86 assembly (clang, -O0):
<file_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Could not open file: %s\0A\00"
define void @file_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Could not open file: %s\0A\00"
define void @file_error(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t max_sz(size_t x, size_t y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max_sz+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_sz+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_sz>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max_sz(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_sz(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ raiseError(int);
scalar_t__ removehostHeapNode(char *, int);
void freeMemoryInHeap(void *addr, int threadId) {
  char *address = (char *)addr;
  if (removehostHeapNode(address, threadId)) {
    free(address);
  } else {
    raiseError(0x11);
  }
}


x86 assembly (clang, -O0):
<freeMemoryInHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <removehostHeapNode@plt>
cmp    $0x0,%rax
je     116b <freeMemoryInHeap+0x3b>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1175 <freeMemoryInHeap+0x45>
mov    $0x11,%edi
call   1050 <raiseError@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMemoryInHeap>:
push   %rbx
mov    %rdi,%rbx
call   1040 <removehostHeapNode@plt>
test   %rax,%rax
je     1147 <freeMemoryInHeap+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
mov    $0x11,%edi
pop    %rbx
jmp    1050 <raiseError@plt>

LLVM IR (-O0):
define void @freeMemoryInHeap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i64 @removehostHeapNode(i8* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
br label %16
14: ; preds = %2
%15 = call i32 @raiseError(i32 17)
br label %16
16: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
define void @freeMemoryInHeap(i8* %0, i32 %1) {
%3 = tail call i64 @removehostHeapNode(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @raiseError(i32 17)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
gid_t getegid(void) {
  ;
  return 1;
}


x86 assembly (clang, -O0):
<getegid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getegid>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getegid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getegid() {
ret i32 1
}
void glClearDepthf(void) { return; }


x86 assembly (clang, -O0):
<glClearDepthf>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glClearDepthf>:
ret

LLVM IR (-O0):
define void @glClearDepthf() {
ret void
}

LLVM IR (-O2):
define void @glClearDepthf() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void set_big_endian_32(uint8_t *buf, uint32_t val) {
  buf[0] = (uint8_t)(val >> 24);
  buf[1] = (uint8_t)(val >> 16);
  buf[2] = (uint8_t)(val >> 8);
  buf[3] = (uint8_t)val;
}


x86 assembly (clang, -O0):
<set_big_endian_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_big_endian_32>:
mov    %esi,%eax
sar    $0x18,%eax
cltq
mov    %rax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rdi)
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,0x10(%rdi)
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @set_big_endian_32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %3
%19 = getelementptr inbounds i64, i64* %18, i64 2
store i64 %17, i64* %19
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 3
store i64 %21, i64* %23
ret void
}

LLVM IR (-O2):
define void @set_big_endian_32(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = ashr i32 %1, 16
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
%8 = ashr i32 %1, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %9, i64* %10
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
/* Type definitions */
typedef double int64_t;

/* Variables and functions */
double dpow(double a, int64_t b) {
  int64_t tmp = a;
  while (--b)
    a *= tmp;
  return a;
}


x86 assembly (clang, -O0):
<dpow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1142 <dpow+0x42>
jp     1142 <dpow+0x42>
jmp    1156 <dpow+0x56>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1118 <dpow+0x18>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpow>:
addsd  0xef8(%rip),%xmm1
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm1
jne    1114 <dpow+0x14>
jnp    1134 <dpow+0x34>
movsd  0xee4(%rip),%xmm4
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm4,%xmm1
ucomisd %xmm3,%xmm1
jne    1120 <dpow+0x20>
jp     1120 <dpow+0x20>
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
store double %6, double* %5
br label %7
7: ; preds = %11, %2
%8 = load double, double* %4
%9 = fadd double %8, -1.000000e+00
store double %9, double* %4
%10 = fcmp une double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load double, double* %5
%13 = load double, double* %3
%14 = fmul double %13, %12
store double %14, double* %3
br label %7
15: ; preds = %7
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @dpow(double %0, double %1) {
%3 = fadd double %1, -1.000000e+00
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi double [ %9, %5 ], [ %3, %2 ]
%7 = phi double [ %8, %5 ], [ %0, %2 ]
%8 = fmul double %7, %0
%9 = fadd double %6, -1.000000e+00
%10 = fcmp une double %9, 0.000000e+00
br i1 %10, label %5, label %11
11: ; preds = %5, %2
%12 = phi double [ %0, %2 ], [ %8, %5 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ CDROMEJECT;
int O_NONBLOCK;
int O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int);
int main(void) {
  int fd;
  fd = open("/dev/sr0", O_RDWR | O_NONBLOCK);
  ioctl(fd, CDROMEJECT, 0);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
or     (%rax),%esi
lea    0xea8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/sr0\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@CDROMEJECT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* @CDROMEJECT
%9 = call i32 @ioctl(i32 %7, i32 %8, i32 0)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/sr0\00"
@O_RDWR = global i32 0
@O_NONBLOCK = global i32 0
@CDROMEJECT = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @CDROMEJECT
%6 = tail call i32 @ioctl(i32 %4, i32 %5, i32 0)
%7 = tail call i32 @close(i32 %4)
ret i32 0
}
unsigned int modulo(unsigned int data, unsigned int shift) {
  unsigned int div = data >> shift;
  unsigned int mult = div << shift;
  return data - mult;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @modulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = lshr i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = shl i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %6
%15 = sub i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putch(char);
int strlen(char *);
void puts(char *text) {
  int i;
  for (i = 0; i < strlen(text); i++) {
    putch(text[i]);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116e <puts+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <putch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    115d <puts+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <putch@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putch(i8 signext %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @putch(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
void SVC_Handler(void) { fault_info(__FUNCTION__, sizeof(__FUNCTION__)); }


x86 assembly (clang, -O0):
<SVC_Handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xc,%esi
mov    $0x0,%al
call   1030 <fault_info@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SVC_Handler>:
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
jmp    1030 <fault_info@plt>

LLVM IR (-O0):
@__FUNCTION__.SVC_Handler = [12 x i8] c"SVC_Handler\00"
define void @SVC_Handler() {
%1 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @fault_info to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.SVC_Handler, i64 0, i64 0), i64 12)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.SVC_Handler = [12 x i8] c"SVC_Handler\00"
define void @SVC_Handler() {
%1 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @fault_info to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.SVC_Handler, i64 0, i64 0), i64 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AT_HWCAP;
scalar_t__ get_auxv_entry(int /*<<< orphan*/);
bool have_hwcap(unsigned long ftr) {
  return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr;
}


x86 assembly (clang, -O0):
<have_hwcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <get_auxv_entry@plt>
and    -0x8(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_hwcap>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <get_auxv_entry@plt>
not    %rax
xor    %ecx,%ecx
test   %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AT_HWCAP = global i32 0
define i32 @have_hwcap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @AT_HWCAP
%4 = call i64 @get_auxv_entry(i32 %3)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = load i64, i64* %2
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@AT_HWCAP = global i32 0
define i32 @have_hwcap(i64 %0) {
%2 = load i32, i32* @AT_HWCAP
%3 = tail call i64 @get_auxv_entry(i32 %2)
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}