xunge/DecIR huggingface dataset:
testjump(label) int label;
{
  ol("MOV A,H");
  ol("ORA L");
  ot("JZ ");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<testjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testjump>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1060 <printlabel@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"MOV A,H\00"
@.str.1 = [6 x i8] c"ORA L\00"
@.str.2 = [4 x i8] c"JZ \00"
define i32 @testjump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (...) @nl()
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"MOV A,H\00"
@.str.1 = [6 x i8] c"ORA L\00"
@.str.2 = [4 x i8] c"JZ \00"
define i32 @testjump(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%6 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int Cyc_AssnDef_better_prove(void *, void *);
int Cyc_AssnDef_simple_prove(void *, void *);
int Cyc_Vcgen_implies(void *a1, void *a2) {
  int _T0;
  int _T1;
  _T1 = Cyc_AssnDef_simple_prove(a1, a2);
  if (!_T1)
    goto _TL1B;
  _T0 = 1;
  goto _TL1C;
_TL1B:
  _T0 = Cyc_AssnDef_better_prove(a1, a2);
_TL1C:
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Vcgen_implies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_AssnDef_simple_prove@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    114f <Cyc_Vcgen_implies+0x2f>
jmp    115b <Cyc_Vcgen_implies+0x3b>
movl   $0x1,-0x14(%rbp)
jmp    116b <Cyc_Vcgen_implies+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <Cyc_AssnDef_better_prove@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Vcgen_implies>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <Cyc_AssnDef_simple_prove@plt>
test   %eax,%eax
je     1140 <Cyc_Vcgen_implies+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Cyc_AssnDef_better_prove@plt>

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

LLVM IR (-O2):
define i32 @Cyc_Vcgen_implies(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_AssnDef_simple_prove(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Cyc_AssnDef_better_prove(i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ init_timers();
void init_SPAI() { init_timers(); }


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

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

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

LLVM IR (-O2):
define void @init_SPAI() {
%1 = tail call i32 (...) @init_timers()
ret void
}
void iswap(int *x, int *y) {
  int z;
  z = *x;
  *x = *y;
  *y = z;
}


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

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

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

LLVM IR (-O2):
define void @iswap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void test_6(int code) {
  _Bool temp = testit();
  _Bool rotate = (code == 22);
  if (!rotate && temp == 0)
    oof();
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testit@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x6(%rbp)
testb  $0x1,-0x6(%rbp)
jne    116b <test_6+0x4b>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    116b <test_6+0x4b>
mov    $0x0,%al
call   1040 <oof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_6>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <testit@plt>
cmp    $0x16,%ebx
je     113b <test_6+0x1b>
test   %eax,%eax
jne    113b <test_6+0x1b>
xor    %eax,%eax
pop    %rbx
jmp    1040 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_6(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = call i32 (...) @testit()
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 22
%10 = zext i1 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %4
%12 = trunc i8 %11 to i1
br i1 %12, label %20, label %13
13: ; preds = %1
%14 = load i8, i8* %3
%15 = trunc i8 %14 to i1
%16 = zext i1 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 (...) @oof()
br label %20
20: ; preds = %18, %13, %1
ret void
}

LLVM IR (-O2):
define void @test_6(i32 %0) {
%2 = tail call i32 (...) @testit()
%3 = icmp ne i32 %0, 22
%4 = icmp eq i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_parallelism_type(uint8_t *p, uint8_t val) {
  p[14] = 0xfc | val;
}


x86 assembly (clang, -O0):
<h265hvcc_set_parallelism_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
or     $0xfc,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_parallelism_type>:
or     $0xfc,%esi
mov    %esi,0x38(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_parallelism_type(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 = or i32 252, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 14
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_parallelism_type(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 252
%4 = getelementptr inbounds i32, i32* %0, i64 14
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tls_get() {
  printf("NOT IMPLEMENTED:"
         "pa_tls_get"
         "\n");
}


x86 assembly (clang, -O0):
<pa_tls_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"NOT IMPLEMENTED:pa_tls_get\0A\00"
define i32 @pa_tls_get() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [27 x i8] c"NOT IMPLEMENTED:pa_tls_get\00"
define i32 @pa_tls_get() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void task(void) { printf("In the task\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"In the task\00"
define void @task() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_extension(char **, char *);
char *TeX_search_sfd_file(char **name) {
  handle_extension(name, ".sfd");
  return *name;
}


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

x86 assembly (clang, -O2):
<TeX_search_sfd_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <handle_extension@plt>
mov    (%rbx),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".sfd\00"
define i8* @TeX_search_sfd_file(i8** %0) {
%2 = tail call i32 @handle_extension(i8** %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ llrint(double);
int /*<<< orphan*/ llrintf(float);
int /*<<< orphan*/ llrintl(long double);
void uninitvar_llrint(void) {
  float f;
  (void)llrintf(f);
  double d;
  (void)llrint(d);
  long double ld;
  (void)llrintl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_llrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <llrintf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <llrint@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <llrintl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_llrint>:
sub    $0x18,%rsp
call   1040 <llrintf@plt>
call   1030 <llrint@plt>
call   1050 <llrintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_llrint() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @llrintf(float %4)
%6 = load double, double* %2
%7 = call i32 @llrint(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @llrintl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_llrint() {
%1 = tail call i32 @llrintf(float undef)
%2 = tail call i32 @llrint(double undef)
%3 = tail call i32 @llrintl(x86_fp80 undef)
ret void
}
int checkend(s)
char *s;
{
  char *p;
  int atend;
  p = s;
  skipspace(&p);
  if (*p == '\0') {
    atend = 1;
  } else {
    atend = 0;
  };
  return (atend);
}


x86 assembly (clang, -O0):
<checkend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <skipspace@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114b <checkend+0x3b>
movl   $0x1,-0x14(%rbp)
jmp    1152 <checkend+0x42>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkend>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <skipspace@plt>
mov    (%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @checkend(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 (i8**, ...) bitcast (i32 (...)* @skipspace to i32 (i8**, ...)*)(i8** %2)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int __semihost(int, int /*<<< orphan*/ *);
int semihost_powerdown(void) { return __semihost(((0x100) + 4), NULL); }


x86 assembly (clang, -O0):
<semihost_powerdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x104,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__semihost@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_powerdown>:
mov    $0x104,%edi
xor    %esi,%esi
jmp    1030 <__semihost@plt>

LLVM IR (-O0):
define i32 @semihost_powerdown() {
%1 = call i32 @__semihost(i32 260, i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @semihost_powerdown() {
%1 = tail call i32 @__semihost(i32 260, i32* null)
ret i32 %1
}
void GPIOPortP1_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortP1_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortP1_Handler+0x9>
jmp    1109 <GPIOPortP1_Handler+0x9>

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

LLVM IR (-O0):
define void @GPIOPortP1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortP1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void waypoint_list_remove_temp_file(char *temp_filename) {
  char sys_string[128];
  sprintf(sys_string, "rm -f %s", temp_filename);
  system(sys_string);
}


x86 assembly (clang, -O0):
<waypoint_list_remove_temp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waypoint_list_remove_temp_file>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"rm -f %s\00"
define void @waypoint_list_remove_temp_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"rm -f %s\00"
define void @waypoint_list_remove_temp_file(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
int usb_resume_both(struct usb_device *udev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.usb_device = type opaque
define i32 @usb_resume_both(%struct.usb_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void __gnat_close_signalling_fd(int sig) { (void)close(sig); }


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

x86 assembly (clang, -O2):
<__gnat_close_signalling_fd>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @__gnat_close_signalling_fd(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int console_out(int character) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_out(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
scalar_t__ ipify(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char addr[256];
  if (ipify(addr, sizeof(addr)))
    return 1;
  printf("%s\n", addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <ipify@plt>
cmp    $0x0,%rax
je     1159 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1173 <main+0x53>
lea    -0x110(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <ipify@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1149 <main+0x29>
add    $0x108,%rsp
ret
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 @ipify(i8* %2, i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 0, %5 ], [ 1, %0 ]
ret i32 %8
}
void __all_init(void) {}


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

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

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

LLVM IR (-O2):
define void @__all_init() {
ret void
}
int __ii_sum_n(int i1, int i2, int i3) { return i1 + i2 + i3; }


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

x86 assembly (clang, -O2):
<__ii_sum_n>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__ii_sum_n(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 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__ii_sum_n(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void printusage(char **p) {
  fprintf(stderr, "Uso: %s <comando>\n", *p);
  fprintf(
      stderr,
      "\t<comando>         Programa ejecutable y parametros, en su caso.\n");
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printusage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%eax
mov    (%rdi),%rdx
lea    0xedc(%rip),%rsi
mov    %eax,%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedd(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Uso: %s <comando>\0A\00"
@.str.1 = [66 x i8] c"\09<comando> Programa ejecutable y parametros, en su caso.\0A\00"
define void @printusage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Uso: %s <comando>\0A\00"
@.str.1 = [66 x i8] c"\09<comando> Programa ejecutable y parametros, en su caso.\0A\00"
define void @printusage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_44uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x44 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_44uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 68
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printArr(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverseASentence(char *);
int main() {
  char testString[] = "This is a book";
  printf("Before reversing the stirng: \n");
  printArr(testString);
  reverseASentence(testString);
  printf("After reversing the stirng: \n");
  printArr(testString);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    -0xf(%rbp),%rdi
call   1050 <printArr@plt>
lea    -0xf(%rbp),%rdi
call   1030 <reverseASentence@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    -0xf(%rbp),%rdi
call   1050 <printArr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6b6f6f62206120,%rax
mov    %rax,0x7(%rsp)
movabs $0x2073692073696854,%rax
69 73 20
mov    %rax,(%rsp)
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <printArr@plt>
mov    %rbx,%rdi
call   1030 <reverseASentence@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <printArr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.testString = [15 x i8] c"This is a book\00"
@.str = [31 x i8] c"Before reversing the stirng: \0A\00"
@.str.1 = [30 x i8] c"After reversing the stirng: \0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = bitcast [15 x i8]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = call i32 @printArr(i8* %4)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%7 = call i32 @reverseASentence(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%10 = call i32 @printArr(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.testString = [15 x i8] c"This is a book\00"
@str = [30 x i8] c"Before reversing the stirng: \00"
@str.2 = [29 x i8] c"After reversing the stirng: \00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @printArr(i8* %2)
%5 = call i32 @reverseASentence(i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%7 = call i32 @printArr(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeQEI(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x0000000A);
}


x86 assembly (clang, -O0):
<GPIOPinTypeQEI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0xa,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeQEI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0xa,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeQEI(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 10)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int intern_cmp(void *a, void *b) { return strcmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<intern_cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @intern_cmp(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @intern_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void DestroyList() {}


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

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

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

LLVM IR (-O2):
define void @DestroyList() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Inicio\n");
  while (1)
    ;
  printf("Fin!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"Inicio\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [7 x i8] c"Inicio\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *smalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <smalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <smalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @smalloc(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 ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int flip(int input) {
  assert(sizeof(int) == 4);
  unsigned char *bytes = (unsigned char *)&input;
  int c;
  unsigned char temp;
  for (c = 0; c < 2; c++) {
    temp = bytes[c];
    bytes[c] = bytes[3 - c];
    bytes[3 - c] = temp;
  }
  return input;
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    118c <flip+0x7c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <flip+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
bswap  %ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @flip(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %2
%6 = call i32 @assert(i32 1)
%7 = bitcast i32* %2 to i8*
store i8* %7, i8** %3
store i32 0, i32* %4
br label %8
8: ; preds = %33, %1
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 3, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8, i8* %5
%28 = load i8*, i8** %3
%29 = load i32, i32* %4
%30 = sub nsw i32 3, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
store i8 %27, i8* %32
br label %33
33: ; preds = %11
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %8
36: ; preds = %8
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @flip(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %3
}
void Sys_EnterCriticalSection(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @Sys_EnterCriticalSection(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *meta_create_homedir_emergency_filename(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @meta_create_homedir_emergency_filename() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @meta_create_homedir_emergency_filename() {
ret i8* null
}
void planeflip(unsigned char axis1, int pos1, unsigned char axis2, int pos2,
               int delay) {}


x86 assembly (clang, -O0):
<planeflip>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @planeflip(i8 zeroext %0, i32 %1, i8 zeroext %2, i32 %3, i32 %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @planeflip(i8 zeroext %0, i32 %1, i8 zeroext %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void puts(char *s) {
  while (*s != '\0') {
    putchar(*s++);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <puts+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t *event) {
  return little_endian_read_16(event, 13);
}


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

x86 assembly (clang, -O2):
<l2cap_event_channel_opened_get_local_cid>:
mov    $0xd,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @l2cap_event_channel_opened_get_local_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 13)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int is_amd_cpu(char *vendor) {
  return (!strcmp(vendor, "AMDisbetter!") || !strcmp(vendor, "AuthenticAMD"));
}


x86 assembly (clang, -O0):
<is_amd_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <is_amd_cpu+0x47>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%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):
<is_amd_cpu>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113e <is_amd_cpu+0x2e>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"AMDisbetter!\00"
@.str.1 = [13 x i8] c"AuthenticAMD\00"
define i32 @is_amd_cpu(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"AMDisbetter!\00"
@.str.1 = [13 x i8] c"AuthenticAMD\00"
define i32 @is_amd_cpu(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
scalar_t__ vector_size(struct vector *);
int vector_empty(struct vector *vector) { return (vector_size(vector) == 0); }


x86 assembly (clang, -O0):
<vector_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vector_size@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_empty>:
push   %rax
call   1030 <vector_size@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.vector = type { i32 }
define i32 @vector_empty(%struct.vector* %0) {
%2 = alloca %struct.vector*
store %struct.vector* %0, %struct.vector** %2
%3 = load %struct.vector*, %struct.vector** %2
%4 = call i64 @vector_size(%struct.vector* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define i32 @vector_empty(%struct.vector* %0) {
%2 = tail call i64 @vector_size(%struct.vector* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, scalar_t__ *);
int64_t sum_from_fileptr(FILE *fp) {
  int64_t sum = 0;
  while (!feof(fp)) {
    int64_t current;
    fscanf(fp, "%lld ", &current);
    sum += current;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_from_fileptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1152 <sum_from_fileptr+0x32>
jmp    1177 <sum_from_fileptr+0x57>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <sum_from_fileptr+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_from_fileptr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <feof@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    115e <sum_from_fileptr+0x3e>
lea    0xec3(%rip),%r15
mov    %rsp,%r12
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <fscanf@plt>
add    (%rsp),%rbx
mov    %r14,%rdi
call   1040 <feof@plt>
test   %eax,%eax
je     1140 <sum_from_fileptr+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld \00"
define i64 @sum_from_fileptr(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %3
br label %5
5: ; preds = %10, %1
%6 = load i32*, i32** %2
%7 = call i32 @feof(i32* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i32*, i32** %2
%12 = call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %4)
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = add nsw i64 %14, %13
store i64 %15, i64* %3
br label %5
16: ; preds = %5
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld \00"
define i64 @sum_from_fileptr(i32* nocapture %0) {
%2 = alloca i64
%3 = call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = bitcast i64* %2 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %2)
%10 = load i64, i64* %2
%11 = add nsw i64 %10, %8
%12 = call i32 @feof(i32* %0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %1
%15 = phi i64 [ 0, %1 ], [ %11, %7 ]
ret i64 %15
}
unsigned int f58(unsigned int x, long int y) {
  return (x << ((-y) & (8 * sizeof(unsigned int) - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f58>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f58>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f58(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 0, %6
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
%10 = shl i32 %5, %9
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = lshr i32 %11, %13
%15 = xor i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f58(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 0, %3
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = lshr i32 %0, %3
%8 = xor i32 %6, %7
ret i32 %8
}
int inchk(struct k_data *k) { return (-1); }


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

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

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

LLVM IR (-O2):
%struct.k_data = type opaque
define i32 @inchk(%struct.k_data* nocapture readnone %0) {
ret i32 -1
}