xunge/DecIR huggingface dataset:
/* Variables and functions */
void *getdata();
int /*<<< orphan*/ set_nomem();
void *getdata_or_set_error(void) {
  void *result;
  result = getdata();
  if (!result)
    set_nomem();
  return result;
}


x86 assembly (clang, -O0):
<getdata_or_set_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getdata@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <getdata_or_set_error+0x25>
mov    $0x0,%al
call   1040 <set_nomem@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdata_or_set_error>:
push   %rbx
xor    %eax,%eax
call   1030 <getdata@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1137 <getdata_or_set_error+0x17>
xor    %eax,%eax
call   1040 <set_nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getdata_or_set_error() {
%1 = alloca i8*
%2 = call i8* (...) @getdata()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @set_nomem()
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define i8* @getdata_or_set_error() {
%1 = tail call i8* (...) @getdata()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @set_nomem()
br label %5
5: ; preds = %3, %0
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_indent(unsigned int indent) {
  while (indent--)
    fputs("\t", stdout);
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1149 <print_indent+0x39>
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
jmp    111b <print_indent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1140 <print_indent+0x30>
mov    %edi,%ebx
mov    0x2ebe(%rip),%r15
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@stdout = global i32 0
define void @print_indent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i32 %5, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
float BalanceHeuristic(int nf, float fPdf, int ng, float gPdf) {
  return (nf * fPdf) / (nf * fPdf + ng * gPdf);
}


x86 assembly (clang, -O0):
<BalanceHeuristic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
cvtsi2ssl -0xc(%rbp),%xmm2
mulss  -0x10(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BalanceHeuristic>:
cvtsi2ss %edi,%xmm2
cvtsi2ss %esi,%xmm3
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm3
addss  %xmm0,%xmm3
divss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @BalanceHeuristic(i32 %0, float %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %5
store float %1, float* %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to float
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to float
%15 = load float, float* %6
%16 = load i32, i32* %7
%17 = sitofp i32 %16 to float
%18 = load float, float* %8
%19 = fmul float %17, %18
%20 = call float @llvm.fmuladd.f32(float %14, float %15, float %19)
%21 = fdiv float %12, %20
ret float %21
}

LLVM IR (-O2):
define float @BalanceHeuristic(i32 %0, float %1, i32 %2, float %3) {
%5 = sitofp i32 %0 to float
%6 = fmul float %5, %1
%7 = sitofp i32 %2 to float
%8 = fmul float %7, %3
%9 = tail call float @llvm.fmuladd.f32(float %5, float %1, float %8)
%10 = fdiv float %6, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
void ui_uninit(void) {
  erase();
  endwin();
}


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

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

LLVM IR (-O0):
define void @ui_uninit() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @ui_uninit() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x66() {
  Assert_real((iscntrl(102) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              515, ("iscntrl should be 0 for f"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x203,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x203,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for f\00"
define void @t_iscntrl_0x66() {
%1 = call i64 @iscntrl(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for f\00"
define void @t_iscntrl_0x66() {
%1 = tail call i64 @iscntrl(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ advance(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
double energy();
int /*<<< orphan*/ offset_momentum();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  offset_momentum();
  printf("%.9f\n", energy());
  advance(atoi(argv[1]));
  printf("%.9f\n", energy());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <offset_momentum@plt>
mov    $0x0,%al
call   1040 <energy@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1050 <advance@plt>
mov    $0x0,%al
call   1040 <energy@plt>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1060 <offset_momentum@plt>
xor    %eax,%eax
call   1040 <energy@plt>
lea    0xe94(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1050 <advance@plt>
xor    %eax,%eax
call   1040 <energy@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.9f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @offset_momentum()
%7 = call double (...) @energy()
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = call i32 @advance(i32 %12)
%14 = call double (...) @energy()
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.9f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @offset_momentum()
%4 = tail call double (...) @energy()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @advance(i32 %8)
%10 = tail call double (...) @energy()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}
int get_depth_change(const char *src) {
  char c;
  int depthChange = 0;
  while (c = *src++) {
    if (c == '{')
      depthChange++;
    if (c == '}')
      depthChange--;
  }
  return depthChange;
}


x86 assembly (clang, -O0):
<get_depth_change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     115c <get_depth_change+0x5c>
movsbl -0x9(%rbp),%eax
cmp    $0x7b,%eax
jne    1141 <get_depth_change+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x7d,%eax
jne    1157 <get_depth_change+0x57>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <get_depth_change+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_depth_change>:
xor    %eax,%eax
jmp    1121 <get_depth_change+0x21>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
xor    %edx,%edx
cmp    $0x7d,%cl
sete   %dl
sub    %edx,%eax
movzbl (%rdi),%ecx
cmp    $0x7b,%cl
je     1110 <get_depth_change+0x10>
test   %cl,%cl
jne    1113 <get_depth_change+0x13>
ret

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

LLVM IR (-O2):
define i32 @get_depth_change(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i8* [ %0, %1 ], [ %5, %9 ]
%4 = phi i32 [ 0, %1 ], [ %13, %9 ]
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = load i8, i8* %3
switch i8 %6, label %9 [
i8 0, label %14
i8 123, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = icmp eq i8 %6, 125
%12 = sext i1 %11 to i32
%13 = add nsw i32 %10, %12
br label %2
14: ; preds = %2
ret i32 %4
}
/* Type definitions */
struct _stor_fclose_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fclose_rsp *);
void stor_fclose_rsp_free(struct _stor_fclose_rsp *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fclose_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._stor_fclose_rsp = type { i32 }
define void @stor_fclose_rsp_free(%struct._stor_fclose_rsp* %0) {
%2 = alloca %struct._stor_fclose_rsp*
store %struct._stor_fclose_rsp* %0, %struct._stor_fclose_rsp** %2
%3 = load %struct._stor_fclose_rsp*, %struct._stor_fclose_rsp** %2
%4 = call i32 @osapi_free(%struct._stor_fclose_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_fclose_rsp = type { i32 }
define void @stor_fclose_rsp_free(%struct._stor_fclose_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fclose_rsp* %0)
ret void
}
/* Variables and functions */
float floorf(float);
float ceilf(float x) {
  float y;
  y = floorf((float)x);
  if (y < x)
    y += 1.0;
  return (y);
}


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    115d <ceilf+0x4d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0xedc(%rip),%xmm2
addss  %xmm0,%xmm2
movaps %xmm0,%xmm1
cmpltss 0x4(%rsp),%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @llvm.floor.f32(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %2
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fadd double %11, 1.000000e+00
%13 = fptrunc double %12 to float
store float %13, float* %3
br label %14
14: ; preds = %9, %1
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
%3 = fcmp olt float %2, %0
%4 = fadd float %2, 1.000000e+00
%5 = select i1 %3, float %4, float %2
ret float %5
}
/* Variables and functions */
char *ltoca(long);
int /*<<< orphan*/ terminal_writestring(char *);
void kpl(long n) {
  char *p = ltoca(n);
  terminal_writestring(p);
}


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

x86 assembly (clang, -O2):
<kpl>:
push   %rax
call   1040 <ltoca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <terminal_writestring@plt>

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

LLVM IR (-O2):
define void @kpl(i64 %0) {
%2 = tail call i8* @ltoca(i64 %0)
%3 = tail call i32 @terminal_writestring(i8* %2)
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};

/* Variables and functions */
int IFA_MAX;
int rtattr_assign(struct rtattr *attr, int type, void *data) {
  struct rtattr **tb = data;
  if (type >= IFA_MAX)
    return 0;
  tb[type] = attr;
  return 0;
}


x86 assembly (clang, -O0):
<rtattr_assign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
jl     1135 <rtattr_assign+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <rtattr_assign+0x4c>
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtattr_assign>:
mov    0x2ee1(%rip),%rax
cmp    %esi,(%rax)
jle    1112 <rtattr_assign+0x12>
movslq %esi,%rax
mov    %rdi,(%rdx,%rax,8)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.rtattr = type { i32 }
@IFA_MAX = global i32 0
define i32 @rtattr_assign(%struct.rtattr* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.rtattr*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.rtattr**
store %struct.rtattr* %0, %struct.rtattr** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = bitcast i8* %9 to %struct.rtattr**
store %struct.rtattr** %10, %struct.rtattr*** %8
%11 = load i32, i32* %6
%12 = load i32, i32* @IFA_MAX
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %21
15: ; preds = %3
%16 = load %struct.rtattr*, %struct.rtattr** %5
%17 = load %struct.rtattr**, %struct.rtattr*** %8
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds %struct.rtattr*, %struct.rtattr** %17, i64 %19
store %struct.rtattr* %16, %struct.rtattr** %20
store i32 0, i32* %4
br label %21
21: ; preds = %15, %14
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
@IFA_MAX = global i32 0
define i32 @rtattr_assign(%struct.rtattr* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = load i32, i32* @IFA_MAX
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = bitcast i8* %2 to %struct.rtattr**
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds %struct.rtattr*, %struct.rtattr** %7, i64 %8
store %struct.rtattr* %0, %struct.rtattr** %9
br label %10
10: ; preds = %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ go_south_east(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int latitude = 32;
  int longitude = -64;
  go_south_east(&latitude, &longitude);
  printf("Avast! Now at: [%i, %i]\n", latitude, longitude);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x20,-0x4(%rbp)
movl   $0xffffffc0,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <go_south_east@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x20,0x4(%rsp)
movl   $0xffffffc0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <go_south_east@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Avast! Now at: [%i, %i]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 32, i32* %1
store i32 -64, i32* %2
%3 = call i32 @go_south_east(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Avast! Now at: [%i, %i]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 32, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 -64, i32* %2
%5 = call i32 @go_south_east(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
void av_bprint_channel_layout() {}


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

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

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

LLVM IR (-O2):
define void @av_bprint_channel_layout() {
ret void
}
int ffs(int n) {
  int i;
  for (i = 0; n; n >>= 1, i++)
    ;
  return (i - 1);
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <ffs+0x34>
jmp    111d <ffs+0x1d>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ffs+0xe>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <ffs+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ffs+0x10>
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %4, %3 ]
ret i32 %10
}
unsigned xrop3_188_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_188_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_188_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_188_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_188_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ calculate_permutation(int *);
int /*<<< orphan*/ next(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print(int *);
int /*<<< orphan*/ printf(char *);
int main() {
  int iterations[10];
  next(iterations, 0, 9);
  calculate_permutation(iterations);
  printf("The millionth lex permutation of 0-9 is ");
  print(iterations);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1060 <next@plt>
lea    -0x30(%rbp),%rdi
call   1030 <calculate_permutation@plt>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <print@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <next@plt>
mov    %rbx,%rdi
call   1040 <calculate_permutation@plt>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"The millionth lex permutation of 0-9 is \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = call i32 @next(i32* %3, i32 0, i32 9)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @calculate_permutation(i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @print(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"The millionth lex permutation of 0-9 is \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @next(i32* %3, i32 0, i32 9)
%5 = call i32 @calculate_permutation(i32* %3)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @print(i32* %3)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
double log(double x __attribute__((unused))) { return 0.0; }


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

x86 assembly (clang, -O2):
<log>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @log(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @log(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int u_strnlen(char *, int);
int u_strlen(char *s) {
  int n = 0;
  while (*(s + n))
    ++n;
  return u_strnlen(s, n);
}


x86 assembly (clang, -O0):
<u_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <u_strlen+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <u_strlen+0x13>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <u_strnlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_strlen>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <u_strlen+0x10>
add    $0xffffffff,%esi
jmp    1030 <u_strnlen@plt>

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

LLVM IR (-O2):
define i32 @u_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @u_strnlen(i8* %0, i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq0(unsigned char *, long long);
void vt100_RCP(void) { vt100_EscSeq0((unsigned char *)"u", (long long)2); }


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

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <vt100_EscSeq0@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"u\00"
define void @vt100_RCP() {
%1 = tail call i32 @vt100_EscSeq0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("3.1415926535897932384626433832795\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"3.1415926535897932384626433832795\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"3.1415926535897932384626433832795\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void IRC_OnChannelBan(const struct instance_data *pID,
                      const struct userinfo *pUI, const char *szChannel,
                      const char *szHostmask) {}


x86 assembly (clang, -O0):
<IRC_OnChannelBan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelBan(%struct.instance_data* %0, %struct.userinfo* %1, i8* %2, i8* %3) {
%5 = alloca %struct.instance_data*
%6 = alloca %struct.userinfo*
%7 = alloca i8*
%8 = alloca i8*
store %struct.instance_data* %0, %struct.instance_data** %5
store %struct.userinfo* %1, %struct.userinfo** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.instance_data = type opaque
%struct.userinfo = type opaque
define void @IRC_OnChannelBan(%struct.instance_data* nocapture %0, %struct.userinfo* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setup_signals(struct sigaction *, int);
int /*<<< orphan*/ usleep(int);
void setup_server_signals(struct sigaction *signal_action) {
  setup_signals(signal_action, 0x1 | 0x0);
  usleep(1000);
}


x86 assembly (clang, -O0):
<setup_server_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <setup_signals@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_server_signals>:
push   %rax
mov    $0x1,%esi
call   1030 <setup_signals@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define void @setup_server_signals(%struct.sigaction* %0) {
%2 = alloca %struct.sigaction*
store %struct.sigaction* %0, %struct.sigaction** %2
%3 = load %struct.sigaction*, %struct.sigaction** %2
%4 = call i32 @setup_signals(%struct.sigaction* %3, i32 1)
%5 = call i32 @usleep(i32 1000)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define void @setup_server_signals(%struct.sigaction* %0) {
%2 = tail call i32 @setup_signals(%struct.sigaction* %0, i32 1)
%3 = tail call i32 @usleep(i32 1000)
ret void
}
extern unsigned unsigned_modulo(unsigned a, unsigned b) {
  if (!b)
    return a;
  return a % b;
}


x86 assembly (clang, -O0):
<unsigned_modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <unsigned_modulo+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <unsigned_modulo+0x2a>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_modulo>:
mov    %edi,%eax
test   %esi,%esi
je     110c <unsigned_modulo+0xc>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @unsigned_modulo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = urem i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(unsigned char);
void print_crit_hex8(unsigned char value) { __console_tx_hex8(value); }


x86 assembly (clang, -O0):
<print_crit_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_crit_hex8>:
jmp    1030 <__console_tx_hex8@plt>

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

LLVM IR (-O2):
define void @print_crit_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int htonl(int);
int sha1_write(int /*<<< orphan*/ *, int, int *, int);
int sha1_write_int(SHA_CTX *ctx, int fd, int val) {
  val = htonl(val);
  return sha1_write(ctx, fd, &val, sizeof val);
}


x86 assembly (clang, -O0):
<sha1_write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <sha1_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_write_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%edi
call   1040 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%ecx
call   1030 <sha1_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sha1_write_int(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* %6
%8 = call i32 @htonl(i32 %7)
store i32 %8, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 @sha1_write(i32* %9, i32 %10, i32* %6, i32 4)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sha1_write_int(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = tail call i32 @htonl(i32 %2)
store i32 %5, i32* %4
%6 = call i32 @sha1_write(i32* %0, i32 %1, i32* %4, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ writeMonthlyClimate2(char *);
void C_writeMonthlyClimate2_R(char **siteDir) {
  writeMonthlyClimate2(*siteDir);
}


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

x86 assembly (clang, -O2):
<C_writeMonthlyClimate2_R>:
mov    (%rdi),%rdi
jmp    1030 <writeMonthlyClimate2@plt>

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

LLVM IR (-O2):
define void @C_writeMonthlyClimate2_R(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @writeMonthlyClimate2(i8* %2)
ret void
}
__attribute__((always_)) void __DSB(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @__DSB() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int prog_start(int a) { return a + 0; }


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

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

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

LLVM IR (-O2):
define i32 @prog_start(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ scuGatePeripheralClock(int);
unsigned int wdtDisable(void) {
  (*((volatile unsigned int *const)(0x40020000 + 0x04))) = 0;
  scuGatePeripheralClock((1 << 9));
  if ((*((volatile unsigned int *const)((0x40010000 + 0) + 0x3c))) & (1 << 0)) {
    (*((volatile unsigned int *const)((0x40010000 + 0) + 0x3c))) ^= (1 << 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<wdtDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40020004,%eax
movl   $0x0,(%rax)
mov    $0x200,%edi
call   1030 <scuGatePeripheralClock@plt>
mov    $0x4001003c,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114d <wdtDisable+0x3d>
mov    $0x4001003c,%eax
mov    (%rax),%ecx
xor    $0x1,%ecx
mov    $0x4001003c,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdtDisable>:
push   %rax
movl   $0x0,0x40020004
mov    $0x200,%edi
call   1030 <scuGatePeripheralClock@plt>
testl  $0x1,0x4001003c
je     113b <wdtDisable+0x2b>
xorl   $0x1,0x4001003c
01
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wdtDisable() {
store volatile i32 0, i32* inttoptr (i64 1073872900 to i32*)
%1 = call i32 @scuGatePeripheralClock(i32 512)
%2 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%7 = xor i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 1073807420 to i32*)
br label %8
8: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @wdtDisable() {
store volatile i32 0, i32* inttoptr (i64 1073872900 to i32*)
%1 = tail call i32 @scuGatePeripheralClock(i32 512)
%2 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%7 = xor i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 1073807420 to i32*)
br label %8
8: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkwrite(void *, unsigned short, unsigned char, unsigned char *, int);
signed int fc8180_spib_longwrite(void *handle, unsigned short addr,
                                 unsigned int data) {
  signed int res;
  unsigned char command = 0x00 | 0x80;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkwrite(handle, addr, command, (unsigned char *)&data, 4);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8180_spib_longwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0x80,-0x15(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x15(%rbp),%al
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
movzwl %dx,%esi
movzbl %al,%edx
call   1040 <spi_bulkwrite@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8180_spib_longwrite>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x80,%edx
mov    $0x4,%r8d
call   1040 <spi_bulkwrite@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8180_spib_longwrite(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
store i8 -128, i8* %8
%9 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = load i8, i8* %8
%13 = bitcast i32* %6 to i8*
%14 = call i32 @spi_bulkwrite(i8* %10, i16 zeroext %11, i8 zeroext %12, i8* %13, i32 4)
store i32 %14, i32* %7
%15 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @fc8180_spib_longwrite(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%6 = bitcast i32* %4 to i8*
%7 = call i32 @spi_bulkwrite(i8* %0, i16 zeroext %1, i8 zeroext -128, i8* %6, i32 4)
%8 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %7
}
int ft_strstrlen(char **str) {
  int len;
  len = 0;
  while (str[len] != 0)
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_strstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <ft_strstrlen+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strstrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <ft_strstrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strstrlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ FadeToGrayScale(int /*<<< orphan*/, int);
void FadeToBlack(int frames) { FadeToGrayScale(0, frames); }


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

x86 assembly (clang, -O2):
<FadeToBlack>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <FadeToGrayScale@plt>

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

LLVM IR (-O2):
define void @FadeToBlack(i32 %0) {
%2 = tail call i32 @FadeToGrayScale(i32 0, i32 %0)
ret void
}