xunge/DecIR huggingface dataset:
/* Variables and functions */
int hp1();
int main(void) { return hp1(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @hp1()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hp1()
ret i32 %1
}
int view_top(struct view *v) {
  (void)v;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.view = type opaque
define i32 @view_top(%struct.view* %0) {
%2 = alloca %struct.view*
store %struct.view* %0, %struct.view** %2
%3 = load %struct.view*, %struct.view** %2
ret i32 0
}

LLVM IR (-O2):
%struct.view = type opaque
define i32 @view_top(%struct.view* nocapture readnone %0) {
ret i32 0
}
__attribute__((always_, unused)) void
ips_change_bit(int nr, volatile unsigned long *addr) {
  asm volatile("lock "
               "btcl %1,%0"
               : "=m"(*addr)
               : "dIr"(nr));
}


x86 assembly (clang, -O0):
<ips_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btc %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ips_change_bit>:
lock btc %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ips_change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "lock btcl $1,$0", "=*m,{dx}Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
void *syscall_mmap_archive() {
  void *ret;
  __asm__ volatile("syscall" : "=a"(ret) : "a"(0x8) : "%rcx", "%r11");
  return ret;
}


x86 assembly (clang, -O0):
<syscall_mmap_archive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%eax
syscall
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_mmap_archive>:
mov    $0x8,%eax
syscall
ret

LLVM IR (-O0):
define i8* @syscall_mmap_archive() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i32 8)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @syscall_mmap_archive() {
%1 = tail call i8* asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i32 8)
ret i8* %1
}
int setbit(int n) { return (n > 0 ? 1 + setbit(n / 2) : 0); }


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1142 <setbit+0x32>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <setbit@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <setbit+0x3c>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <setbit+0x3c>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <setbit+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <setbit+0x10>
ret

