xunge/DecIR huggingface dataset:
/* Type definitions */
struct t_twc_list_item {
  int dummy;
};
struct t_twc_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ twc_list_add(struct t_twc_list *, struct t_twc_list_item *);
struct t_twc_list_item *twc_list_item_new();
struct t_twc_list_item *twc_list_item_new_add(struct t_twc_list *list) {
  struct t_twc_list_item *item = twc_list_item_new();
  twc_list_add(list, item);
  return item;
}


x86 assembly (clang, -O0):
<twc_list_item_new_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <twc_list_item_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <twc_list_add@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twc_list_item_new_add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <twc_list_item_new@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <twc_list_add@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.t_twc_list_item = type { i32 }
%struct.t_twc_list = type { i32 }
define %struct.t_twc_list_item* @twc_list_item_new_add(%struct.t_twc_list* %0) {
%2 = alloca %struct.t_twc_list*
%3 = alloca %struct.t_twc_list_item*
store %struct.t_twc_list* %0, %struct.t_twc_list** %2
%4 = call %struct.t_twc_list_item* (...) @twc_list_item_new()
store %struct.t_twc_list_item* %4, %struct.t_twc_list_item** %3
%5 = load %struct.t_twc_list*, %struct.t_twc_list** %2
%6 = load %struct.t_twc_list_item*, %struct.t_twc_list_item** %3
%7 = call i32 @twc_list_add(%struct.t_twc_list* %5, %struct.t_twc_list_item* %6)
%8 = load %struct.t_twc_list_item*, %struct.t_twc_list_item** %3
ret %struct.t_twc_list_item* %8
}

