xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char, char, char,
                          int /*<<< orphan*/, char, char, char, char, char,
                          char);
main() {
  printf("A - %d\tB - %d\tC - %d\na - %d\tb - %d\tc - %d\n0 - %d\t1 - %d\t2 - "
         "%d\n$ - %d\n* - %d\t+ - %d\t/ - %d",
         'A', 'B', 'C', 'a', 'b', 'c', '0', '1', '2', '$', '*', '+', '/');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
mov    $0x61,%r8d
mov    $0x62,%r9d
movl   $0x63,(%rsp)
movl   $0x30,0x8(%rsp)
movl   $0x31,0x10(%rsp)
movl   $0x32,0x18(%rsp)
movl   $0x24,0x20(%rsp)
movl   $0x2a,0x28(%rsp)
movl   $0x2b,0x30(%rsp)
movl   $0x2f,0x38(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
mov    $0x61,%r8d
mov    $0x62,%r9d
push   $0x2f
push   $0x2b
push   $0x2a
push   $0x24
push   $0x32
push   $0x31
push   $0x30
push   $0x63
call   1030 <printf@plt>
add    $0x40,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"A - %d\09B - %d\09C - %d\0Aa - %d\09b - %d\09c - %d\0A0 - %d\091 - %d\092 - %d\0A$ - %d\0A* - %d\09+ - %d\09/ - %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8 signext 65, i8 signext 66, i8 signext 67, i8 signext 97, i8 signext 98, i8 signext 99, i32 48, i8 signext 49, i8 signext 50, i8 signext 36, i8 signext 42, i8 signext 43, i8 signext 47)
ret i32 0
}

LLVM IR (-O2):
@.str = [91 x i8] c"A - %d\09B - %d\09C - %d\0Aa - %d\09b - %d\09c - %d\0A0 - %d\091 - %d\092 - %d\0A$ - %d\0A* - %d\09+ - %d\09/ - %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8 signext 65, i8 signext 66, i8 signext 67, i8 signext 97, i8 signext 98, i8 signext 99, i32 48, i8 signext 49, i8 signext 50, i8 signext 36, i8 signext 42, i8 signext 43, i8 signext 47)
ret i32 0
}
unsigned int hash_to_index(unsigned int hash_size, unsigned int hashvalue) {
  return (hashvalue % hash_size);
}