LLVM IR (-O0):
define i32 @setbit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = call i32 @setbit(i32 %7)
%9 = add nsw i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i32 [ %9, %5 ], [ 0, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @setbit(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  n % 2 == 0 ? printf("Even number\n") : printf("Odd number\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xed0(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Even number\0A\00"
@.str.2 = [12 x i8] c"Odd number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [11 x i8] c"Odd number\00"
@str.3 = [12 x i8] c"Even number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
int complex_pointer() { int (*g(int ***e[10]))(); }


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

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

LLVM IR (-O0):
define i32 @complex_pointer() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @complex_pointer() {
ret i32 undef
}
/* Variables and functions */
int sqrt(int);
int fun(int a, int b) {
  int m;
  m = sqrt(a * 1000 + a * 100 + b * 10 + b);
  if (m * m == a * 1000 + a * 100 + b * 10 + b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
imul   $0x3e8,-0x8(%rbp),%edi
imul   $0x64,-0x8(%rbp),%eax
add    %eax,%edi
imul   $0xa,-0xc(%rbp),%eax
add    %eax,%edi
add    -0xc(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   $0x3e8,-0x8(%rbp),%ecx
imul   $0x64,-0x8(%rbp),%edx
add    %edx,%ecx
imul   $0xa,-0xc(%rbp),%edx
add    %edx,%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    116d <fun+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <fun+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
imul   $0x44c,%edi,%eax
lea    (%rsi,%rsi,4),%ecx
add    %esi,%eax
lea    (%rax,%rcx,2),%ebx
mov    %ebx,%edi
call   1030 <sqrt@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 1000
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 100
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 10
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = call i32 @sqrt(i32 %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32, i32* %6
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %4
%22 = mul nsw i32 %21, 1000
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 100
%25 = add nsw i32 %22, %24
%26 = load i32, i32* %5
%27 = mul nsw i32 %26, 10
%28 = add nsw i32 %25, %27
%29 = load i32, i32* %5
%30 = add nsw i32 %28, %29
%31 = icmp eq i32 %20, %30
br i1 %31, label %32, label %33
32: ; preds = %2
store i32 1, i32* %3
br label %34
33: ; preds = %2
store i32 0, i32* %3
br label %34
34: ; preds = %33, %32
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @fun(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1100
%4 = mul nsw i32 %1, 10
%5 = add i32 %3, %1
%6 = add i32 %5, %4
%7 = tail call i32 @sqrt(i32 %6)
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exitA21() { printf("A21\n"); }


x86 assembly (clang, -O0):
<exitA21>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exitA21>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"A21\0A\00"
define void @exitA21() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"A21\00"
define void @exitA21() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
int test6() { return 0; }


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

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

LLVM IR (-O0):
define i32 @test6() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test6() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _kill(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void _exit(int status) {
  _kill(status, -1);
  fflush(stdout);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
call   1030 <_kill@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
jmp    1146 <_exit+0x26>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    $0xffffffff,%esi
call   1030 <_kill@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
nopl   0x0(%rax)
jmp    1140 <_exit+0x20>

LLVM IR (-O0):
@stdout = global i32 0
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_kill(i32 %3, i32 -1)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
@stdout = global i32 0
define void @_exit(i32 %0) {
%2 = tail call i32 @_kill(i32 %0, i32 -1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}
long __ocl_select_long_long(long a, long b, long c) { return c ? b : a; }


x86 assembly (clang, -O0):
<__ocl_select_long_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1128 <__ocl_select_long_long+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <__ocl_select_long_long+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_select_long_long>:
mov    %rdi,%rax
test   %rdx,%rdx
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @__ocl_select_long_long(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, i64 %0, i64 %1
ret i64 %5
}
void g_object_interface_list_properties() {}


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

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

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

LLVM IR (-O2):
define void @g_object_interface_list_properties() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void erreur_superposition(int indiceP_A, int indiceP_B) {
  if (indiceP_B > indiceP_A) {
    int temp = indiceP_A;
    indiceP_A = indiceP_B;
    indiceP_B = temp;
  }
  printf("les personnes d'indices %d et %d se superposent !\n", indiceP_A,
         indiceP_B);
}


x86 assembly (clang, -O0):
<erreur_superposition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    113c <erreur_superposition+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erreur_superposition>:
cmp    %edi,%esi
mov    %esi,%edx
cmovg  %edi,%edx
cmovle %edi,%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"les personnes d'indices %d et %d se superposent !\0A\00"
define void @erreur_superposition(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"les personnes d'indices %d et %d se superposent !\0A\00"
define void @erreur_superposition(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %4)
ret void
}
void initpool() {}


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

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

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

LLVM IR (-O2):
define void @initpool() {
ret void
}
void createVarName(unsigned char x, unsigned int y, char varname[]) {
  varname[0] = x;
  varname[1] = '0' + y / 10;
  varname[2] = '0' + y % 10;
  varname[3] = 0;
}


x86 assembly (clang, -O0):
<createVarName>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<createVarName>:
mov    %dil,(%rdx)
mov    %esi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    0x30(%rcx),%eax
mov    %al,0x1(%rdx)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%esi
or     $0x30,%sil
mov    %sil,0x2(%rdx)
movb   $0x0,0x3(%rdx)
ret

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

LLVM IR (-O2):
define void @createVarName(i8 zeroext %0, i32 %1, i8* nocapture writeonly %2) {
store i8 %0, i8* %2
%4 = udiv i32 %1, 10
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 48
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %6, i8* %7
%8 = urem i32 %1, 10
%9 = trunc i32 %8 to i8
%10 = or i8 %9, 48
%11 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %10, i8* %11
%12 = getelementptr inbounds i8, i8* %2, i64 3
store i8 0, i8* %12
ret void
}
float _Complex add_float_cr(float _Complex a, float b) { return a + b; }


x86 assembly (clang, -O0):
<add_float_cr>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
addss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_float_cr>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @add_float_cr(<2 x float> %0, float %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca float
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
store float %1, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%10 = load float, float* %9
%11 = load float, float* %5
%12 = fadd float %8, %11
%13 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%14 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %12, float* %13
store float %10, float* %14
%15 = bitcast { float, float }* %3 to <2 x float>*
%16 = load <2 x float>, <2 x float>* %15
ret <2 x float> %16
}

LLVM IR (-O2):
define <2 x float> @add_float_cr(<2 x float> %0, float %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = fadd float %3, %1
%5 = insertelement <2 x float> %0, float %4, i64 0
ret <2 x float> %5
}
int do_759() { return 759; }


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

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

LLVM IR (-O0):
define i32 @do_759() {
ret i32 759
}

LLVM IR (-O2):
define i32 @do_759() {
ret i32 759
}
void ff_h264_pred_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264_pred_init_mips() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void filecopy(int from, int to) {
  int n;
  char buf[1024];
  while ((n = read(from, buf, 1024)) > 0)
    write(to, buf, n);
}


x86 assembly (clang, -O0):
<filecopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    1168 <filecopy+0x48>
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
jmp    1131 <filecopy+0x11>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecopy>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <filecopy+0x50>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <filecopy+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @filecopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = load i32, i32* %5
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @filecopy(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 1024)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @write(i32 %1, i8* %4, i32 %8)
%10 = call i32 @read(i32 %0, i8* %4, i32 1024)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void CRYPTO_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<CRYPTO_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):
<CRYPTO_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @CRYPTO_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 @CRYPTO_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
int __syscall_error(int err_no) {
  __set_errno(err_no);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__syscall_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
define i32 @__syscall_error(i32 %0) {
%2 = tail call i32 @__set_errno(i32 %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xd9() {
  Assert_real((isprint(217) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1090, ("isprint should be 0 for 0xd9"));
}


x86 assembly (clang, -O0):
<t_isprint_0xd9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x442,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xd9>:
push   %rax
mov    $0xd9,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x442,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd9\00"
define void @t_isprint_0xd9() {
%1 = call i64 @isprint(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd9\00"
define void @t_isprint_0xd9() {
%1 = tail call i64 @isprint(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num1, num2;
  int sum;
  num1 = 2;
  num2 = 5;
  sum = num1 + num2;
  printf("The result is %d\n", sum);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
int oakley_get_defaultlifetime() { return 28800; }


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

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

LLVM IR (-O0):
define i32 @oakley_get_defaultlifetime() {
ret i32 28800
}

LLVM IR (-O2):
define i32 @oakley_get_defaultlifetime() {
ret i32 28800
}
void insb(short port, void *buf, int size) {
  __asm__("rep insb" ::"D"(buf), "d"(port), "c"(size));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2(%rbp),%dx
mov    -0x14(%rbp),%ecx
rep insb (%dx),%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 signext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i16, i16* %4
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 signext %0, i8* %1, i32 %2) {
tail call void asm sideeffect "rep insb", "{di},{dx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %1, i16 %0, i32 %2)
ret void
}
void vmm_trace_stop() {}


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

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

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

LLVM IR (-O2):
define void @vmm_trace_stop() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int count = 0;
  pid_t my_pid = getpid();
  while (1) {
    printf("Process %d is calculating ...  %d \n", my_pid, count++);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1157 <main+0x27>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%r15d
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %ebp,%ebx
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [36 x i8] c"Process %d is calculating ... %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 (...) @getpid()
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %9
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%14 = call i32 @sleep(i32 1)
br label %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"Process %d is calculating ... %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ 0, %2 ], [ %6, %4 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%8 = tail call i32 @sleep(i32 1)
br label %4
}
read_bmp_file_header(file_name, file_header) char *file_name;
struct bmpfileheader *file_header;
{
}


x86 assembly (clang, -O0):
<read_bmp_file_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bmpfileheader = type opaque
define i32 @read_bmp_file_header(i8* %0, %struct.bmpfileheader* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.bmpfileheader*
store i8* %0, i8** %4
store %struct.bmpfileheader* %1, %struct.bmpfileheader** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.bmpfileheader = type opaque
define i32 @read_bmp_file_header(i8* nocapture readnone %0, %struct.bmpfileheader* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_module_info() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_module_info"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_module_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_context_get_module_info>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_context_get_module_info\0A\00"
define i32 @pa_context_get_module_info() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_context_get_module_info\00"
define i32 @pa_context_get_module_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ do_error(char *);
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int tw_pthread_cond_broadcast(pthread_cond_t *c) {
  int return_value;
  if ((return_value = pthread_cond_broadcast(c)) == -1)
    do_error("pthread_cond_broadcast");
  return (return_value);
}


x86 assembly (clang, -O0):
<tw_pthread_cond_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    114d <tw_pthread_cond_broadcast+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <do_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tw_pthread_cond_broadcast>:
push   %rbx
call   1030 <pthread_cond_broadcast@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <tw_pthread_cond_broadcast+0x19>
lea    0xecc(%rip),%rdi
call   1040 <do_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"pthread_cond_broadcast\00"
define i32 @tw_pthread_cond_broadcast(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_cond_broadcast(i32* %4)
store i32 %5, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @do_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"pthread_cond_broadcast\00"
define i32 @tw_pthread_cond_broadcast(i32* %0) {
%2 = tail call i32 @pthread_cond_broadcast(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @do_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr(char const *s) {
  if (s)
    write(1, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <ft_putstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
test   %rdi,%rdi
je     113e <ft_putstr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @write(i32 1, i8* %6, i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000044))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<UARTIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x44(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x44(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UARTIntClear(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 = call i32 @UARTBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 68
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @UARTIntClear(i64 %0, i64 %1) {
%3 = tail call i32 @UARTBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 68
%6 = inttoptr i64 %5 to i64*
store volatile i64 %1, i64* %6
ret void
}
/* Variables and functions */
int charybdis_main(int, char const **);
int main(int argc, const char *argv[]) { return charybdis_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <charybdis_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <charybdis_main@plt>

LLVM IR (-O0):
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @charybdis_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @charybdis_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *execname) {
  printf("Usage: %s <microcode.bin>\n", execname);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s <microcode.bin>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s <microcode.bin>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
float INFINITY;
bool stdlib_base_is_negative_zerof(const float x) {
  return (x == 0.0f && 1.0f / x == -INFINITY);
}


x86 assembly (clang, -O0):
<stdlib_base_is_negative_zerof>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    1158 <stdlib_base_is_negative_zerof+0x58>
jp     1158 <stdlib_base_is_negative_zerof+0x58>
movss  0xed3(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
movss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_is_negative_zerof>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1135 <stdlib_base_is_negative_zerof+0x35>
jp     1135 <stdlib_base_is_negative_zerof+0x35>
movss  0xeee(%rip),%xmm1
mov    0x2ecf(%rip),%rax
movss  (%rax),%xmm2
xorps  0xeec(%rip),%xmm2
divss  %xmm0,%xmm1
cmpeqss %xmm1,%xmm2
movd   %xmm2,%eax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
define i32 @stdlib_base_is_negative_zerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load float, float* %2
%7 = fdiv float 1.000000e+00, %6
%8 = load float, float* @INFINITY
%9 = fneg float %8
%10 = fcmp oeq float %7, %9
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
define i32 @stdlib_base_is_negative_zerof(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fdiv float 1.000000e+00, %0
%5 = load float, float* @INFINITY
%6 = fneg float %5
%7 = fcmp oeq float %4, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
int isprime(int n) {
  int i;
  for (i = 2; i < n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isprime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isprime+0x50>
jmp    113b <isprime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isprime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isprime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %2
br label %20
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 1, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ cook();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
done() {
  cook();
  exit(0);
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cook@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %eax,%eax
call   1030 <cook@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @done() {
%1 = call i32 (...) @cook()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @done() {
%1 = tail call i32 (...) @cook()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int **);
int main() {
  int *c;
  foo(&c);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32 @foo(i32** %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @foo(i32** %1)
ret i32 0
}
signed char convert_signed_int_to_signed_char(signed int x) { return x; }


x86 assembly (clang, -O0):
<convert_signed_int_to_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_signed_int_to_signed_char>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @convert_signed_int_to_signed_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @convert_signed_int_to_signed_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
volatile bool switchIter(volatile unsigned int *p) {
  return (((*p) & 0x00000020) == 0x00000020);
}


x86 assembly (clang, -O0):
<switchIter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switchIter>:
mov    (%rdi),%eax
shr    $0x5,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @switchIter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load volatile i32, i32* %3
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 32
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @switchIter(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = lshr i32 %2, 5
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RadioComBridgeStatsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RadioComBridgeStatsUpdated() {
  UAVObjUpdated(RadioComBridgeStatsHandle());
}


x86 assembly (clang, -O0):
<RadioComBridgeStatsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RadioComBridgeStatsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadioComBridgeStatsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RadioComBridgeStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RadioComBridgeStatsUpdated() {
%1 = call i32 (...) @RadioComBridgeStatsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RadioComBridgeStatsUpdated() {
%1 = tail call i32 (...) @RadioComBridgeStatsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n1 = 5, n2 = 6, n3;
  n3 = n1 | n2;
  printf("n1 | n2 = %d\n", n3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"n1 | n2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}