xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t len) {
  void *r = malloc(len ? len : 1);
  if (r)
    return r;
  fprintf(stderr, "Out of memory allocating %zu bytes!\n", len);
  exit(1);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <xmalloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <xmalloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1162 <xmalloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1184 <xmalloc+0x54>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe68(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
mov    $0x1,%edi
cmovne %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     114c <xmalloc+0x1c>
pop    %rbx
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Out of memory allocating %zu bytes!\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i64 [ %7, %6 ], [ 1, %8 ]
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8*, i8** %3
ret i8* %15
16: ; preds = %9
%17 = load i32, i32* @stderr
%18 = load i64, i64* %2
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %18)
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Out of memory allocating %zu bytes!\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
ret i8* %4
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %0)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(int);
char *makeMyString(void) {
  char *str = malloc(sizeof(char) * 10);
  str[0] = 'a';
  str[1] = 'b';
  str[2] = 'c';
  str[3] = 'd';
  str[4] = 'e';
  str[5] = 'f';
  str[6] = 0;
  return str;
}


x86 assembly (clang, -O0):
<makeMyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x62,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x63,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x64,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x65,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x66,0x5(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x6(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeMyString>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movl   $0x64636261,(%rax)
movw   $0x6665,0x4(%rax)
movb   $0x0,0x6(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @makeMyString() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 97, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 98, i8* %6
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 99, i8* %8
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 100, i8* %10
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i64 4
store i8 101, i8* %12
%13 = load i8*, i8** %1
%14 = getelementptr inbounds i8, i8* %13, i64 5
store i8 102, i8* %14
%15 = load i8*, i8** %1
%16 = getelementptr inbounds i8, i8* %15, i64 6
store i8 0, i8* %16
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @makeMyString() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
store i8 97, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 98, i8* %2
%3 = getelementptr inbounds i8, i8* %1, i64 2
store i8 99, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 100, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 4
store i8 101, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 5
store i8 102, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 6
store i8 0, i8* %7
ret i8* %1
}
int __attribute__((target("arch=ivybridge"))) foo(int i, ...) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, ...) {
ret i32 1
}
/* Variables and functions */
void OPENSSL_cpuid_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @OPENSSL_cpuid_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yy_scan_string(char *);
int yyparse();
int parse(char *input_string) {
  char input_tmp[262144];
  int j = 0;
  yy_scan_string(input_string);
  int ret = yyparse();
  return ret;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40020,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x40014(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <yy_scan_string@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    %eax,-0x40018(%rbp)
mov    -0x40018(%rbp),%eax
add    $0x40020,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parse(i8* %0) {
%2 = alloca i8*
%3 = alloca [262144 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%6 = load i8*, i8** %2
%7 = call i32 @yy_scan_string(i8* %6)
%8 = call i32 (...) @yyparse()
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @parse(i8* %0) {
%2 = tail call i32 @yy_scan_string(i8* %0)
%3 = tail call i32 (...) @yyparse()
ret i32 %3
}
/* Variables and functions */
int Isleap(int);
int Cyear(int syr, int eyr) {
  int dtotal = 0;
  for (; syr < eyr; syr++) {
    if (Isleap(syr) == 1) {
      dtotal += 356;
    } else
      dtotal += 355;
  }
  return dtotal;
}


x86 assembly (clang, -O0):
<Cyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1170 <Cyear+0x60>
mov    -0x4(%rbp),%edi
call   1030 <Isleap@plt>
cmp    $0x1,%eax
jne    1152 <Cyear+0x42>
mov    -0xc(%rbp),%eax
add    $0x164,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <Cyear+0x4d>
mov    -0xc(%rbp),%eax
add    $0x163,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <Cyear+0x52>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <Cyear+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyear>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
jge    114f <Cyear+0x3f>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <Isleap@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebx
add    $0x163,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <Cyear+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Cyear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @Isleap(i32 %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 356
store i32 %16, i32* %5
br label %20
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 355
store i32 %19, i32* %5
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @Cyear(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = tail call i32 @Isleap(i32 %6)
%8 = icmp eq i32 %7, 1
%9 = select i1 %8, i32 356, i32 355
%10 = add nuw nsw i32 %9, %5
%11 = add i32 %6, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
typedef long uint;

/* Variables and functions */
scalar_t__ rand();
size_t getLongRand(uint bits) {
  size_t x = (size_t)rand();
  size_t n = (x << 31L) | ((size_t)rand());
  n = n >> (62L - bits);
  return n;
}


x86 assembly (clang, -O0):
<getLongRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1f,%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3e,%ecx
sub    -0x8(%rbp),%rcx
shr    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLongRand>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
shl    $0x1f,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
or     %rbx,%rax
mov    $0x3e,%cl
sub    %r14b,%cl
shr    %cl,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @getLongRand(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i64 (...) @rand()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = shl i64 %6, 31
%8 = call i64 (...) @rand()
%9 = or i64 %7, %8
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = load i64, i64* %2
%12 = sub nsw i64 62, %11
%13 = lshr i64 %10, %12
store i64 %13, i64* %4
%14 = load i64, i64* %4
ret i64 %14
}

LLVM IR (-O2):
define i64 @getLongRand(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = shl i64 %2, 31
%4 = tail call i64 (...) @rand()
%5 = or i64 %3, %4
%6 = sub nsw i64 62, %0
%7 = lshr i64 %5, %6
ret i64 %7
}
/* Variables and functions */
double tanh(double);
double Tanh(double a, double b) { return tanh(a); }


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

x86 assembly (clang, -O2):
<Tanh>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define double @Tanh(double %0, double %1) {
%3 = tail call double @tanh(double %0)
ret double %3
}
int execute_sync_file_range2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sync_file_range2() {
ret i32 0
}
int non_count() {
  int c = 4000;
  return c++;
}


x86 assembly (clang, -O0):
<non_count>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfa0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @non_count() {
%1 = alloca i32
store i32 4000, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @non_count() {
ret i32 4000
}
/* Variables and functions */
int /*<<< orphan*/ buckets_free_all();
int /*<<< orphan*/ pages_free_scratch();
void ub_buckets_exit(void) {
  buckets_free_all();
  pages_free_scratch();
  return;
}


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

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

LLVM IR (-O0):
define void @ub_buckets_exit() {
%1 = call i32 (...) @buckets_free_all()
%2 = call i32 (...) @pages_free_scratch()
ret void
}

LLVM IR (-O2):
define void @ub_buckets_exit() {
%1 = tail call i32 (...) @buckets_free_all()
%2 = tail call i32 (...) @pages_free_scratch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void warning(char *msg) { printf("Warning: %s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @warning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pf4() { printf("Function Test 4\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Function Test 4\00"
define void @pf4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
int change_suffix(char *s, char *dest, char *end) {
  char *s1;
  strcpy(dest, s);
  s1 = strrchr(dest, '.');
  if (s1 == NULL)
    strcat(dest, end);
  else
    strcpy(s1, end);
  return 0;
}


x86 assembly (clang, -O0):
<change_suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1180 <change_suffix+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
jmp    118d <change_suffix+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_suffix>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1164 <change_suffix+0x34>
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    116f <change_suffix+0x3f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @change_suffix(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i8* @strrchr(i8* %11, i8 signext 46)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 @strcat(i8* %16, i8* %17)
br label %23
19: ; preds = %3
%20 = load i8*, i8** %7
%21 = load i8*, i8** %6
%22 = call i32 @strcpy(i8* %20, i8* %21)
br label %23
23: ; preds = %19, %15
ret i32 0
}

LLVM IR (-O2):
define i32 @change_suffix(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %1, i8* %0)
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 46)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @strcat(i8* %1, i8* %2)
br label %11
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %5, i8* %2)
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Type definitions */
struct volshow_args_info {
  int dummy;
};

/* Variables and functions */
int volshow_cmdline_parser2(int, char **, struct volshow_args_info *,
                            int /*<<< orphan*/, int, int);
int volshow_cmdline_parser(int argc, char **argv,
                           struct volshow_args_info *args_info) {
  return volshow_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<volshow_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <volshow_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volshow_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <volshow_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.volshow_args_info = type { i32 }
define i32 @volshow_cmdline_parser(i32 %0, i8** %1, %struct.volshow_args_info* %2) {
%4 = tail call i32 @volshow_cmdline_parser2(i32 %0, i8** %1, %struct.volshow_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void bcopy(const void *src, void *dest, size_t n) { memcpy(dest, src, n); }


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret void
}
int f_bge_rm2(float a1, float *a2) {
  return !(__builtin_isgreaterequal(a1, *a2));
}


x86 assembly (clang, -O0):
<f_bge_rm2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_rm2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @f_bge_rm2(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp oge float %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_bge_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ugt float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int myatoi(char *p) {
  int i = 0;
  while (*p != '\x00' && *p >= '0' && *p <= '9') {
    i *= 10;
    i += *(unsigned char *)p - '0';
    p++;
  }
  return i;
}


x86 assembly (clang, -O0):
<myatoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1149 <myatoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1149 <myatoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <myatoi+0x59>
jmp    1181 <myatoi+0x81>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <myatoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myatoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <myatoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <myatoi+0x20>
ret

LLVM IR (-O0):
define i32 @myatoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br label %19
19: ; preds = %14, %9, %4
%20 = phi i1 [ false, %9 ], [ false, %4 ], [ %18, %14 ]
br i1 %20, label %21, label %32
21: ; preds = %19
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, 10
store i32 %23, i32* %3
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 48
%28 = load i32, i32* %3
%29 = add nsw i32 %28, %27
store i32 %29, i32* %3
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %2
br label %4
32: ; preds = %19
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @myatoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = mul nsw i32 %7, 10
%10 = zext i8 %6 to i32
%11 = add i32 %9, -48
%12 = add i32 %11, %10
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
double ruby_div0(double x) {
  double t = 0.0;
  return x / t;
}


x86 assembly (clang, -O0):
<ruby_div0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ruby_div0>:
xorpd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ruby_div0(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @ruby_div0(double %0) {
%2 = fdiv double %0, 0.000000e+00
ret double %2
}
void *clrmem7(void *s) { return __builtin_memset(s, 0, 1281); }


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

x86 assembly (clang, -O2):
<clrmem7>:
mov    $0x501,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @clrmem7(i8* returned writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(1281) %0, i8 0, i64 1281, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPointSize(double);
int /*<<< orphan*/ gluOrtho2D(double, double, double, double);
void myinit() {
  glClearColor(1.0, 1.0, 1.0, 1.0);
  glColor3f(1.0, 0.0, 0.0);
  glPointSize(1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, 499.0, 0.0, 499.0);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
movsd  0xe9c(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1040 <glClearColor@plt>
movsd  0xe86(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
movsd  0xe73(%rip),%xmm0
call   1070 <glPointSize@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
xorps  %xmm2,%xmm2
movsd  0xe46(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
call   1080 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
movsd  0xe97(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1040 <glClearColor@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe7b(%rip),%xmm0
call   1060 <glColor3f@plt>
movsd  0xe6e(%rip),%xmm0
call   1070 <glPointSize@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movsd  0xe54(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
pop    %rax
jmp    1080 <gluOrtho2D@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @myinit() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%3 = call i32 @glPointSize(double 1.000000e+00)
%4 = load i32, i32* @GL_PROJECTION
%5 = call i32 @glMatrixMode(i32 %4)
%6 = call i32 (...) @glLoadIdentity()
%7 = call i32 @gluOrtho2D(double 0.000000e+00, double 4.990000e+02, double 0.000000e+00, double 4.990000e+02)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @myinit() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%3 = tail call i32 @glPointSize(double 1.000000e+00)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(double 0.000000e+00, double 4.990000e+02, double 0.000000e+00, double 4.990000e+02)
ret void
}
void gtk_text_view_scroll_to_mark() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_scroll_to_mark() {
ret void
}
int main(int argc, char *argv[]) {
  int foo;
  foo = 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_116(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_116() {
ret i32 0
}
int test_imm_B5int16_mem(short *val) {
  return ((*val) & (-0xB5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B5int16_mem>:
movzwl (%rdi),%eax
test   $0xff4b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B5int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -181
%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_B5int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -181
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_help(int large) {
  printf("Usage: ragrep2 [-a x86] [-L] [-xsd str] [-ft addr] [file] [...]\n");
  if (large)
    printf(" -a x86    select architecture for disasm search\n"
           " -L        list r_asm plugins\n"
           " -x 908e   search a hexpair string\n"
           " -s str    search a string\n"
           " -d opcode search an opcode\n"
           " -f 0x102  'from' address\n"
           " -t 0x502  'to' address\n");
  return 0;
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     113d <show_help+0x2d>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
je     112f <show_help+0x1f>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: ragrep2 [-a x86] [-L] [-xsd str] [-ft addr] [file] [...]\0A\00"
@.str.1 = [220 x i8] c" -a x86 select architecture for disasm search\0A -L list r_asm plugins\0A -x 908e search a hexpair string\0A -s str search a string\0A -d opcode search an opcode\0A -f 0x102 'from' address\0A -t 0x502 'to' address\0A\00"
define i32 @show_help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@str = [64 x i8] c"Usage: ragrep2 [-a x86] [-L] [-xsd str] [-ft addr] [file] [...]\00"
@str.2 = [219 x i8] c" -a x86 select architecture for disasm search\0A -L list r_asm plugins\0A -x 908e search a hexpair string\0A -s str search a string\0A -d opcode search an opcode\0A -f 0x102 'from' address\0A -t 0x502 'to' address\00"
define i32 @show_help(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([219 x i8], [219 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a1(int);
int main(void) {
  int i;
  for (i = 0; i < 10; i++)
    a1(200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
mov    $0xc8,%edi
call   1030 <a1@plt>
xor    %eax,%eax
pop    %rcx
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 = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @a1(i32 200)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a1(i32 200)
%2 = tail call i32 @a1(i32 200)
%3 = tail call i32 @a1(i32 200)
%4 = tail call i32 @a1(i32 200)
%5 = tail call i32 @a1(i32 200)
%6 = tail call i32 @a1(i32 200)
%7 = tail call i32 @a1(i32 200)
%8 = tail call i32 @a1(i32 200)
%9 = tail call i32 @a1(i32 200)
%10 = tail call i32 @a1(i32 200)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void pack_alpha_print_help() {
  char *usage = "Usage: PACKBIN input_file image_type pad_to output_file\n"
                "    input_file    Name of the input binary image file.\n"
                "    image_type    [r|b|d] for [runtime|boot|root directory].\n"
                "    pad_to        Size of the output binary image. (0 means "
                "no padding)\n"
                "    output_file   Name of the output binary image file.\n";
  fprintf(stderr, "%s", usage);
}


x86 assembly (clang, -O0):
<pack_alpha_print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xff6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_alpha_print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0x100d(%rip),%rsi
lea    0xed9(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [301 x i8] c"Usage: PACKBIN input_file image_type pad_to output_file\0A input_file Name of the input binary image file.\0A image_type [r|b|d] for [runtime|boot|root directory].\0A pad_to Size of the output binary image. (0 means no padding)\0A output_file Name of the output binary image file.\0A\00"
@stderr = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @pack_alpha_print_help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([301 x i8], [301 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %1
%4 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [301 x i8] c"Usage: PACKBIN input_file image_type pad_to output_file\0A input_file Name of the input binary image file.\0A image_type [r|b|d] for [runtime|boot|root directory].\0A pad_to Size of the output binary image. (0 means no padding)\0A output_file Name of the output binary image file.\0A\00"
@stderr = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @pack_alpha_print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([301 x i8], [301 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void incr_le(uint8_t *v, size_t len) {
  size_t i = 0;
  while (1) {
    if (++v[i] != 0)
      return;
    i++;
    if (i == len)
      return;
  }
}


x86 assembly (clang, -O0):
<incr_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    (%rcx,%rdx,8),%rax
add    $0x1,%rax
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
je     1137 <incr_le+0x37>
jmp    115b <incr_le+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1156 <incr_le+0x56>
jmp    115b <incr_le+0x5b>
jmp    1114 <incr_le+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<incr_le>:
add    $0xffffffffffffffff,%rsi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
addq   $0x1,(%rdi,%rax,8)
jne    1123 <incr_le+0x23>
lea    0x1(%rax),%rcx
cmp    %rax,%rsi
mov    %rcx,%rax
jne    1110 <incr_le+0x10>
ret

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

LLVM IR (-O2):
define void @incr_le(i64* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 1
store i64 %7, i64* %5
%8 = icmp ne i64 %7, 0
%9 = add i64 %4, 1
%10 = icmp eq i64 %9, %1
%11 = select i1 %8, i1 true, i1 %10
br i1 %11, label %12, label %3
12: ; preds = %3
ret void
}
/* Variables and functions */
int find_next_zero_bit(void *, unsigned int, int /*<<< orphan*/);
int find_first_zero_bit(void *buf, unsigned len) {
  return find_next_zero_bit(buf, len, 0);
}


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

x86 assembly (clang, -O2):
<find_first_zero_bit>:
xor    %edx,%edx
jmp    1030 <find_next_zero_bit@plt>

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

LLVM IR (-O2):
define i32 @find_first_zero_bit(i8* %0, i32 %1) {
%3 = tail call i32 @find_next_zero_bit(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
double strtod(char const *, char **);
const char *gu_str2dbl(const char *str, double *dbl) {
  char *ret;
  *dbl = strtod(str, &ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<gu_str2dbl>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @gu_str2dbl(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
store double %5, double* %1
%6 = load i8*, i8** %3
ret i8* %6
}
/* Variables and functions */
int backtrace(void **, int);
int /*<<< orphan*/ printf(char *, int, void *);
void b(void) {
  void *v[20];
  int i, n;
  n = backtrace(v, 20);
  for (i = 0; i < n; ++i)
    printf("[%d] %p\n", i, v[i]);
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0xa0(%rbp),%rdi
mov    $0x14,%esi
call   1030 <backtrace@plt>
mov    %eax,-0xa8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jge    1193 <b+0x73>
mov    -0xa4(%rbp),%esi
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rdx
ff
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    114c <b+0x2c>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    %rsp,%rdi
mov    $0x14,%esi
call   1030 <backtrace@plt>
test   %eax,%eax
jle    1167 <b+0x47>
mov    %eax,%r15d
xor    %ebx,%ebx
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    (%rsp,%rbx,8),%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <b+0x30>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"[%d] %p\0A\00"
define void @b() {
%1 = alloca [20 x i8*]
%2 = bitcast [20 x i8*]* %1 to i8*
%3 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 20)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = trunc i64 %9 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %11)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ app_metadata_print_json();
int _app_metadata_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  app_metadata_print_json();
  return 0;
}


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

x86 assembly (clang, -O2):
<_app_metadata_handler>:
push   %rax
xor    %eax,%eax
call   1030 <app_metadata_print_json@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_app_metadata_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @app_metadata_print_json()
ret i32 0
}
int get_led_1(void) {
  unsigned int mode = (*(volatile unsigned int *)(0x7F008824)) & 1;
  if (mode)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_led_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1127 <get_led_1+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <get_led_1+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_led_1() {
%1 = alloca i32
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_led_1() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gnu_ptrace(char *, void *);
void __attribute__((__no_instrument_function__))
__cyg_profile_func_enter(void *this_fn, void *call_site) {
  gnu_ptrace("enter", this_fn);
  (void)call_site;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"enter\00"
define void @__cyg_profile_func_enter(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 = call i32 @gnu_ptrace(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"enter\00"
define void @__cyg_profile_func_enter(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @gnu_ptrace(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}