x86 assembly (clang, -O0):
<hash_to_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_to_index>:
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_to_index(i32 %0, i32 %1) {
%3 = urem i32 %1, %0
ret i32 %3
}
int adis16201_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16201_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void perr(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<perr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perr>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perr(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ascending(int n) {
  if (n > 0) {
    ascending(n - 1);
    printf("%d", n);
  }
}


x86 assembly (clang, -O0):
<ascending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114f <ascending+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <ascending@plt>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascending>:
test   %edi,%edi
jle    113e <ascending+0x1e>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1040 <ascending@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @ascending(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = add nsw i32 %0, -1
tail call void @ascending(i32 %5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_safe_pawn_squares(int, int);
void b_safe_pawn_squares_test(void **state) {
  assert_int_equal(
      0xFFFFFFEBD708FFFFul,
      b_safe_pawn_squares(0x000000000C10E300ul, 0x00E3140800000000ul));
}


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

x86 assembly (clang, -O2):
<b_safe_pawn_squares_test>:
push   %rax
mov    $0xc10e300,%edi
xor    %esi,%esi
call   1030 <b_safe_pawn_squares@plt>
mov    $0xd708ffff,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_safe_pawn_squares_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_safe_pawn_squares(i32 202433280, i32 0)
%4 = call i32 @assert_int_equal(i32 -687276033, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_safe_pawn_squares_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_safe_pawn_squares(i32 202433280, i32 0)
%3 = tail call i32 @assert_int_equal(i32 -687276033, i32 %2)
ret void
}
int HelpItem111(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem111() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put_char_int(int);
void OUTSTR_CALLEE(int c1, int c2, int c3) {
  put_char_int(c1);
  put_char_int(c2);
  put_char_int(c3);
}


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

x86 assembly (clang, -O2):
<OUTSTR_CALLEE>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <put_char_int@plt>
mov    %ebp,%edi
call   1030 <put_char_int@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put_char_int@plt>

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

LLVM IR (-O2):
define void @OUTSTR_CALLEE(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put_char_int(i32 %0)
%5 = tail call i32 @put_char_int(i32 %1)
%6 = tail call i32 @put_char_int(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(long);
int /*<<< orphan*/ printf(char *, long);
void *Malloc(long x) {
  void *p;
  p = malloc(x);
  if (p == NULL) {
    printf("ERROR: Not enough memory (for a block of size %lu)\n", x);
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <Malloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <Malloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"ERROR: Not enough memory (for a block of size %lu)\0A\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [52 x i8] c"ERROR: Not enough memory (for a block of size %lu)\0A\00"
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
int main() {
  f();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *pname, int exit_code) {
  printf("Usage: %s -p pid -l libpath\n", pname);
  printf("    -h  --help      Display this usage information.\n"
         "    -p  --pid       PID of target process.\n"
         "    -l  --libpath   Absolute path of the shared library that will be "
         "injected.\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: %s -p pid -l libpath\0A\00"
@.str.1 = [175 x i8] c" -h --help Display this usage information.\0A -p --pid PID of target process.\0A -l --libpath Absolute path of the shared library that will be injected.\0A\00"
define void @print_usage(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: %s -p pid -l libpath\0A\00"
@str = [174 x i8] c" -h --help Display this usage information.\0A -p --pid PID of target process.\0A -l --libpath Absolute path of the shared library that will be injected.\00"
define void @print_usage(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([174 x i8], [174 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 %1)
unreachable
}
int operation_sub(int a, int b) { return a - b; }


x86 assembly (clang, -O0):
<operation_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @operation_sub(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @operation_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int maxSubArray(int *, int);
int /*<<< orphan*/ printf(char *, int);
void maxSubArrayMain(void) {
  int nums[] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  int len = 0;
  { len = sizeof(nums) / sizeof(nums[0]); };
  printf("%d\n", maxSubArray(nums, len));
}


x86 assembly (clang, -O0):
<maxSubArrayMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <maxSubArray@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxSubArrayMain>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <maxSubArray@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.maxSubArrayMain.nums = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define void @maxSubArrayMain() {
%1 = alloca [9 x i32]
%2 = alloca i32
%3 = bitcast [9 x i32]* %1 to i8*
store i32 0, i32* %2
store i32 9, i32* %2
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @maxSubArray(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.maxSubArrayMain.nums = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define void @maxSubArrayMain() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxSubArray(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int BitIsReset(void *Data, unsigned Bit) {
  unsigned char *D = Data;
  return (D[Bit / 8] & (0x01 << (Bit % 8))) == 0;
}


x86 assembly (clang, -O0):
<BitIsReset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movzbl (%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
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @BitIsReset(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 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = xor i32 %7, -1
%10 = lshr i32 %9, %8
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int strcmp(char *, char *);
int string_compare(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<string_compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
const char *get_arch() { return "x86-64"; }


x86 assembly (clang, -O0):
<get_arch>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arch>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"x86-64\00"
define i8* @get_arch() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"x86-64\00"
define i8* @get_arch() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double transverse_distance(double);
double angular_diameter_distance(double z) {
  return (transverse_distance(z) / (1.0 + z));
}


x86 assembly (clang, -O0):
<angular_diameter_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <transverse_distance@plt>
movsd  0xed1(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angular_diameter_distance>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <transverse_distance@plt>
movsd  (%rsp),%xmm1
addsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @angular_diameter_distance(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @transverse_distance(double %3)
%5 = load double, double* %2
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @angular_diameter_distance(double %0) {
%2 = tail call double @transverse_distance(double %0)
%3 = fadd double %0, 1.000000e+00
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_xiMC(int, int, double **);
void(g5_set_xiMC_)(int *devid, int *ni, double (*xi)[3]) {
  g5_set_xiMC(*devid, *ni, xi);
}


x86 assembly (clang, -O0):
<g5_set_xiMC_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <g5_set_xiMC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_set_xiMC_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <g5_set_xiMC@plt>

LLVM IR (-O0):
define void @g5_set_xiMC_(i32* %0, i32* %1, [3 x double]* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca [3 x double]*
store i32* %0, i32** %4
store i32* %1, i32** %5
store [3 x double]* %2, [3 x double]** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load [3 x double]*, [3 x double]** %6
%12 = bitcast [3 x double]* %11 to double**
%13 = call i32 @g5_set_xiMC(i32 %8, i32 %10, double** %12)
ret void
}

LLVM IR (-O2):
define void @g5_set_xiMC_(i32* nocapture %0, i32* nocapture %1, [3 x double]* %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = bitcast [3 x double]* %2 to double**
%7 = tail call i32 @g5_set_xiMC(i32 %4, i32 %5, double** %6)
ret void
}
int pldummy_dg300() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_dg300() {
ret i32 0
}
void dummy_gcode_command_executed(void *user, char letter, float val) {}


x86 assembly (clang, -O0):
<dummy_gcode_command_executed>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movss  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_gcode_command_executed(i8* %0, i8 signext %1, float %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca float
store i8* %0, i8** %4
store i8 %1, i8* %5
store float %2, float* %6
ret void
}

LLVM IR (-O2):
define void @dummy_gcode_command_executed(i8* nocapture %0, i8 signext %1, float %2) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_basic_operations();
int /*<<< orphan*/ test_thread_safety();
int main(int argc, const char *argv[]) {
  test_basic_operations();
  test_thread_safety();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_basic_operations@plt>
xor    %eax,%eax
call   1040 <test_thread_safety@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @test_basic_operations()
%7 = call i32 (...) @test_thread_safety()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_basic_operations()
%4 = tail call i32 (...) @test_thread_safety()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int COLS;
int gui_max_x() { return COLS; }


x86 assembly (clang, -O0):
<gui_max_x>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_max_x>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@COLS = global i32 0
define i32 @gui_max_x() {
%1 = load i32, i32* @COLS
ret i32 %1
}

LLVM IR (-O2):
@COLS = global i32 0
define i32 @gui_max_x() {
%1 = load i32, i32* @COLS
ret i32 %1
}
void die(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double modf(double, double *);
double yy_frct(double f) {
  double g;
  return modf(f, &g);
}


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

x86 assembly (clang, -O2):
<yy_frct>:
push   %rax
mov    %rsp,%rdi
call   1030 <modf@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @yy_frct(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @modf(double %4, double* %3)
ret double %5
}

LLVM IR (-O2):
define double @yy_frct(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call double @modf(double %0, double* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ udpClose();
void sighandler(int t) {
  udpClose();
  exit(1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <udpClose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %eax,%eax
call   1030 <udpClose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @udpClose()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @udpClose()
%3 = tail call i32 @exit(i32 1)
unreachable
}
void RTC_WKUP_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @RTC_WKUP_IRQHandler() {
ret void
}
void test23(void) {
  int a, b, c;
  a = b, c = a;
}


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

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

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

LLVM IR (-O2):
define void @test23() {
ret void
}
/* Variables and functions */
char *getenv(char *);
int DebugModeOn() {
  char const *debug = getenv("RA_DEBUGMODE");
  return debug && *debug == '1';
}


x86 assembly (clang, -O0):
<DebugModeOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1148 <DebugModeOn+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DebugModeOn>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     112f <DebugModeOn+0x1f>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x31,(%rcx)
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"RA_DEBUGMODE\00"
define i32 @DebugModeOn() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 49
br label %10
10: ; preds = %5, %0
%11 = phi i1 [ false, %0 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"RA_DEBUGMODE\00"
define i32 @DebugModeOn() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 49
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ foo(float);
int rand();
int main(void) {
  int i;
  for (i = 0; i < 1000; i++) {
    foo(((float)(rand() % 65536)) / ((float)(rand() % 65536)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    118a <main+0x6a>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movss  -0xc(%rbp),%xmm0
mov    $0x10000,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm1
divss  %xmm1,%xmm0
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x3e8,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
call   1030 <foo@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %11, %1 ]
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 65536
%5 = sitofp i32 %4 to float
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 65536
%8 = sitofp i32 %7 to float
%9 = fdiv float %5, %8
%10 = tail call i32 @foo(float %9)
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 1000
br i1 %12, label %13, label %1
13: ; preds = %1
ret i32 0
}
/* Variables and functions */
int mystrlen(char *inp) {
  int len = 0;
  char *cur = inp;
  if (inp == NULL || !(*inp)) {
    return -1;
  }
  while (*cur++ != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112f <mystrlen+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <mystrlen+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <mystrlen+0x6f>
jmp    1140 <mystrlen+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <mystrlen+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <mystrlen+0x40>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112b <mystrlen+0x2b>
cmpb   $0x0,(%rdi)
je     112b <mystrlen+0x2b>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1120 <mystrlen+0x20>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nuw nsw i32 %8, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1, %3
%14 = phi i32 [ -1, %3 ], [ -1, %1 ], [ %10, %6 ]
ret i32 %14
}
void gtk_window_has_toplevel_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_has_toplevel_focus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  print_string("should get: 123\ngot: ");
  x = 1;
  while (x < 4) {
    print_int(x);
    x = x + 1;
  }
  print_string("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <print_string@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    115b <main+0x3b>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <main+0x1b>
lea    0xeb4(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x1,%edi
call   1040 <print_int@plt>
mov    $0x2,%edi
call   1040 <print_int@plt>
mov    $0x3,%edi
call   1040 <print_int@plt>
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"should get: 123\0Agot: \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @print_int(i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"should get: 123\0Agot: \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i32 1)
%3 = tail call i32 @print_int(i32 2)
%4 = tail call i32 @print_int(i32 3)
%5 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetInput();
int /*<<< orphan*/ GetInput1();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Try GetInput1:\n");
  GetInput1();
  printf("Try GetInput:\n");
  GetInput();
  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    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <GetInput1@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <GetInput@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <GetInput1@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <GetInput@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Try GetInput1:\0A\00"
@.str.1 = [15 x i8] c"Try GetInput:\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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @GetInput1()
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @GetInput()
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Try GetInput1:\00"
@str.2 = [14 x i8] c"Try GetInput:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @GetInput1()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 (...) @GetInput()
ret i32 0
}
/* Variables and functions */
int __parse_common(void *, int *, int *, char *);
int trace_parse_common_pid(void *data) {
  static int pid_offset;
  static int pid_size;
  return __parse_common(data, &pid_size, &pid_offset, "common_pid");
}


x86 assembly (clang, -O0):
<trace_parse_common_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f09(%rip),%rsi
lea    0x2efe(%rip),%rdx
lea    0xecb(%rip),%rcx
call   1030 <__parse_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_parse_common_pid>:
lea    0x2f19(%rip),%rsi
lea    0x2f0e(%rip),%rdx
lea    0xedb(%rip),%rcx
jmp    1030 <__parse_common@plt>

LLVM IR (-O0):
@trace_parse_common_pid.pid_offset = internal global i32 0
@trace_parse_common_pid.pid_size = internal global i32 0
@.str = [11 x i8] c"common_pid\00"
define i32 @trace_parse_common_pid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__parse_common(i8* %3, i32* @trace_parse_common_pid.pid_size, i32* @trace_parse_common_pid.pid_offset, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@trace_parse_common_pid.pid_offset = internal global i32 0
@trace_parse_common_pid.pid_size = internal global i32 0
@.str = [11 x i8] c"common_pid\00"
define i32 @trace_parse_common_pid(i8* %0) {
%2 = tail call i32 @__parse_common(i8* %0, i32* @trace_parse_common_pid.pid_size, i32* @trace_parse_common_pid.pid_offset, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
void *calloc(int, size_t);
void *alloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<alloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @alloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_eta(double eta) {
  printf("eta = ");
  printf("%g", eta);
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_eta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_eta>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"eta = \00"
@.str.1 = [3 x i8] c"%g\00"
define void @dump_eta(double %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "Placeholder for a real example.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Placeholder for a real example.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Placeholder for a real example.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int foo(int *);
int main() {
  int a[4] = {1, 2, 3, 4};
  return foo(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ notImplementedRTF();
void prtAtExitR() { notImplementedRTF(); }


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

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

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

LLVM IR (-O2):
define void @prtAtExitR() {
%1 = tail call i32 (...) @notImplementedRTF()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printUsage(char *name) {
  printf("Usage : %s <options> <keyfile.bin>\n", name);
  printf("-l : learn the ir code and store in key.bin\n");
  printf("-s : send the if code stored in key.bin\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage : %s <options> <keyfile.bin>\0A\00"
@.str.1 = [45 x i8] c"-l : learn the ir code and store in key.bin\0A\00"
@.str.2 = [41 x i8] c"-s : send the if code stored in key.bin\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage : %s <options> <keyfile.bin>\0A\00"
@str = [44 x i8] c"-l : learn the ir code and store in key.bin\00"
@str.3 = [40 x i8] c"-s : send the if code stored in key.bin\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
ret void
}