xunge/DecIR huggingface dataset:
int __test_and_change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(long) * 8)));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (sizeof(long) * 8));
  unsigned long old = *p;
  *p = old ^ mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
xor    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_change_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rdx
mov    %rdx,%rdi
btc    %rcx,%rdi
mov    %rdi,(%rsi,%rax,8)
xor    %eax,%eax
bt     %rcx,%rdx
setb   %al
ret

LLVM IR (-O0):
define i32 @__test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = urem i64 %9, 64
%11 = shl i64 1, %10
store i64 %11, i64* %5
%12 = load i64*, i64** %4
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = udiv i64 %14, 64
%16 = getelementptr inbounds i64, i64* %12, i64 %15
store i64* %16, i64** %6
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = load i64, i64* %5
%21 = xor i64 %19, %20
%22 = load i64*, i64** %6
store i64 %21, i64* %22
%23 = load i64, i64* %7
%24 = load i64, i64* %5
%25 = and i64 %23, %24
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @__test_and_change_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = xor i64 %8, %5
store i64 %9, i64* %7
%10 = and i64 %8, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_manager_enable_role_device_priority_routing() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_manager_enable_role_device_priority_routing"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ext_device_manager_enable_role_device_priority_routing>:
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_ext_device_manager_enable_role_device_priority_routing>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [74 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_enable_role_device_priority_routing\00"
define i32 @pa_ext_device_manager_enable_role_device_priority_routing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, ...);
void *malloc(size_t);
void *sMalloc(size_t size) {
  if (size == 0) {
    die("unable to allocate 0 bytes");
  }
  void *data = malloc(size);
  if (data == NULL) {
    die("out of memory: failed to allocate %zu bytes", size);
  }
  return data;
}


x86 assembly (clang, -O0):
<sMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <sMalloc+0x25>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <sMalloc+0x4f>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
jne    113a <sMalloc+0x1a>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <die@plt>
mov    %r14,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <sMalloc+0x3b>
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"unable to allocate 0 bytes\00"
@.str.1 = [44 x i8] c"out of memory: failed to allocate %zu bytes\00"
define i8* @sMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i64, i64* %2
%15 = call i32 (i8*, ...) @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %8
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"unable to allocate 0 bytes\00"
@.str.1 = [44 x i8] c"out of memory: failed to allocate %zu bytes\00"
define noalias i8* @sMalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (i8*, ...) @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int rand();
int soru_sor() {
  int birinci_sayi, ikinci_sayi, carpim;
  birinci_sayi = rand() % 10;
  ikinci_sayi = rand() % 10;
  printf("%d kere %d kactir?\n", birinci_sayi, ikinci_sayi);
  carpim = birinci_sayi * ikinci_sayi;
  return carpim;
}