LLVM IR (-O2):
%struct.t_twc_list_item = type { i32 }
%struct.t_twc_list = type { i32 }
define %struct.t_twc_list_item* @twc_list_item_new_add(%struct.t_twc_list* %0) {
%2 = tail call %struct.t_twc_list_item* (...) @twc_list_item_new()
%3 = tail call i32 @twc_list_add(%struct.t_twc_list* %0, %struct.t_twc_list_item* %2)
ret %struct.t_twc_list_item* %2
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write_int(int, int);
int /*<<< orphan*/ writen(int, char const *, int);
int write_string(int fd, const char buffer[]) {
  int size;
  size = strlen(buffer) + 1;
  write_int(fd, size);
  writen(fd, buffer, size);
  return size;
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <write_int@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <writen@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
add    $0x1,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <write_int@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <writen@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @write_string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = call i32 @write_int(i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i32 @writen(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @write_string(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @write_int(i32 %0, i32 %4)
%6 = tail call i32 @writen(i32 %0, i8* %1, i32 %4)
ret i32 %4
}
void ShowResponseTime(void) {}


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

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

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

LLVM IR (-O2):
define void @ShowResponseTime() {
ret void
}
int test_imm_69uint16_mem(unsigned short *val) {
  return ((*val) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69uint16_mem>:
testb  $0x69,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 105
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int qsort_cmp_VEC_VAL2(const void *x, const void *y) {
  if (*((double *)x) < *((double *)y))
    return (-1);
  else
    return (*((double *)x) > *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_VEC_VAL2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <qsort_cmp_VEC_VAL2+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp_VEC_VAL2+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_VEC_VAL2>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp_VEC_VAL2(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp ogt double %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp_VEC_VAL2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_open_pawns(int, int);
void w_open_pawns_test(void **state) {
  assert_int_equal(0x0000000008000000ul,
                   w_open_pawns(0x0000000018000000ul, 0x0000001000000000ul));
}


x86 assembly (clang, -O0):
<w_open_pawns_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x18000000,%edi
xor    %esi,%esi
call   1030 <w_open_pawns@plt>
mov    %eax,%esi
mov    $0x8000000,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_open_pawns_test>:
push   %rax
mov    $0x18000000,%edi
xor    %esi,%esi
call   1030 <w_open_pawns@plt>
mov    $0x8000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_open_pawns_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_open_pawns(i32 402653184, i32 0)
%4 = call i32 @assert_int_equal(i32 134217728, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_open_pawns_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_open_pawns(i32 402653184, i32 0)
%3 = tail call i32 @assert_int_equal(i32 134217728, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_hook_tests();
int /*<<< orphan*/ completion_tests();
int /*<<< orphan*/ groups_unite_tests();
void all_tests(void) {
  completion_tests();
  groups_unite_tests();
  add_hook_tests();
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <completion_tests@plt>
mov    $0x0,%al
call   1050 <groups_unite_tests@plt>
mov    $0x0,%al
call   1030 <add_hook_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1040 <completion_tests@plt>
xor    %eax,%eax
call   1050 <groups_unite_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <add_hook_tests@plt>

LLVM IR (-O0):
define void @all_tests() {
%1 = call i32 (...) @completion_tests()
%2 = call i32 (...) @groups_unite_tests()
%3 = call i32 (...) @add_hook_tests()
ret void
}

LLVM IR (-O2):
define void @all_tests() {
%1 = tail call i32 (...) @completion_tests()
%2 = tail call i32 (...) @groups_unite_tests()
%3 = tail call i32 (...) @add_hook_tests()
ret void
}
/* Variables and functions */
int TH_CreateEdge(int, int);
int TH_FindEdge(int, int);
int TH_FindOrCreateEdge(int v1, int v2) {
  int edgenum;
  edgenum = TH_FindEdge(v1, v2);
  if (!edgenum)
    edgenum = TH_CreateEdge(v1, v2);
  return edgenum;
}


x86 assembly (clang, -O0):
<TH_FindOrCreateEdge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <TH_FindEdge@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1154 <TH_FindOrCreateEdge+0x34>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <TH_CreateEdge@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TH_FindOrCreateEdge>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <TH_FindEdge@plt>
test   %eax,%eax
je     1137 <TH_FindOrCreateEdge+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <TH_CreateEdge@plt>

LLVM IR (-O0):
define i32 @TH_FindOrCreateEdge(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* %3
%7 = load i32, i32* %4
%8 = call i32 @TH_FindEdge(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @TH_CreateEdge(i32 %12, i32 %13)
store i32 %14, i32* %5
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @TH_FindOrCreateEdge(i32 %0, i32 %1) {
%3 = tail call i32 @TH_FindEdge(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @TH_CreateEdge(i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %3, %2 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
size_t func_outputs_max(void) { return 2; }


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

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

LLVM IR (-O0):
define i64 @func_outputs_max() {
ret i64 2
}

LLVM IR (-O2):
define i64 @func_outputs_max() {
ret i64 2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_clear_multprec_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(577, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @syscon_clear_multprec_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 577, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void fa120(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        p024A:
          goto p024A;
          goto a;
        a:
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa120>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa120+0x4>

x86 assembly (clang, -O2):
<fa120>:
jmp    1100 <fa120>

LLVM IR (-O0):
define void @fa120() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa120() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int number;
  scanf("%d", &number);
  printf("%d\n", fib(number));
  return 0;
}


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)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1050 <fib@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%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
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @fib(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @fib(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
unsigned int CalcTileHeight_elt(unsigned int);
unsigned int CalcHeightInTiles_elt(unsigned int height, unsigned int bit_cnt) {
  unsigned int tsize = CalcTileHeight_elt(bit_cnt);
  return (height + tsize - 1) / tsize;
}


x86 assembly (clang, -O0):
<CalcHeightInTiles_elt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <CalcTileHeight_elt@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcHeightInTiles_elt>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <CalcTileHeight_elt@plt>
mov    %eax,%ecx
lea    (%rbx,%rcx,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CalcHeightInTiles_elt(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 = call i32 @CalcTileHeight_elt(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = add i32 %8, %9
%11 = sub i32 %10, 1
%12 = load i32, i32* %5
%13 = udiv i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalcHeightInTiles_elt(i32 %0, i32 %1) {
%3 = tail call i32 @CalcTileHeight_elt(i32 %1)
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = udiv i32 %5, %3
ret i32 %6
}
void inportsm(unsigned short port, unsigned char *data, unsigned long size) {
  asm volatile("rep insw" : "+D"(data), "+c"(size) : "d"(port) : "memory");
}


x86 assembly (clang, -O0):
<inportsm>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x2(%rbp),%dx
rep insw (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportsm>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @inportsm(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i16, i16* %4
%10 = call { i8*, i64 } asm sideeffect "rep insw", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @inportsm(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep insw", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ marknoteend();
int /*<<< orphan*/ marknotestart();
void marknote() {
  marknotestart();
  marknoteend();
}


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

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

LLVM IR (-O0):
define void @marknote() {
%1 = call i32 (...) @marknotestart()
%2 = call i32 (...) @marknoteend()
ret void
}

LLVM IR (-O2):
define void @marknote() {
%1 = tail call i32 (...) @marknotestart()
%2 = tail call i32 (...) @marknoteend()
ret void
}
int getpid() { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @getpid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  printf("This goes to standard output\n");
  fprintf(stderr, "This goes to error output\n");
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"This goes to standard output\0A\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"This goes to error output\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [27 x i8] c"This goes to error output\0A\00"
@str = [29 x i8] c"This goes to standard output\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *sv_get_module_name(int, int);
const char *vox_get_module_name(int slot, int mod_num) {
  return sv_get_module_name(slot, mod_num);
}


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

x86 assembly (clang, -O2):
<vox_get_module_name>:
jmp    1030 <sv_get_module_name@plt>

LLVM IR (-O0):
define i8* @vox_get_module_name(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 i8* @sv_get_module_name(i32 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @vox_get_module_name(i32 %0, i32 %1) {
%3 = tail call i8* @sv_get_module_name(i32 %0, i32 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void mutex_init(pthread_mutex_t *restrict mutex,
                const pthread_mutexattr_t *restrict attr) {
  int err = pthread_mutex_init(mutex, attr);
  if (err != 0) {
    perror("pthread_mutex_init");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1174 <mutex_init+0x44>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_init>:
push   %rax
call   1050 <pthread_mutex_init@plt>
test   %eax,%eax
jne    113c <mutex_init+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"pthread_mutex_init\00"
@EXIT_FAILURE = global i32 0
define void @mutex_init(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @pthread_mutex_init(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_mutex_init\00"
@EXIT_FAILURE = global i32 0
define void @mutex_init(i32* noalias %0, i32* noalias %1) {
%3 = tail call i32 @pthread_mutex_init(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void rtcp_xr_rrtp_set_reserved(uint8_t *p_rtcp_xr_rrtp) {
  p_rtcp_xr_rrtp[1] = 0;
}


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

x86 assembly (clang, -O2):
<rtcp_xr_rrtp_set_reserved>:
movq   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @rtcp_xr_rrtp_set_reserved(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @rtcp_xr_rrtp_set_reserved(i64* nocapture writeonly %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
store i64 0, i64* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ digest;

/* Variables and functions */
scalar_t__ base16_decode(char *, int, char const *, int);
int router_digest_is_me(char *);
int strlen(char const *);
int router_fingerprint_is_me(const char *fp) {
  char digest[20];
  if (strlen(fp) == 40 && base16_decode(digest, sizeof(digest), fp, 40) == 0)
    return router_digest_is_me(digest);
  return 0;
}


x86 assembly (clang, -O0):
<router_fingerprint_is_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x28,%eax
jne    1180 <router_fingerprint_is_me+0x50>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x14,%esi
mov    $0x28,%ecx
call   1050 <base16_decode@plt>
cmp    $0x0,%rax
jne    1180 <router_fingerprint_is_me+0x50>
lea    -0x30(%rbp),%rdi
call   1030 <router_digest_is_me@plt>
mov    %eax,-0x4(%rbp)
jmp    1187 <router_fingerprint_is_me+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<router_fingerprint_is_me>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x28,%eax
jne    1169 <router_fingerprint_is_me+0x39>
mov    %rsp,%rdi
mov    $0x14,%esi
mov    %rbx,%rdx
mov    $0x28,%ecx
call   1050 <base16_decode@plt>
test   %rax,%rax
jne    1169 <router_fingerprint_is_me+0x39>
mov    %rsp,%rdi
call   1030 <router_digest_is_me@plt>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @router_fingerprint_is_me(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [20 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 40
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i64 @base16_decode(i8* %9, i32 20, i8* %10, i32 40)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%15 = call i32 @router_digest_is_me(i8* %14)
store i32 %15, i32* %2
br label %17
16: ; preds = %8, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @router_fingerprint_is_me(i8* %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 40
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i64 @base16_decode(i8* %3, i32 20, i8* %0, i32 40)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @router_digest_is_me(i8* %3)
br label %11
11: ; preds = %1, %6, %9
%12 = phi i32 [ %10, %9 ], [ 0, %6 ], [ 0, %1 ]
ret i32 %12
}
int dev_punchrd_read(struct dev_punchrd *punchrd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dev_punchrd = type opaque
define i32 @dev_punchrd_read(%struct.dev_punchrd* nocapture readnone %0) {
ret i32 0
}
int iscleft(char c) {
  int ret = 0;
  switch (c) {
  case '<':
  case '(':
  case '{':
  case '[':
  case '\'':
  case '\"':
    ret = 1;
    break;
  default:
    ret = 0;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<iscleft>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     116d <iscleft+0x6d>
jmp    1126 <iscleft+0x26>
mov    -0xc(%rbp),%eax
add    $0xffffffd9,%eax
sub    $0x2,%eax
jb     116d <iscleft+0x6d>
jmp    113a <iscleft+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x3c,%eax
je     116d <iscleft+0x6d>
jmp    114b <iscleft+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     116d <iscleft+0x6d>
jmp    115c <iscleft+0x5c>
mov    -0xc(%rbp),%eax
sub    $0x7b,%eax
jne    1179 <iscleft+0x79>
jmp    116d <iscleft+0x6d>
movl   $0x1,-0x8(%rbp)
jmp    1180 <iscleft+0x80>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscleft>:
mov    $0x1,%eax
lea    -0x22(%rdi),%ecx
cmp    $0x39,%ecx
ja     111e <iscleft+0x1e>
movabs $0x200000004000061,%rdx
bt     %rcx,%rdx
jae    111e <iscleft+0x1e>
ret
cmp    $0x7b,%edi
je     111d <iscleft+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iscleft(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 60, label %6
i32 40, label %6
i32 123, label %6
i32 91, label %6
i32 39, label %6
i32 34, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %8
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @iscleft(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 60, label %4
i32 40, label %4
i32 123, label %4
i32 91, label %4
i32 39, label %4
i32 34, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int int_compare(void *int1, void *int2) {
  if (int1 > int2)
    return 1;
  else if (int1 < int2)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1126 <int_compare+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1147 <int_compare+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1140 <int_compare+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <int_compare+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
cmp    %rsi,%rdi
sbb    %ecx,%ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void zeroi(int n, int *v) {
  int *end;
  end = v + n;
  for (; v < end; v++)
    *v &= 0;
  return;
}


x86 assembly (clang, -O0):
<zeroi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1148 <zeroi+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
and    $0x0,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111e <zeroi+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroi>:
test   %edi,%edi
jle    1146 <zeroi+0x36>
push   %rax
mov    %edi,%eax
lea    (%rsi,%rax,4),%rax
lea    0x4(%rsi),%rcx
cmp    %rcx,%rax
cmova  %rax,%rcx
mov    %rsi,%rax
not    %rax
lea    (%rcx,%rax,1),%rdx
add    $0x4,%rdx
and    $0xfffffffffffffffc,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zeroi(i32 %0, i32* writeonly %1) {
%3 = ptrtoint i32* %1 to i64
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = zext i32 %0 to i64
%7 = bitcast i32* %1 to i8*
%8 = shl nuw nsw i64 %6, 2
%9 = add i64 %8, %3
%10 = add i64 %3, 4
%11 = call i64 @llvm.umax.i64(i64 %9, i64 %10)
%12 = xor i64 %3, -1
%13 = add i64 %11, %12
%14 = add i64 %13, 4
%15 = and i64 %14, -4
br label %16
16: ; preds = %5, %2
ret void
}
/* Variables and functions */
double sinc(double);
double S(int k, double h, double x) { return sinc((x / h) - k); }


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1030 <sinc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <sinc@plt>

LLVM IR (-O0):
define double @S(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fdiv double %7, %8
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fsub double %9, %11
%13 = call double @sinc(double %12)
ret double %13
}

LLVM IR (-O2):
define double @S(i32 %0, double %1, double %2) {
%4 = fdiv double %2, %1
%5 = sitofp i32 %0 to double
%6 = fsub double %4, %5
%7 = tail call double @sinc(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ DEKHash(char *, int);
int /*<<< orphan*/ base10to36(char *, int /*<<< orphan*/);
void ion_run_to_readname(char *id, char *run, int size) {
  base10to36(id, DEKHash(run, size));
}


x86 assembly (clang, -O0):
<ion_run_to_readname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <DEKHash@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <base10to36@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ion_run_to_readname>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <DEKHash@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <base10to36@plt>

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

LLVM IR (-O2):
define void @ion_run_to_readname(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @DEKHash(i8* %1, i32 %2)
%5 = tail call i32 @base10to36(i8* %0, i32 %4)
ret void
}
int square(int a) { return (a * a); }


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

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

LLVM IR (-O0):
define i32 @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
unsigned int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
unsigned int fcntl(int, int /*<<< orphan*/, unsigned int);
void set_close_on_exec(int fd) {
  unsigned v;
  v = fcntl(fd, F_GETFD, 0);
  fcntl(fd, F_SETFD, v | FD_CLOEXEC);
}


x86 assembly (clang, -O0):
<set_close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e91(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_close_on_exec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ea5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @set_close_on_exec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFD
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFD
%9 = load i32, i32* %3
%10 = load i32, i32* @FD_CLOEXEC
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @set_close_on_exec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFD
%5 = load i32, i32* @FD_CLOEXEC
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
void INT_Excep_MTU6_TGIE6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU6_TGIE6() {
ret void
}
int IsByteRange(long Val) { return (Val & ~0xFFL) == 0; }


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

x86 assembly (clang, -O2):
<IsByteRange>:
xor    %eax,%eax
cmp    $0x100,%rdi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @IsByteRange(i64 %0) {
%2 = icmp ult i64 %0, 256
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ incovert(char *);
int /*<<< orphan*/ intToStr(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n = 334045;
  printf("int : %d \n", n);
  char str[100000];
  intToStr(n, str);
  incovert(str);
  printf("str : %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x518dd,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0x186b0(%rbp),%rsi
call   1050 <intToStr@plt>
lea    -0x186b0(%rbp),%rdi
call   1040 <incovert@plt>
lea    -0x186b0(%rbp),%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x186b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x186a0,%rsp
lea    0xec1(%rip),%rdi
mov    $0x518dd,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    $0x518dd,%edi
mov    %rbx,%rsi
call   1050 <intToStr@plt>
mov    %rbx,%rdi
call   1040 <incovert@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x186a0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"int : %d \0A\00"
@.str.1 = [10 x i8] c"str : %s\0A\00"
define i32 @main() {
%1 = alloca [100000 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 334045)
%3 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
%4 = call i32 @intToStr(i32 334045, i8* %3)
%5 = call i32 @incovert(i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int object_attack(void *self, int damage) {
  printf("You can't attack that.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"You can't attack that.\0A\00"
define i32 @object_attack(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"You can't attack that.\00"
define i32 @object_attack(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void inc_zcache_failed_eph_puts(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_failed_eph_puts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMRRESTOREDC_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRRESTOREDC_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

LLVM IR (-O0):
define void @U_WMRRESTOREDC_swap(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 = call i32 @U_WMRCORE_SIZE16_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRRESTOREDC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nfa_entry(char *, char *);
void main() { nfa_entry("(hello|world)+", "helloworldworld"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <nfa_entry@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"(hello|world)+\00"
@.str.1 = [16 x i8] c"helloworldworld\00"
define void @main() {
%1 = call i32 @nfa_entry(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"(hello|world)+\00"
@.str.1 = [16 x i8] c"helloworldworld\00"
define void @main() {
%1 = tail call i32 @nfa_entry(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeStr(void *str) {
  char *temp = str;
  free(temp);
}


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

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

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

LLVM IR (-O2):
define void @freeStr(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}