xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j, k;
  while (i < 30) {
    if (i == j) {
      printf("3\n");
    } else {
      if (j == k) {
        printf("4\n");
      } else if (i == k) {
        printf("5\n");
      }
    }
    printf("6\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    1196 <main+0x86>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <main+0x36>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <main+0x75>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1163 <main+0x53>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    117b <main+0x6b>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
jmp    1185 <main+0x75>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"3\0A\00"
@.str.1 = [3 x i8] c"4\0A\00"
@.str.2 = [3 x i8] c"5\0A\00"
@.str.3 = [3 x i8] c"6\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %28, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 30
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %28
14: ; preds = %8
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %27
20: ; preds = %14
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
br label %27
27: ; preds = %26, %18
br label %28
28: ; preds = %27, %12
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %5
30: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int determinerNbTourAttendreFocusEnnemi(unsigned int const);
void defocusJoueurIAEnnemi(unsigned int *modeFocus, int *nbTourFocus,
                           int *nbTourAttendreFocus,
                           const unsigned int niveauIA) {
  *modeFocus = 0;
  *nbTourFocus = -1;
  *nbTourAttendreFocus = determinerNbTourAttendreFocusEnnemi(niveauIA);
}


x86 assembly (clang, -O0):
<defocusJoueurIAEnnemi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x1c(%rbp),%edi
call   1030 <determinerNbTourAttendreFocusEnnemi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defocusJoueurIAEnnemi>:
push   %rbx
mov    %rdx,%rbx
movl   $0x0,(%rdi)
movl   $0xffffffff,(%rsi)
mov    %ecx,%edi
call   1030 <determinerNbTourAttendreFocusEnnemi@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @defocusJoueurIAEnnemi(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** %5
store i32 0, i32* %9
%10 = load i32*, i32** %6
store i32 -1, i32* %10
%11 = load i32, i32* %8
%12 = call i32 @determinerNbTourAttendreFocusEnnemi(i32 %11)
%13 = load i32*, i32** %7
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @defocusJoueurIAEnnemi(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3) {
store i32 0, i32* %0
store i32 -1, i32* %1
%5 = tail call i32 @determinerNbTourAttendreFocusEnnemi(i32 %3)
store i32 %5, i32* %2
ret void
}
int test_byteXor(int x, int y, int n) {
  union {
    int xs;
    char b[4];
  } exp1, exp2;
  exp1.xs = x;
  exp2.xs = y;
  return (exp1.b[n] - exp2.b[n]) != 0;
}


x86 assembly (clang, -O0):
<test_byteXor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x18(%rbp,%rcx,1),%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_byteXor>:
mov    %edi,-0x8(%rsp)
mov    %esi,-0x10(%rsp)
movslq %edx,%rcx
mov    -0x8(%rsp,%rcx,1),%dl
xor    %eax,%eax
cmp    -0x10(%rsp,%rcx,1),%dl
setne  %al
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @test_byteXor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.anon
%8 = alloca %union.anon
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = bitcast %union.anon* %7 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = bitcast %union.anon* %8 to i32*
store i32 %11, i32* %12
%13 = bitcast %union.anon* %7 to [4 x i8]*
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = bitcast %union.anon* %8 to [4 x i8]*
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %18, %24
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
%union.anon = type { i32 }
define i32 @test_byteXor(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.anon
%5 = alloca %union.anon
%6 = bitcast %union.anon* %4 to i8*
%7 = bitcast %union.anon* %5 to i8*
%8 = getelementptr inbounds %union.anon, %union.anon* %4, i64 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds %union.anon, %union.anon* %5, i64 0, i32 0
store i32 %1, i32* %9
%10 = bitcast %union.anon* %4 to [4 x i8]*
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = bitcast %union.anon* %5 to [4 x i8]*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 %11
%16 = load i8, i8* %15
%17 = icmp ne i8 %13, %16
%18 = zext i1 %17 to i32
ret i32 %18
}
/* Variables and functions */
scalar_t__ tolower(char);
int hashfunction(char aword[12]) { return ((int)tolower(aword[0])) - 97; }


x86 assembly (clang, -O0):
<hashfunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
sub    $0x61,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunction>:
push   %rax
movsbl (%rdi),%edi
call   1030 <tolower@plt>
add    $0xffffff9f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hashfunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i64 @tolower(i8 signext %5)
%7 = trunc i64 %6 to i32
%8 = sub nsw i32 %7, 97
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashfunction(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @tolower(i8 signext %2)
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, -97
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_dobldobl_dimension(int *dim) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(730, dim, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_dobldobl_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2da,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_dobldobl_dimension>:
mov    %rdi,%rsi
mov    $0x2da,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @numbtrop_dobldobl_dimension(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 730, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_dobldobl_dimension(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 730, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ b(int, float **);
void a(void) {
  float *p = 0;
  int i = 0;
  b(10, (float(*)[10])(p + i));
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    $0xa,%edi
call   1030 <b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    $0xa,%edi
xor    %esi,%esi
jmp    1030 <b@plt>

LLVM IR (-O0):
define void @a() {
%1 = alloca float*
%2 = alloca i32
store float* null, float** %1
store i32 0, i32* %2
%3 = load float*, float** %1
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds float, float* %3, i64 %5
%7 = bitcast float* %6 to [10 x float]*
%8 = bitcast [10 x float]* %7 to float**
%9 = call i32 @b(i32 10, float** %8)
ret void
}

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 @b(i32 10, float** null)
ret void
}
void g_type_register_dynamic() {}


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

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

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

LLVM IR (-O2):
define void @g_type_register_dynamic() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, unsigned long long *);
long long unsigned getValue(FILE *in) {
  long long unsigned buffer;
  fscanf(in, "%llu", &buffer);
  return buffer;
}


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

x86 assembly (clang, -O2):
<getValue>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fscanf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i64 @getValue(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i64 @getValue(i32* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
ret i64 %5
}
void return_square(int ls, int result[]) {
  switch (ls) {
  case 0:
    break;
  case 1:
    break;
  }
}


x86 assembly (clang, -O0):
<return_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     112f <return_square+0x2f>
jmp    111e <return_square+0x1e>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1134 <return_square+0x34>
jmp    1139 <return_square+0x39>
jmp    1139 <return_square+0x39>
jmp    1139 <return_square+0x39>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @return_square(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
switch i32 %5, label %8 [
i32 0, label %6
i32 1, label %7
]
6: ; preds = %2
br label %8
7: ; preds = %2
br label %8
8: ; preds = %2, %7, %6
ret void
}

LLVM IR (-O2):
define void @return_square(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_store_base_shadow_stack(int /*<<< orphan*/ *,
                                                           int /*<<< orphan*/);
int /*<<< orphan*/
__softboundcets_store_bound_shadow_stack(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ __softboundcets_store_key_shadow_stack(int /*<<< orphan*/,
                                                          int /*<<< orphan*/);
int /*<<< orphan*/ __softboundcets_store_lock_shadow_stack(int /*<<< orphan*/ *,
                                                           int /*<<< orphan*/);
__attribute__((__weak__, __always___)) void
__softboundcets_store_null_return_metadata() {
  __softboundcets_store_base_shadow_stack(NULL, 0);
  __softboundcets_store_bound_shadow_stack(NULL, 0);
  __softboundcets_store_key_shadow_stack(0, 0);
  __softboundcets_store_lock_shadow_stack(NULL, 0);
}


x86 assembly (clang, -O0):
<__softboundcets_store_null_return_metadata>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <__softboundcets_store_base_shadow_stack@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <__softboundcets_store_bound_shadow_stack@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <__softboundcets_store_key_shadow_stack@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <__softboundcets_store_lock_shadow_stack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundcets_store_null_return_metadata>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1050 <__softboundcets_store_base_shadow_stack@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <__softboundcets_store_bound_shadow_stack@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <__softboundcets_store_key_shadow_stack@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1060 <__softboundcets_store_lock_shadow_stack@plt>

LLVM IR (-O0):
define weak void @__softboundcets_store_null_return_metadata() {
%1 = call i32 @__softboundcets_store_base_shadow_stack(i32* null, i32 0)
%2 = call i32 @__softboundcets_store_bound_shadow_stack(i32* null, i32 0)
%3 = call i32 @__softboundcets_store_key_shadow_stack(i32 0, i32 0)
%4 = call i32 @__softboundcets_store_lock_shadow_stack(i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define weak void @__softboundcets_store_null_return_metadata() {
%1 = tail call i32 @__softboundcets_store_base_shadow_stack(i32* null, i32 0)
%2 = tail call i32 @__softboundcets_store_bound_shadow_stack(i32* null, i32 0)
%3 = tail call i32 @__softboundcets_store_key_shadow_stack(i32 0, i32 0)
%4 = tail call i32 @__softboundcets_store_lock_shadow_stack(i32* null, i32 0)
ret void
}
/* Variables and functions */
size_t b64_get_b64_wc(size_t ascii_wc) {
  size_t ascii_pwc = ascii_wc;
  if (ascii_wc % 3)
    ascii_pwc += (3 - (ascii_wc % 3));
  return ascii_pwc * 4 / 3;
}


x86 assembly (clang, -O0):
<b64_get_b64_wc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     1146 <b64_get_b64_wc+0x46>
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3,%eax
sub    %rdx,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_get_b64_wc>:
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %rdi,%rax
mul    %rcx
shr    %rdx
lea    (%rdx,%rdx,2),%rax
mov    %rdi,%rdx
sub    %rax,%rdx
mov    %rdx,%rax
xor    $0x3,%rax
test   %rdx,%rdx
cmove  %rdx,%rax
add    %rdi,%rax
shl    $0x2,%rax
mul    %rcx
mov    %rdx,%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @b64_get_b64_wc(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %2
%6 = urem i64 %5, 3
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i64, i64* %2
%10 = urem i64 %9, 3
%11 = sub i64 3, %10
%12 = load i64, i64* %3
%13 = add i64 %12, %11
store i64 %13, i64* %3
br label %14
14: ; preds = %8, %1
%15 = load i64, i64* %3
%16 = mul i64 %15, 4
%17 = udiv i64 %16, 3
ret i64 %17
}

LLVM IR (-O2):
define i64 @b64_get_b64_wc(i64 %0) {
%2 = urem i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = xor i64 %2, 3
%5 = select i1 %3, i64 0, i64 %4
%6 = add i64 %5, %0
%7 = shl i64 %6, 2
%8 = udiv i64 %7, 3
ret i64 %8
}
void gtk_menu_reposition() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_reposition() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generatePartKeys();
void generateKey_end() { generatePartKeys(); }


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

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

LLVM IR (-O0):
define void @generateKey_end() {
%1 = call i32 (...) @generatePartKeys()
ret void
}

LLVM IR (-O2):
define void @generateKey_end() {
%1 = tail call i32 (...) @generatePartKeys()
ret void
}
int bit(char *addr, unsigned int nr) {
  return (addr[nr >> 3] & (1 << (nr & 7))) != 0;
}


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles away.\n", distance);
  printf("Number of arguments = %d.\n", argc);
  return distance;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x64,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"You are %d miles away.\0A\00"
@.str.1 = [27 x i8] c"Number of arguments = %d.\0A\00"
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 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"You are %d miles away.\0A\00"
@.str.1 = [27 x i8] c"Number of arguments = %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret i32 100
}
int test_func(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_func() {
ret i32 1
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
ssize_t preadv(int fd, const struct iovec *v, int veccount, off_t offset) {
  return -1;
}


x86 assembly (clang, -O0):
<preadv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @preadv(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @preadv(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
int streamID(a, b, r, e) { return 1; }


x86 assembly (clang, -O0):
<streamID>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @streamID(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
ret i32 1
}

LLVM IR (-O2):
define i32 @streamID(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 1
}
/* Variables and functions */
double mus_mu_fix(double, double);
double mus_(double s __attribute__((unused)), double alpha) {
  return mus_mu_fix(s, alpha);
}


x86 assembly (clang, -O0):
<mus_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <mus_mu_fix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_>:
jmp    1030 <mus_mu_fix@plt>

LLVM IR (-O0):
define double @mus_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @mus_mu_fix(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @mus_(double %0, double %1) {
%3 = tail call double @mus_mu_fix(double %0, double %1)
ret double %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XFocusOutEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XFocusOutEvent_display(void *_p, void *_v) {
  ((XFocusOutEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XFocusOutEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XFocusOutEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XFocusOutEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void i2d_AUTHORITY_KEYID(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_AUTHORITY_KEYID() {
ret void
}
void to_uns_int_store_n(__float128 a, unsigned int *p, long n) {
  p[n] = (unsigned int)a;
}


x86 assembly (clang, -O0):
<to_uns_int_store_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixunstfsi>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_uns_int_store_n>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1120 <__fixunstfsi>
mov    %eax,(%rbx,%r14,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @to_uns_int_store_n(fp128 %0, i32* %1, i64 %2) {
%4 = alloca fp128
%5 = alloca i32*
%6 = alloca i64
store fp128 %0, fp128* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load fp128, fp128* %4
%8 = fptoui fp128 %7 to i32
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = getelementptr inbounds i32, i32* %9, i64 %10
store i32 %8, i32* %11
ret void
}

LLVM IR (-O2):
define void @to_uns_int_store_n(fp128 %0, i32* nocapture writeonly %1, i64 %2) {
%4 = fptoui fp128 %0 to i32
%5 = getelementptr inbounds i32, i32* %1, i64 %2
store i32 %4, i32* %5
ret void
}
unsigned char __atomic_fetch_sub_1(volatile void *atom, unsigned char value,
                                   int memorder) {
  unsigned char xchg;
  unsigned char cmp;
  __atomic_load((unsigned char *)atom, (unsigned char *)&cmp, 0);
  do {
    xchg = ((cmp - value));
  } while (
      !__atomic_compare_exchange((unsigned char *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_sub_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
movzbl -0x9(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x12(%rbp),%al
mov    -0x11(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0x15(%rbp)
mov    %cl,-0x14(%rbp)
test   $0x1,%al
jne    114e <__atomic_fetch_sub_1+0x4e>
mov    -0x14(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_fetch_sub_1+0x1a>
movzbl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_sub_1>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
sub    %sil,%dl
lock cmpxchg %dl,(%rdi)
jne    1110 <__atomic_fetch_sub_1+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__atomic_fetch_sub_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load atomic i8, i8* %10 monotonic
store i8 %11, i8* %8
br label %12
12: ; preds = %27, %3
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = sub nsw i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
br label %19
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = load i8, i8* %8
%22 = load i8, i8* %7
%23 = cmpxchg weak i8* %20, i8 %21, i8 %22 seq_cst seq_cst
%24 = extractvalue { i8, i1 } %23, 0
%25 = extractvalue { i8, i1 } %23, 1
br i1 %25, label %27, label %26
26: ; preds = %19
store i8 %24, i8* %8
br label %27
27: ; preds = %26, %19
%28 = zext i1 %25 to i8
store i8 %28, i8* %9
%29 = load i8, i8* %9
%30 = trunc i8 %29 to i1
%31 = xor i1 %30, true
br i1 %31, label %12, label %32
32: ; preds = %27
%33 = load i8, i8* %8
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @__atomic_fetch_sub_1(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = load atomic i8, i8* %0 monotonic
br label %5
5: ; preds = %5, %3
%6 = phi i8 [ %4, %3 ], [ %10, %5 ]
%7 = sub i8 %6, %1
%8 = cmpxchg weak i8* %0, i8 %6, i8 %7 seq_cst seq_cst
%9 = extractvalue { i8, i1 } %8, 1
%10 = extractvalue { i8, i1 } %8, 0
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, size_t);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(int *, int *, size_t);
int *quick_sort(int *arr, size_t len) {
  int *result = (int *)malloc(len * sizeof(int));
  memcpy(result, arr, len * sizeof(int));
  _quick_sort(result, len);
  return result;
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_quick_sort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x0(,%rsi,4),%r12
mov    %r12,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <_quick_sort@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @quick_sort(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 %6, 4
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32*, i32** %3
%12 = load i64, i64* %4
%13 = mul i64 %12, 4
%14 = call i32 @memcpy(i32* %10, i32* %11, i64 %13)
%15 = load i32*, i32** %5
%16 = load i64, i64* %4
%17 = call i32 @_quick_sort(i32* %15, i64 %16)
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
define i32* @quick_sort(i32* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @memcpy(i32* %5, i32* %0, i64 %3)
%7 = tail call i32 @_quick_sort(i32* %5, i64 %1)
ret i32* %5
}
void INT_Excep_MTU6_TGIC6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU6_TGIC6() {
ret void
}
/* Variables and functions */
int getName(char *);
int getUID(char *destination) { return getName(destination); }


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

x86 assembly (clang, -O2):
<getUID>:
jmp    1030 <getName@plt>

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

LLVM IR (-O2):
define i32 @getUID(i8* %0) {
%2 = tail call i32 @getName(i8* %0)
ret i32 %2
}
/* Type definitions */
struct ir_remote {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_rc5(struct ir_remote *);
scalar_t__ is_rc6(struct ir_remote *);
int is_biphase(struct ir_remote *remote) {
  if (is_rc5(remote) || is_rc6(remote))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_biphase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_rc5@plt>
cmp    $0x0,%rax
jne    1152 <is_biphase+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <is_rc6@plt>
cmp    $0x0,%rax
je     115e <is_biphase+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_biphase+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_biphase>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_rc5@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <is_biphase+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_rc6@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
define i32 @is_biphase(%struct.ir_remote* %0) {
%2 = alloca i32
%3 = alloca %struct.ir_remote*
store %struct.ir_remote* %0, %struct.ir_remote** %3
%4 = load %struct.ir_remote*, %struct.ir_remote** %3
%5 = call i64 @is_rc5(%struct.ir_remote* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load %struct.ir_remote*, %struct.ir_remote** %3
%9 = call i64 @is_rc6(%struct.ir_remote* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
define i32 @is_biphase(%struct.ir_remote* %0) {
%2 = tail call i64 @is_rc5(%struct.ir_remote* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_rc6(%struct.ir_remote* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int io373b_write_regs(struct device *, unsigned short, unsigned char *, int);
int io373b_write_reg(struct device *io373b_dev, unsigned short reg,
                     unsigned char _1byte) {
  return io373b_write_regs(io373b_dev, reg, &_1byte, 1);
}


x86 assembly (clang, -O0):
<io373b_write_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rdx
mov    $0x1,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <io373b_write_regs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io373b_write_reg>:
push   %rax
mov    %dl,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <io373b_write_regs@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @io373b_write_reg(%struct.device* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca %struct.device*
%5 = alloca i16
%6 = alloca i8
store %struct.device* %0, %struct.device** %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load %struct.device*, %struct.device** %4
%8 = load i16, i16* %5
%9 = call i32 @io373b_write_regs(%struct.device* %7, i16 zeroext %8, i8* %6, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @io373b_write_reg(%struct.device* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
store i8 %2, i8* %4
%5 = call i32 @io373b_write_regs(%struct.device* %0, i16 zeroext %1, i8* %4, i32 1)
ret i32 %5
}
reg0adr1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     1134 <reg0adr1+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <reg0adr1+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adr1>:
xor    %eax,%eax
cmp    %edi,0xa98ac7
setae  %al
ret

LLVM IR (-O0):
define i32 @reg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %8
%15 = load i32, i32* inttoptr (i64 11111111 to i32*)
%16 = icmp ule i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @reg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
%8 = icmp uge i32 %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
long sysconf(int /*<<< orphan*/);
long get_clk_tck_per_sec(void) { return sysconf(_SC_CLK_TCK); }


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

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

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i64 @get_clk_tck_per_sec() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i64 @get_clk_tck_per_sec() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *get_passwd();
int /*<<< orphan*/ printf(char *, char *);
main() {
  char *pw_crypt;
  pw_crypt = get_passwd();
  printf("%s\n", pw_crypt);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_passwd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_passwd@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @get_passwd()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @get_passwd()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ShowUsage(void) {
  printf("Usage: %s <BIN file> <TXT file> [-d]\n\n", "CB2cheats");
  printf("Extracts all CB2 cheat codes from a RAM dump to a text file.\n");
  printf("Additionally, use the -d switch to decrypt the codes.\n");
}


x86 assembly (clang, -O0):
<ShowUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf05(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowUsage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s <BIN file> <TXT file> [-d]\0A\0A\00"
@.str.1 = [10 x i8] c"CB2cheats\00"
@.str.2 = [62 x i8] c"Extracts all CB2 cheat codes from a RAM dump to a text file.\0A\00"
@.str.3 = [55 x i8] c"Additionally, use the -d switch to decrypt the codes.\0A\00"
define void @ShowUsage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s <BIN file> <TXT file> [-d]\0A\0A\00"
@.str.1 = [10 x i8] c"CB2cheats\00"
@str = [61 x i8] c"Extracts all CB2 cheat codes from a RAM dump to a text file.\00"
@str.4 = [54 x i8] c"Additionally, use the -d switch to decrypt the codes.\00"
define void @ShowUsage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
ret void
}
int metal_sleep_usec(unsigned int usec) {
  (void)usec;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @metal_sleep_usec(i32 %0) {
ret i32 0
}
/* Variables and functions */
int write_verify_test_files(int /*<<< orphan*/, int *);
int write_test_files(int *total_sim_minutes) {
  return write_verify_test_files(0, total_sim_minutes);
}


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

x86 assembly (clang, -O2):
<write_test_files>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <write_verify_test_files@plt>

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

LLVM IR (-O2):
define i32 @write_test_files(i32* %0) {
%2 = tail call i32 @write_verify_test_files(i32 0, i32* %0)
ret i32 %2
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (!(r < 0)) {
    rand();
    y = rand();
    x = 42;
  } else {
    y = rand();
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1157 <main+0x47>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1168 <main+0x58>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   %ebx,%ebx
js     1133 <main+0x23>
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 0
%5 = tail call i32 (...) @rand()
br i1 %4, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 42, %6 ], [ 7, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int pcloseRWE(int pid, int *rwepipe) {
  int status;
  close(rwepipe[0]);
  close(rwepipe[1]);
  close(rwepipe[2]);
  waitpid(pid, &status, 0);
  return status;
}


x86 assembly (clang, -O0):
<pcloseRWE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcloseRWE>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
call   1030 <close@plt>
mov    0x8(%rbx),%edi
call   1030 <close@plt>
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pcloseRWE(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = call i32 @close(i32 %8)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = call i32 @close(i32 %12)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = call i32 @close(i32 %16)
%18 = load i32, i32* %3
%19 = call i32 @waitpid(i32 %18, i32* %5, i32 0)
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @pcloseRWE(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %1
%6 = tail call i32 @close(i32 %5)
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @close(i32 %8)
%10 = getelementptr inbounds i32, i32* %1, i64 2
%11 = load i32, i32* %10
%12 = tail call i32 @close(i32 %11)
%13 = call i32 @waitpid(i32 %0, i32* %3, i32 0)
%14 = load i32, i32* %3
ret i32 %14
}
void InitZip(void) {}


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

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

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

LLVM IR (-O2):
define void @InitZip() {
ret void
}