x86 assembly (clang, -O0):
<soru_sor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_sor>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%r14
imul   $0x66666667,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r14d
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    0xe8a(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
imul   %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d kere %d kactir?\0A\00"
define i32 @soru_sor() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 10
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d kere %d kactir?\0A\00"
define i32 @soru_sor() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = mul nsw i32 %4, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("Usage:\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int isEmpty(struct Stack *head) { return !head; }


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.Stack = type opaque
define i32 @isEmpty(%struct.Stack* %0) {
%2 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %2
%3 = load %struct.Stack*, %struct.Stack** %2
%4 = icmp ne %struct.Stack* %3, null
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.Stack = type opaque
define i32 @isEmpty(%struct.Stack* readnone %0) {
%2 = icmp eq %struct.Stack* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_super(char *who) { printf("%s is superrr cool......\n", who); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"%s is superrr cool......\0A\00"
define void @print_super(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s is superrr cool......\0A\00"
define void @print_super(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(262, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x106,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_target_system>:
mov    $0x106,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 262, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 262, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void INC_HOST_REG(int host_reg) { addbyte(0x40 | host_reg); }


x86 assembly (clang, -O0):
<INC_HOST_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x40,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_HOST_REG>:
or     $0x40,%edi
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @INC_HOST_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 64, %3
%5 = call i32 @addbyte(i32 %4)
ret void
}

LLVM IR (-O2):
define void @INC_HOST_REG(i32 %0) {
%2 = or i32 %0, 64
%3 = tail call i32 @addbyte(i32 %2)
ret void
}
int main(int argc, char const *argv[]) {
  int i = 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _setbit(struct bitmask *, unsigned int, int /*<<< orphan*/);
struct bitmask *numa_bitmask_clearbit(struct bitmask *bmp, unsigned int i) {
  _setbit(bmp, i, 0);
  return bmp;
}


x86 assembly (clang, -O0):
<numa_bitmask_clearbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <_setbit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_bitmask_clearbit>:
push   %rbx
mov    %rdi,%rbx
xor    %edx,%edx
call   1030 <_setbit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define %struct.bitmask* @numa_bitmask_clearbit(%struct.bitmask* %0, i32 %1) {
%3 = alloca %struct.bitmask*
%4 = alloca i32
store %struct.bitmask* %0, %struct.bitmask** %3
store i32 %1, i32* %4
%5 = load %struct.bitmask*, %struct.bitmask** %3
%6 = load i32, i32* %4
%7 = call i32 @_setbit(%struct.bitmask* %5, i32 %6, i32 0)
%8 = load %struct.bitmask*, %struct.bitmask** %3
ret %struct.bitmask* %8
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define %struct.bitmask* @numa_bitmask_clearbit(%struct.bitmask* returned %0, i32 %1) {
%3 = tail call i32 @_setbit(%struct.bitmask* %0, i32 %1, i32 0)
ret %struct.bitmask* %0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int fputs(const char *str, void **f) {
  printk("Write fputs()\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<fputs>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Write fputs()\0A\00"
define i32 @fputs(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Write fputs()\0A\00"
define i32 @fputs(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
struct waitq_link *waitq_link_find_protected(struct waitq_link *uwql) {
  return uwql;
}


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

x86 assembly (clang, -O2):
<waitq_link_find_protected>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.waitq_link = type opaque
define %struct.waitq_link* @waitq_link_find_protected(%struct.waitq_link* readnone returned %0) {
ret %struct.waitq_link* %0
}
void brief_output(struct cnode *cnode, unsigned int indent) {
  printf("%*s<brief>\n", indent, "");
  outputchildren(cnode, indent, 1);
  printf("%*s</brief>\n", indent, "");
}


x86 assembly (clang, -O0):
<brief_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
lea    0xed8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <outputchildren@plt>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
lea    0xead(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brief_output>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
lea    0xee0(%rip),%r15
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <outputchildren@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.cnode = type opaque
@.str = [12 x i8] c"%*s<brief>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"%*s</brief>\0A\00"
define void @brief_output(%struct.cnode* %0, i32 %1) {
%3 = alloca %struct.cnode*
%4 = alloca i32
store %struct.cnode* %0, %struct.cnode** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load %struct.cnode*, %struct.cnode** %3
%8 = load i32, i32* %4
%9 = call i32 (%struct.cnode*, i32, i32, ...) bitcast (i32 (...)* @outputchildren to i32 (%struct.cnode*, i32, i32, ...)*)(%struct.cnode* %7, i32 %8, i32 1)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.cnode = type opaque
@.str = [12 x i8] c"%*s<brief>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"%*s</brief>\0A\00"
define void @brief_output(%struct.cnode* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (%struct.cnode*, i32, i32, ...) bitcast (i32 (...)* @outputchildren to i32 (%struct.cnode*, i32, i32, ...)*)(%struct.cnode* %0, i32 %1, i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int dup3(int, int, int /*<<< orphan*/);
int dup2(int fd1, int fd2) {
  if (fd1 == fd2)
    return fd2;
  return dup3(fd1, fd2, 0);
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <dup2+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <dup2+0x35>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <dup3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
cmp    %esi,%edi
jne    1117 <dup2+0x7>
mov    %edi,%eax
ret
xor    %edx,%edx
jmp    1030 <dup3@plt>

LLVM IR (-O0):
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @dup3(i32 %12, i32 %13, i32 0)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @dup3(i32 %0, i32 %1, i32 0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
/* Variables and functions */
char lireCaractere();
int /*<<< orphan*/ printf(char *);
char proposezLettre() {
  char maLettre;
  printf("\nProposez une lettre : ");
  maLettre = lireCaractere();
  return maLettre;
}


x86 assembly (clang, -O0):
<proposezLettre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <lireCaractere@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proposezLettre>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lireCaractere@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AProposez une lettre : \00"
define signext i8 @proposezLettre() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @lireCaractere()
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AProposez une lettre : \00"
define signext i8 @proposezLettre() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @lireCaractere()
ret i8 %2
}
unsigned kol_process_info(unsigned slot, char buf1k[]) {
  asm volatile("int $0x40" ::"a"(9), "b"(buf1k), "c"(slot));
}


x86 assembly (clang, -O0):
<kol_process_info>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rbx
mov    -0x10(%rbp),%ecx
mov    $0x9,%eax
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_process_info>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
mov    $0x9,%eax
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_process_info(i32 %0, i8* %1) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i8* %1, i32 %0)
ret i32 undef
}
long min(long v1, long v2) { return v1 > v2 ? v2 : v1; }


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

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

LLVM IR (-O0):
define i64 @min(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 sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *entry) {
  char *target = (char *)malloc(strlen(entry) + 1);
  if (target == 0)
    return 0;
  strcpy(target, entry);
  return target;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
int fiftyoneDegreesGetIsThreadSafe() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fiftyoneDegreesGetIsThreadSafe() {
ret i32 1
}
int is_not_space(char a) { return a != ' '; }


x86 assembly (clang, -O0):
<is_not_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_not_space>:
xor    %eax,%eax
cmp    $0x20,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @is_not_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_not_space(i8 signext %0) {
%2 = icmp ne i8 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
int capture_char(const char *carg, void *pvar) {
  char *pc = pvar;
  *pc = *carg;
  return *pc ? 0 : 1;
}


x86 assembly (clang, -O0):
<capture_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_char>:
mov    (%rdi),%cl
mov    %cl,(%rsi)
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @capture_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = load i8*, i8** %5
store i8 %8, i8* %9
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @capture_char(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int cmp_pointer(const void *ptr1, const void *ptr2) { return ptr1 == ptr2; }


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

x86 assembly (clang, -O2):
<cmp_pointer>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @cmp_pointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp_pointer(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t timespec_to_ns(struct timespec *ts) {
  return (uint64_t)ts->tv_sec * 1000000000ULL + (uint64_t)ts->tv_nsec;
}


x86 assembly (clang, -O0):
<timespec_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,0x8(%rax),%rax
3b
mov    -0x8(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ns>:
imul   $0x3b9aca00,0x8(%rdi),%rax
3b
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ FW_CDEV_IOC_SEND_REQUEST;
int /*<<< orphan*/ do_write_request(int /*<<< orphan*/);
void do_write(void) { do_write_request(FW_CDEV_IOC_SEND_REQUEST); }


x86 assembly (clang, -O0):
<do_write>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <do_write_request@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_write_request@plt>

LLVM IR (-O0):
@FW_CDEV_IOC_SEND_REQUEST = global i32 0
define void @do_write() {
%1 = load i32, i32* @FW_CDEV_IOC_SEND_REQUEST
%2 = call i32 @do_write_request(i32 %1)
ret void
}

LLVM IR (-O2):
@FW_CDEV_IOC_SEND_REQUEST = global i32 0
define void @do_write() {
%1 = load i32, i32* @FW_CDEV_IOC_SEND_REQUEST
%2 = tail call i32 @do_write_request(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void fileCopy(FILE *ifp, FILE *ofp) {
  int c;
  while ((c = getc(ifp)) != EOF) {
    putc(c, ofp);
  }
}


x86 assembly (clang, -O0):
<fileCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <fileCopy+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <fileCopy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileCopy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <fileCopy+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <fileCopy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @fileCopy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @fileCopy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ diff(int *, int, int *, int, int *);
int main() {
  int *A;
  int Alen = __VERIFIER_nondet_int();
  int *B;
  int Blen = __VERIFIER_nondet_int();
  int *D;
  diff(A, Alen, B, Blen, D);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
call   1040 <diff@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%esi
mov    %eax,%ecx
call   1040 <diff@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = call i32 @diff(i32* %9, i32 %10, i32* %11, i32 %12, i32* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @diff(i32* undef, i32 %1, i32* undef, i32 %2, i32* undef)
ret i32 0
}
int isOddNumber(int value) { return (value % 2 == 1); }


x86 assembly (clang, -O0):
<isOddNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOddNumber>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isOddNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isOddNumber(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
void rop3_112_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_112_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_112_0_0>:
and    (%rdi),%sil
not    %sil
and    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_112_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_112_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
store i8 %7, i8* %0
ret void
}
__attribute__((visibility("hidden"))) char itoc(const int source) {
  if ((source >= 0) && (source <= 9)) {
    return ('0' + source);
  } else {
    return ('A' + (source - 10));
  }
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <itoc+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <itoc+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1135 <itoc+0x35>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define hidden signext i8 @itoc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %18
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 65, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %9
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define hidden signext i8 @itoc(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ free_(void *);
void Free_(void *block) { free_(block); }


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

LLVM IR (-O0):
define void @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 @Free_(i8* %0) {
%2 = tail call i32 @free_(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int aeron_alloc(void **ptr, size_t size) {
  *ptr = malloc(size);
  if (NULL == *ptr) {
    errno = ENOMEM;
    return -1;
  }
  memset(*ptr, 0, size);
  return 0;
}


x86 assembly (clang, -O0):
<aeron_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
jne    1170 <aeron_alloc+0x50>
mov    0x2e87(%rip),%rax
mov    (%rax),%ecx
mov    0x2e76(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <aeron_alloc+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,0x0(%rbp)
test   %rax,%rax
je     114b <aeron_alloc+0x2b>
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    1162 <aeron_alloc+0x42>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    0x2e7d(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @aeron_alloc(i8** %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = call i8* @malloc(i64 %6)
%8 = load i8**, i8*** %4
store i8* %7, i8** %8
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = icmp eq i8* null, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @ENOMEM
store i32 %13, i32* @errno
store i32 -1, i32* %3
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %4
%16 = load i8*, i8** %15
%17 = load i64, i64* %5
%18 = call i32 @memset(i8* %16, i32 0, i64 %17)
store i32 0, i32* %3
br label %19
19: ; preds = %14, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @aeron_alloc(i8** nocapture writeonly %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
store i8* %3, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i32, i32* @ENOMEM
store i32 %6, i32* @errno
br label %9
7: ; preds = %2
%8 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ readInstruction();
int32_t LCDIntf_ReadInstruction(void) { return readInstruction(); }


x86 assembly (clang, -O0):
<LCDIntf_ReadInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <readInstruction@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @LCDIntf_ReadInstruction() {
%1 = call i32 (...) @readInstruction()
ret i32 %1
}

LLVM IR (-O2):
define i32 @LCDIntf_ReadInstruction() {
%1 = tail call i32 (...) @readInstruction()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ kill_all_children(int /*<<< orphan*/);
int /*<<< orphan*/ start();
void restart_all_commands(int signum) {
  kill_all_children(0);
  start();
}


x86 assembly (clang, -O0):
<restart_all_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <kill_all_children@plt>
mov    $0x0,%al
call   1030 <start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restart_all_commands>:
push   %rax
xor    %edi,%edi
call   1040 <kill_all_children@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <start@plt>

LLVM IR (-O0):
define void @restart_all_commands(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @kill_all_children(i32 0)
%4 = call i32 (...) @start()
ret void
}

LLVM IR (-O2):
define void @restart_all_commands(i32 %0) {
%2 = tail call i32 @kill_all_children(i32 0)
%3 = tail call i32 (...) @start()
ret void
}
int GdCaptureScreen(char *path) { return 0; }


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

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

LLVM IR (-O0):
define i32 @GdCaptureScreen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @GdCaptureScreen(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ puts(char *);
int main(void) { return puts("Hello world!") <= 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp sle i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i64 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int write(int, char *, int);
int sio_write(int fd, char *buf, int len) { return (write(fd, buf, len)); }


x86 assembly (clang, -O0):
<sio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @sio_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sio_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double return_dbl(double dbl) {
  printf("%f\n", dbl);
  return 2 * dbl;
}


x86 assembly (clang, -O0):
<return_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeca(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_dbl>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define double @return_dbl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = load double, double* %2
%6 = fmul double 2.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define double @return_dbl(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
%3 = fmul double %0, 2.000000e+00
ret double %3
}