xunge/DecIR huggingface dataset:
void init_debugger(void) {}


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

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

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

LLVM IR (-O2):
define void @init_debugger() {
ret void
}
unsigned addval_269(unsigned x) { return x + 3232027017U; }


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

x86 assembly (clang, -O2):
<addval_269>:
lea    -0x3f5b2e77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_269(i32 %0) {
%2 = add i32 %0, -1062940279
ret i32 %2
}
/* Variables and functions */
scalar_t__ unknown();
int test8() { (void)(1 + unknown()); }


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

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

LLVM IR (-O0):
define i32 @test8() {
%1 = alloca i32
%2 = call i64 (...) @unknown()
%3 = add nsw i64 1, %2
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @test8() {
%1 = tail call i64 (...) @unknown()
ret i32 undef
}
int test_imm_BFuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xBF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BFuint64_lowword_reg>:
test   $0xbf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BFuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 191
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float mult_a_(float *a) { return (*a) * 10.; }


x86 assembly (clang, -O0):
<mult_a_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_a_>:
movss  (%rdi),%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @mult_a_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fmul double %5, 1.000000e+01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @mult_a_(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, 1.000000e+01
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ my_putw(unsigned long, int /*<<< orphan*/ *);
void putcdw(unsigned long x, FILE *f) {
  if (x > 32767L) {
    my_putw((unsigned int)(x << 1) + 1, f);
    my_putw(x >> 15, f);
  } else {
    my_putw(x << 1, f);
  }
}


x86 assembly (clang, -O0):
<putcdw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x7fff,-0x8(%rbp)
jbe    115c <putcdw+0x4c>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <my_putw@plt>
mov    -0x8(%rbp),%rdi
shr    $0xf,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <my_putw@plt>
jmp    116d <putcdw+0x5d>
mov    -0x8(%rbp),%rdi
shl    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <my_putw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcdw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    %rdi,%rdi
cmp    $0x8000,%rbx
jb     1138 <putcdw+0x28>
or     $0x1,%edi
mov    %r14,%rsi
call   1030 <my_putw@plt>
shr    $0xf,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <my_putw@plt>

LLVM IR (-O0):
define void @putcdw(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 32767
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i64, i64* %3
%9 = shl i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = add i32 %10, 1
%12 = zext i32 %11 to i64
%13 = load i32*, i32** %4
%14 = call i32 @my_putw(i64 %12, i32* %13)
%15 = load i64, i64* %3
%16 = lshr i64 %15, 15
%17 = load i32*, i32** %4
%18 = call i32 @my_putw(i64 %16, i32* %17)
br label %24
19: ; preds = %2
%20 = load i64, i64* %3
%21 = shl i64 %20, 1
%22 = load i32*, i32** %4
%23 = call i32 @my_putw(i64 %21, i32* %22)
br label %24
24: ; preds = %19, %7
ret void
}

LLVM IR (-O2):
define void @putcdw(i64 %0, i32* %1) {
%3 = icmp ugt i64 %0, 32767
%4 = shl i64 %0, 1
br i1 %3, label %5, label %10
5: ; preds = %2
%6 = and i64 %4, 4294967294
%7 = or i64 %6, 1
%8 = tail call i32 @my_putw(i64 %7, i32* %1)
%9 = lshr i64 %0, 15
br label %10
10: ; preds = %2, %5
%11 = phi i64 [ %9, %5 ], [ %4, %2 ]
%12 = tail call i32 @my_putw(i64 %11, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help01(void) {
  cPrintf("  +  <num1> <num2>  add and subtract <num1> and <num2>\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c" + <num1> <num2> add and subtract <num1> and <num2>\0A\00"
define void @help01() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c" + <num1> <num2> add and subtract <num1> and <num2>\0A\00"
define void @help01() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
void doubleToString(char s[], double num) { sprintf(s, "%lf", num); }


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

x86 assembly (clang, -O2):
<doubleToString>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @doubleToString(i8* nocapture writeonly %0, double %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *gdp_files_open(char *FileName) {
  FILE *fRet = fopen(FileName, "r");
  if (fRet == NULL) {
    return NULL;
  }
  return fRet;
}


x86 assembly (clang, -O0):
<gdp_files_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <gdp_files_open+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1150 <gdp_files_open+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @gdp_files_open(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcslen(const wchar_t *scan) {
  const wchar_t *start = scan + 1;
  if (!scan)
    return 0;
  while (*scan++ != '\0')
    continue;
  return (size_t)(scan - start);
}


x86 assembly (clang, -O0):
<wcslen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <wcslen+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1161 <wcslen+0x61>
jmp    1131 <wcslen+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
je     114e <wcslen+0x4e>
jmp    1131 <wcslen+0x31>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcslen>:
test   %rdi,%rdi
je     1120 <wcslen+0x20>
mov    $0xfffffffffffffffc,%rax
nopl   0x0(%rax)
cmpl   $0x0,0x4(%rdi,%rax,1)
lea    0x4(%rax),%rax
jne    1110 <wcslen+0x10>
sar    $0x2,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @wcslen(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = icmp eq i32* %0, null
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i32* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = ptrtoint i32* %6 to i64
%11 = ptrtoint i32* %2 to i64
%12 = sub i64 %10, %11
%13 = ashr exact i64 %12, 2
br label %14
14: ; preds = %1, %9
%15 = phi i64 [ %13, %9 ], [ 0, %1 ]
ret i64 %15
}
adr0regx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*((unsigned int *)10000000)) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     113c <adr0regx1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <adr0regx1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0regx1>:
mov    0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adr0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = icmp ule i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
funcs() {
  if (_Generic((0, funcs), int (*)() : 0, char (*)() : 1) != 0) {
    _Noreturn void abort();
    abort();
  }
}


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

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

LLVM IR (-O0):
define i32 @funcs() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @funcs() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_clearsilver_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("clearsilver", " #comment"),
                            "comment", "#comment");
}


x86 assembly (clang, -O0):
<test_clearsilver_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xece(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_clearsilver_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed3(%rip),%rsi
lea    0xecb(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"clearsilver\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_clearsilver_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"clearsilver\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_clearsilver_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lol() { printf("lol\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"lol\00"
define void @lol() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ea_mode(int);
int ea_valid(int opcode) { return (ea_mode(opcode) >= 0); }


x86 assembly (clang, -O0):
<ea_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ea_mode@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ea_valid>:
push   %rax
call   1030 <ea_mode@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ea_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ea_mode(i32 %3)
%5 = icmp sge i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ea_valid(i32 %0) {
%2 = tail call i64 @ea_mode(i32 %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, 1
ret i32 %5
}
void unlockSPI() {}


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

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

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

LLVM IR (-O2):
define void @unlockSPI() {
ret void
}
double umrechnung_us_gal_in_l(double us_gallone) {
  const double umrechnungsfaktor = 3.785411784;
  double liter = us_gallone * umrechnungsfaktor;
  return liter;
}


x86 assembly (clang, -O0):
<umrechnung_us_gal_in_l>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<umrechnung_us_gal_in_l>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @umrechnung_us_gal_in_l(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x400E4885F9316256, double* %3
%5 = load double, double* %2
%6 = fmul double %5, 0x400E4885F9316256
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @umrechnung_us_gal_in_l(double %0) {
%2 = fmul double %0, 0x400E4885F9316256
ret double %2
}
void gtk_cell_renderer_toggle_set_radio() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_toggle_set_radio() {
ret void
}
zdelet(name) char *name;
{ unlink(name); }


x86 assembly (clang, -O0):
<zdelet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @zdelet(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @zdelet(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int __builtin_ffs(int /*<<< orphan*/);
int tlsf_ffs(uint32_t word) { return __builtin_ffs(word) - 1; }


x86 assembly (clang, -O0):
<tlsf_ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tlsf_ffs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @tlsf_ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Type definitions */
struct instance_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IRC_SendRawEx(struct instance_data const *, char *,
                                 char const *);
void IRC_OnServerPing(const struct instance_data *pID, const char *szMessage) {
  IRC_SendRawEx(pID, "PONG %s", szMessage);
}


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

x86 assembly (clang, -O2):
<IRC_OnServerPing>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <IRC_SendRawEx@plt>

LLVM IR (-O0):
%struct.instance_data = type { i32 }
@.str = [8 x i8] c"PONG %s\00"
define void @IRC_OnServerPing(%struct.instance_data* %0, i8* %1) {
%3 = alloca %struct.instance_data*
%4 = alloca i8*
store %struct.instance_data* %0, %struct.instance_data** %3
store i8* %1, i8** %4
%5 = load %struct.instance_data*, %struct.instance_data** %3
%6 = load i8*, i8** %4
%7 = call i32 @IRC_SendRawEx(%struct.instance_data* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.instance_data = type { i32 }
@.str = [8 x i8] c"PONG %s\00"
define void @IRC_OnServerPing(%struct.instance_data* %0, i8* %1) {
%3 = tail call i32 @IRC_SendRawEx(%struct.instance_data* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logsys_s1_print();
int /*<<< orphan*/ logsys_s2_print();
int main(void) {
  logsys_s1_print();
  logsys_s2_print();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <logsys_s1_print@plt>
mov    $0x0,%al
call   1040 <logsys_s2_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <logsys_s1_print@plt>
xor    %eax,%eax
call   1040 <logsys_s2_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @logsys_s1_print()
%3 = call i32 (...) @logsys_s2_print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @logsys_s1_print()
%2 = tail call i32 (...) @logsys_s2_print()
ret i32 0
}
char *get_current_task_name() { return "?"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @get_current_task_name() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
int bitInvertDestinationwith(int sourceWord, int destinationWord) {
  return ~destinationWord;
}


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

x86 assembly (clang, -O2):
<bitInvertDestinationwith>:
mov    %esi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @bitInvertDestinationwith(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
ret i32 %3
}
void TIM7_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM7_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void ol_logger(const char *msg) { printf(msg); }


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

x86 assembly (clang, -O2):
<ol_logger>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @ol_logger(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
unsigned long int to_long_int_convertor1(unsigned char array[]) {
  unsigned int n;
  n = array[0] << 16;
  n |= array[1] << 8;
  n |= array[2];
  return n;
}


x86 assembly (clang, -O0):
<to_long_int_convertor1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_long_int_convertor1>:
movzbl (%rdi),%eax
shl    $0x10,%rax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x2(%rdi),%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @to_long_int_convertor1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 16
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = zext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @to_long_int_convertor1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 8
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = or i64 %9, %12
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEaload(int, int /*<<< orphan*/ *);
void code_aload(int arg) { appendCODE(makeCODEaload(arg, NULL)); }


x86 assembly (clang, -O0):
<code_aload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <makeCODEaload@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_aload>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEaload@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_aload(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEaload(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_aload(i32 %0) {
%2 = tail call i32 @makeCODEaload(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *CheckMalloc(size_t n) {
  void *r = malloc(n);
  if (!r) {
    printf("out of memory!\n");
    exit(-1);
  }
  return r;
}


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

x86 assembly (clang, -O2):
<CheckMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <CheckMalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"out of memory!\0A\00"
define i8* @CheckMalloc(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 %11, label %8
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [15 x i8] c"out of memory!\00"
define noalias i8* @CheckMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
int fun1055() { return 1055; }


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

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

LLVM IR (-O0):
define i32 @fun1055() {
ret i32 1055
}

LLVM IR (-O2):
define i32 @fun1055() {
ret i32 1055
}
/* Variables and functions */
double pow(double, double);
double f(double x) { return (pow(x, 3.0)) - (pow(x, 2.0)) - (3.0 * x) + 1.8; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x10(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm1
call   1030 <pow@plt>
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xed0(%rip),%xmm2
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 3.000000e+00)
%5 = load double, double* %2
%6 = call double @pow(double %5, double 2.000000e+00)
%7 = fsub double %4, %6
%8 = load double, double* %2
%9 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %8, double %7)
%10 = fadd double %9, 1.800000e+00
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @pow(double %0, double 3.000000e+00)
%3 = fmul double %0, %0
%4 = fsub double %2, %3
%5 = tail call double @llvm.fmuladd.f64(double %0, double -3.000000e+00, double %4)
%6 = fadd double %5, 1.800000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, int);
void process_msg(int s) {
  printf("s = %d\n", s);
  close(s);
}


x86 assembly (clang, -O0):
<process_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_msg>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"s = %d\0A\00"
define void @process_msg(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @close(i32 %0)
ret void
}
void uninit0() {
  int *array = malloc(5 * sizeof(int));
  if (array[2] > 0) {
    printf("hi\n");
  }
  int x;
  if (x > 0) {
    printf("hello is: %d\n", &x);
  }
  int y = 5;
  if (y > 0) {
    printf("hello\n");
  }
  free(array);
}


x86 assembly (clang, -O0):
<uninit0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jle    1162 <uninit0+0x32>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    117e <uninit0+0x4e>
lea    0xe91(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    119d <uninit0+0x6d>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"hi\0A\00"
@.str.1 = [14 x i8] c"hello is: %d\0A\00"
@.str.2 = [7 x i8] c"hello\0A\00"
define void @uninit0() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = call i8* @malloc(i64 20)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %17
17: ; preds = %15, %12
store i32 5, i32* %3
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = load i32*, i32** %1
%24 = bitcast i32* %23 to i8*
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @uninit0() {
%1 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int w_y(int y) { return y; }


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

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

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

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

/* Variables and functions */
int thrd_success;
int cnd_init(cnd_t *cond) { return thrd_success; }


x86 assembly (clang, -O0):
<cnd_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@thrd_success = global i32 0
define i32 @cnd_init(i32* nocapture readnone %0) {
%2 = load i32, i32* @thrd_success
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
unsigned digits_squares_sum(uint64_t num) {
  unsigned result = 0;
  while (num) {
    unsigned digit = (unsigned)(num % 10);
    result += digit * digit;
    num /= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<digits_squares_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <digits_squares_sum+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <digits_squares_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_squares_sum>:
xor    %eax,%eax
test   %edi,%edi
je     113e <digits_squares_sum+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <digits_squares_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @digits_squares_sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %6, %6
%8 = add i32 %7, %5
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int abs(int);
int rand();
int randInI(int min, int max) { return min + (rand() % abs(max - min)); }


x86 assembly (clang, -O0):
<randInI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randInI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
mov    %ebx,%ecx
neg    %ecx
cmovs  %ebx,%ecx
cltd
idiv   %ecx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randInI(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = call i32 @abs(i32 %9)
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randInI(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ vs_write_data(unsigned char *, int);
int audio_play_l(unsigned char *data, int len) {
  if (len <= 0)
    return 0;
  vs_write_data(data, len);
  return 1;
}


x86 assembly (clang, -O0):
<audio_play_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1135 <audio_play_l+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1148 <audio_play_l+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <vs_write_data@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_play_l>:
test   %esi,%esi
jle    1124 <audio_play_l+0x14>
push   %rax
call   1030 <vs_write_data@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @audio_play_l(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @vs_write_data(i8* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
long gs_shell(long display) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @gs_shell(i64 %0) {
ret i64 0
}
void ASN1_IA5STRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_IA5STRING_free() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int x54x_inl(int, void *);
uint32_t x54x_readl(uint32_t port, void *priv) {
  return (x54x_inl(port & 3, priv));
}


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

x86 assembly (clang, -O2):
<x54x_readl>:
and    $0x3,%edi
jmp    1030 <x54x_inl@plt>

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

LLVM IR (-O2):
define i32 @x54x_readl(i32 %0, i8* %1) {
%3 = and i32 %0, 3
%4 = tail call i32 @x54x_inl(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ kexit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int do_exit() {
  char exitval[64];
  printf("Exit value? ");
  gets(exitval);
  kexit(atoi(exitval));
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x50(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <kexit@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exit>:
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <kexit@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Exit value? \00"
define i32 @do_exit() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%7 = call i32 @atoi(i8* %6)
%8 = call i32 @kexit(i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"Exit value? \00"
define i32 @do_exit() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @atoi(i8* %2)
%6 = call i32 @kexit(i32 %5)
ret i32 undef
}
void ble_rsp_attclient_read_by_group_type(
    const struct ble_msg_attclient_read_by_group_type_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_read_by_group_type_rsp_t = type opaque
define void @ble_rsp_attclient_read_by_group_type(%struct.ble_msg_attclient_read_by_group_type_rsp_t* nocapture %0) {
ret void
}
int __attribute__((nomips16)) f4(unsigned long long y) {
  return (int)((int)(y >> 33) + 1);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x21,%rax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
shr    $0x21,%rdi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 33
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @f4(i64 %0) {
%2 = lshr i64 %0, 33
%3 = trunc i64 %2 to i32
%4 = add nuw nsw i32 %3, 1
ret i32 %4
}
void parallel_for_0(void) {
#pragma omp parallel
  {
#pragma omp for
    for (int i = 0; i < 100; ++i) {
    }
  }
}


x86 assembly (clang, -O0):
<parallel_for_0>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <parallel_for_0+0x28>
jmp    111a <parallel_for_0+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <parallel_for_0+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @parallel_for_0() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

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