xunge/DecIR huggingface dataset:
int int_max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <int_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void *es_par(void *n) {
  long num = *((long *)n);
  if (num % 2 == 0) {
    return (void *)1;
  }
  return (void *)0;
}


x86 assembly (clang, -O0):
<es_par>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1139 <es_par+0x39>
mov    $0x1,%eax
mov    %rax,-0x8(%rbp)
jmp    1141 <es_par+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_par>:
xor    %eax,%eax
testb  $0x1,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i8* @es_par(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = srem i64 %8, 2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* inttoptr (i64 1 to i8*), i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %11
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @es_par(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* inttoptr (i64 1 to i8*), i8* null
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
double get_time(int /*<<< orphan*/);
double get_unix_time() { return get_time(CLOCK_REALTIME); }


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

x86 assembly (clang, -O2):
<get_unix_time>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <get_time@plt>

LLVM IR (-O0):
@CLOCK_REALTIME = global i32 0
define double @get_unix_time() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = call double @get_time(i32 %1)
ret double %2
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
define double @get_unix_time() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = tail call double @get_time(i32 %1)
ret double %2
}
void _InitMsgQueue(void) {}


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

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

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

LLVM IR (-O2):
define void @_InitMsgQueue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_interwork();
int /*<<< orphan*/ t16_blx_lrimm();
void t16_blx_h1() {
  t16_blx_lrimm();
  arm_interwork();
}


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

x86 assembly (clang, -O2):
<t16_blx_h1>:
push   %rax
xor    %eax,%eax
call   1040 <t16_blx_lrimm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <arm_interwork@plt>

LLVM IR (-O0):
define void @t16_blx_h1() {
%1 = call i32 (...) @t16_blx_lrimm()
%2 = call i32 (...) @arm_interwork()
ret void
}

LLVM IR (-O2):
define void @t16_blx_h1() {
%1 = tail call i32 (...) @t16_blx_lrimm()
%2 = tail call i32 (...) @arm_interwork()
ret void
}
/* Variables and functions */
scalar_t__ is_prime(int);
int test_prime() { return is_prime(7) && is_prime(2137); }


x86 assembly (clang, -O0):
<test_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <is_prime@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1148 <test_prime+0x38>
mov    $0x859,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_prime>:
push   %rax
mov    $0x7,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
je     1137 <test_prime+0x27>
mov    $0x859,%edi
call   1030 <is_prime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_prime() {
%1 = call i64 @is_prime(i32 7)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @is_prime(i32 2137)
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_prime() {
%1 = tail call i64 @is_prime(i32 7)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @is_prime(i32 2137)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int dangerous();
int main(void) {
  int tmp;
  {
    tmp = dangerous();
    return (tmp);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dangerous()
ret i32 %1
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_intmap_keyvalue(int32_t key, int32_t value) {
  printf("[%i=%i]", key, value);
}


x86 assembly (clang, -O0):
<print_intmap_keyvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_intmap_keyvalue>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"[%i=%i]\00"
define void @print_intmap_keyvalue(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
void modulus(char *arg1, char *arg2) {
  int a, b;
  a = atoi(arg1);
  b = atoi(arg2);
  printf("%d\n", a % b);
}


x86 assembly (clang, -O0):
<modulus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulus>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
lea    0xebd(%rip),%rdi
mov    %edx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @modulus(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = srem i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xfd() {
  Assert_real((iscntrl(253) == 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_iscntrl.c",
              1270, ("iscntrl should be 0 for 0xfd"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f6,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xfd\00"
define void @t_iscntrl_0xfd() {
%1 = call i64 @iscntrl(i32 253)
%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 1270, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xfd\00"
define void @t_iscntrl_0xfd() {
%1 = tail call i64 @iscntrl(i32 253)
%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 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int arr[], int len) {
  for (int i = 0; i < len; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_arr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_arr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int _strlen_recursion(char *s) {
  if (*s == '\0') {
    return (0);
  }
  return (_strlen_recursion(s + 1) + 1);
}


x86 assembly (clang, -O0):
<_strlen_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <_strlen_recursion+0x28>
movl   $0x0,-0x4(%rbp)
jmp    114b <_strlen_recursion+0x3b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <_strlen_recursion@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen_recursion>:
cmpb   $0x0,(%rdi)
je     111c <_strlen_recursion+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen_recursion+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen_recursion(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_kaa_deque_destroy_stub(void *data) { assert(!(data == NULL)); }


x86 assembly (clang, -O0):
<test_kaa_deque_destroy_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_kaa_deque_destroy_stub>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_kaa_deque_destroy_stub(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_kaa_deque_destroy_stub(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void wait(int time) { usleep((unsigned int)time); }


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

x86 assembly (clang, -O2):
<wait>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ stdin;
int get_number(char *prompt) {
  char line[80];
  int n = 0, i;
  printf(prompt);
  while (n != 1) {
    n = scanf("%d", &i);
    fgets(line, 80, stdin);
  }
  return i;
}


x86 assembly (clang, -O0):
<get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x64(%rbp)
je     1185 <get_number+0x55>
lea    0xea3(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
jmp    114c <get_number+0x1c>
mov    -0x68(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x60,%rsp
call   1030 <printf@plt>
lea    0xeb8(%rip),%r14
lea    0xc(%rsp),%r15
mov    0x2e94(%rip),%r12
lea    0x10(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %eax,%ebp
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
cmp    $0x1,%ebp
jne    1160 <get_number+0x30>
mov    0xc(%rsp),%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @get_number(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* %6)
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 %12, i32* %4
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %13, i32 80, i32 %14)
br label %8
16: ; preds = %8
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @get_number(i8* nocapture %0) {
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @printf(i8* dereferenceable(1) %0)
br label %7
7: ; preds = %1, %7
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %4, i32 80, i32 %9)
%11 = icmp eq i32 %8, 1
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = load i32, i32* %3
ret i32 %13
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int strncmpz(const char *l, const char *r, size_t llen) {
  int i = strncmp(l, r, llen);
  if (i == 0)
    return -r[llen];
  else
    return i;
}


x86 assembly (clang, -O0):
<strncmpz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    115a <strncmpz+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <strncmpz+0x50>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmpz>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    112a <strncmpz+0x1a>
movsbl (%rbx,%r14,1),%eax
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strncmpz(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @strncmp(i8* %9, i8* %10, i64 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 0, %20
store i32 %21, i32* %4
br label %24
22: ; preds = %3
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %15
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @strncmpz(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %1, i64 %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sub nsw i32 0, %9
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ %10, %6 ], [ %4, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ displayCheckerBoard();
int /*<<< orphan*/ initCheckerBoard();
int main(int argc, const char *argv[]) {
  initCheckerBoard();
  displayCheckerBoard();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <initCheckerBoard@plt>
mov    $0x0,%al
call   1030 <displayCheckerBoard@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initCheckerBoard@plt>
xor    %eax,%eax
call   1030 <displayCheckerBoard@plt>
xor    %eax,%eax
pop    %rcx
ret

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 = call i32 (...) @initCheckerBoard()
%7 = call i32 (...) @displayCheckerBoard()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initCheckerBoard()
%4 = tail call i32 (...) @displayCheckerBoard()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glTexGendv_size(int /*<<< orphan*/);
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glTexGenfv_size(GLenum e) {
  return __glTexGendv_size(e);
}


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

x86 assembly (clang, -O2):
<__glTexGenfv_size>:
jmp    1030 <__glTexGendv_size@plt>

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

LLVM IR (-O2):
define hidden i32 @__glTexGenfv_size(i32 %0) {
%2 = tail call i32 @__glTexGendv_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ restrict_popen();
int /*<<< orphan*/ system(char const *);
void do_system(const char *cmd) {
  if (!cmd)
    return;
  restrict_popen();
  system(cmd);
}


x86 assembly (clang, -O0):
<do_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <do_system+0x1c>
jmp    114c <do_system+0x2c>
mov    $0x0,%al
call   1040 <restrict_popen@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_system>:
test   %rdi,%rdi
je     1139 <do_system+0x19>
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <restrict_popen@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <system@plt>
ret

LLVM IR (-O0):
define void @do_system(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 %6, label %5
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = call i32 (...) @restrict_popen()
%8 = load i8*, i8** %2
%9 = call i32 @system(i8* %8)
br label %10
10: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @do_system(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @restrict_popen()
%5 = tail call i32 @system(i8* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_alloc_huffman(void *ptr) {
  if (!ptr) {
    fprintf(stderr, "alloc error: OUT OF MEMORY\n");
  }
}


x86 assembly (clang, -O0):
<check_alloc_huffman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <check_alloc_huffman+0x2c>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_alloc_huffman>:
test   %rdi,%rdi
je     1116 <check_alloc_huffman+0x6>
ret
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"alloc error: OUT OF MEMORY\0A\00"
define void @check_alloc_huffman(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 %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"alloc error: OUT OF MEMORY\0A\00"
define void @check_alloc_huffman(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ai_reg(uint32_t address) { return (address & 0xffff) >> 2; }


x86 assembly (clang, -O0):
<ai_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_reg>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3fff,%eax
ret

LLVM IR (-O0):
define i32 @ai_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @ai_reg(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 16383
ret i32 %3
}
/* Variables and functions */
size_t min(size_t a, size_t b) {
  if (a < b) {
    return a;
  }
  return b;
}


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

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

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
letter(c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_'))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     111b <letter+0x1b>
cmpl   $0x7a,-0x8(%rbp)
jle    1139 <letter+0x39>
cmpl   $0x41,-0x8(%rbp)
jl     112f <letter+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1139 <letter+0x39>
cmpl   $0x5f,-0x8(%rbp)
jne    1145 <letter+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <letter+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
lea    -0x61(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%ecx
jb     1121 <letter+0x21>
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
setb   %al
cmp    $0x5f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @letter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %18, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 90
br i1 %14, label %18, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 95
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %6
store i32 1, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 26
%7 = icmp eq i32 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LEQUAL;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void myinit(void) {
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glDepthFunc(GL_LEQUAL);
  glEnable(GL_DEPTH_TEST);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_LEQUAL = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @myinit() {
%1 = load i32, i32* @GL_LIGHTING
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_LEQUAL
%6 = call i32 @glDepthFunc(i32 %5)
%7 = load i32, i32* @GL_DEPTH_TEST
%8 = call i32 @glEnable(i32 %7)
ret void
}

LLVM IR (-O2):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_LEQUAL = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @myinit() {
%1 = load i32, i32* @GL_LIGHTING
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = tail call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_LEQUAL
%6 = tail call i32 @glDepthFunc(i32 %5)
%7 = load i32, i32* @GL_DEPTH_TEST
%8 = tail call i32 @glEnable(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
void wclrscr(WINDOW *pwin) {
  int y, x, maxy, maxx;
  getmaxyx(pwin, maxy, maxx);
  for (y = 0; y < maxy; y++) {
    for (x = 0; x < maxx; x++)
      mvwaddch(pwin, y, x, ' ');
  }
}


x86 assembly (clang, -O0):
<wclrscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <getmaxyx@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1196 <wclrscr+0x76>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1183 <wclrscr+0x63>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x20,%ecx
call   1040 <mvwaddch@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <wclrscr+0x35>
jmp    1188 <wclrscr+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <wclrscr+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wclrscr>:
jmp    1030 <getmaxyx@plt>

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

LLVM IR (-O2):
define void @wclrscr(i32* %0) {
%2 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
ret void
}
float clampf(float x, float a, float b) {
  return ((((((x) > (a)) ? (x) : (a))) < (b)) ? ((((x) > (a)) ? (x) : (a)))
                                              : (b));
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1131 <clampf+0x31>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113b <clampf+0x3b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1185 <clampf+0x85>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116c <clampf+0x6c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1176 <clampf+0x76>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    118f <clampf+0x8f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
maxss  %xmm1,%xmm0
minss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %4
br label %14
12: ; preds = %3
%13 = load float, float* %5
br label %14
14: ; preds = %12, %10
%15 = phi float [ %11, %10 ], [ %13, %12 ]
%16 = load float, float* %6
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load float, float* %4
%20 = load float, float* %5
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load float, float* %4
br label %26
24: ; preds = %18
%25 = load float, float* %5
br label %26
26: ; preds = %24, %22
%27 = phi float [ %23, %22 ], [ %25, %24 ]
br label %30
28: ; preds = %14
%29 = load float, float* %6
br label %30
30: ; preds = %28, %26
%31 = phi float [ %27, %26 ], [ %29, %28 ]
ret float %31
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = select i1 %4, float %0, float %1
%6 = fcmp olt float %5, %2
%7 = select i1 %6, float %5, float %2
ret float %7
}
int test_imm_22uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x22,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22uint64_highword_reg>:
movabs $0x2200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_22uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 34
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_22uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 146028888064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int b_cyg_cymg_yeg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(78, entrycymg, 1, entrycyg, -52, entryyeg);
}


x86 assembly (clang, -O0):
<b_cyg_cymg_yeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%r9d
mov    $0x4e,%edi
mov    $0x1,%edx
mov    $0xffffffcc,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_cyg_cymg_yeg>:
mov    %edx,%r9d
mov    %edi,%ecx
mov    $0x4e,%edi
mov    $0x1,%edx
mov    $0xffffffcc,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @b_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = call i32 @color_eqn(i32 78, i32 %9, i32 1, i32 %10, i32 -52, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @b_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 78, i32 %1, i32 1, i32 %0, i32 -52, i32 %2)
ret i32 %5
}
/* Variables and functions */
double rand_gamma(int, int);
double rand_beta(double alpha, double beta) {
  double X = rand_gamma((int)alpha, 1);
  double Y = rand_gamma((int)beta, 1);
  return X / (X + Y);
}


x86 assembly (clang, -O0):
<rand_beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <rand_gamma@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x10(%rbp),%edi
mov    $0x1,%esi
call   1030 <rand_gamma@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_beta>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
cvttsd2si %xmm0,%edi
mov    $0x1,%esi
call   1030 <rand_gamma@plt>
movsd  %xmm0,0x8(%rsp)
cvttsd2si 0x10(%rsp),%edi
mov    $0x1,%esi
call   1030 <rand_gamma@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_beta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = fptosi double %7 to i32
%9 = call double @rand_gamma(i32 %8, i32 1)
store double %9, double* %5
%10 = load double, double* %4
%11 = fptosi double %10 to i32
%12 = call double @rand_gamma(i32 %11, i32 1)
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fadd double %14, %15
%17 = fdiv double %13, %16
ret double %17
}

LLVM IR (-O2):
define double @rand_beta(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = tail call double @rand_gamma(i32 %3, i32 1)
%5 = fptosi double %1 to i32
%6 = tail call double @rand_gamma(i32 %5, i32 1)
%7 = fadd double %4, %6
%8 = fdiv double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove_dups(char *);
int /*<<< orphan*/ stdin;
int main() {
  char str[256];
  printf("Enter string: ");
  fgets(str, 256, stdin);
  remove_dups(str);
  printf("Resultant string: %s\n", str);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1050 <remove_dups@plt>
lea    -0x110(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <remove_dups@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter string: \00"
@stdin = global i32 0
@.str.1 = [22 x i8] c"Resultant string: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 256, i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 @remove_dups(i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter string: \00"
@stdin = global i32 0
@.str.1 = [22 x i8] c"Resultant string: %s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 256, i32 %4)
%6 = call i32 @remove_dups(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void rop3_241_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_241_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
or     %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
or     %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_241_0_0>:
or     (%rdi),%sil
not    %sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_241_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 = or 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 = or 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_241_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
store i8 %7, i8* %0
ret void
}