xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ MCP4461_SetValue(int, int, char);
void setCaddyStepperCurrent(char current) {
  MCP4461_SetValue(0x5A, 0x00, current);
}


x86 assembly (clang, -O0):
<setCaddyStepperCurrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5a,%edi
xor    %esi,%esi
movsbl -0x1(%rbp),%edx
call   1030 <MCP4461_SetValue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCaddyStepperCurrent>:
mov    %edi,%edx
mov    $0x5a,%edi
xor    %esi,%esi
jmp    1030 <MCP4461_SetValue@plt>

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

LLVM IR (-O2):
define void @setCaddyStepperCurrent(i8 signext %0) {
%2 = tail call i32 @MCP4461_SetValue(i32 90, i32 0, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ crescente(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  crescente(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <setlocale@plt>
mov    $0xb,%edi
call   1040 <crescente@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @crescente(i32 11)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @crescente(i32 11)
ret i32 0
}
/* Variables and functions */
int main_1(int, int *);
int main(int n) { return main_1(n + 2, &n); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    $0x2,%edi
lea    -0x8(%rbp),%rsi
call   1030 <main_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
add    $0x2,%edi
lea    0x4(%rsp),%rsi
call   1030 <main_1@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = add nsw i32 %0, 2
%4 = call i32 @main_1(i32 %3, i32* %2)
ret i32 %4
}
void catch_sigpipe(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @catch_sigpipe(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ ppc_write(int /*<<< orphan*/, char *, int);
void printdec(unsigned x) {
  char ch;
  if (x >= 10) {
    printdec(x / 10);
  }
  ch = '0' + (x % 10);
  ppc_write(STDOUT_FILENO, &ch, 1);
}


x86 assembly (clang, -O0):
<printdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     1148 <printdec+0x28>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <printdec@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%al
mov    %al,-0x5(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <ppc_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdec>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%r14d
cmp    $0xa,%edi
jb     1140 <printdec+0x20>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1030 <printdec@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%bl
mov    %bl,0x7(%rsp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <ppc_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @printdec(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = udiv i32 %7, 10
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = urem i32 %10, 10
%12 = add i32 48, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i32, i32* @STDOUT_FILENO
%15 = call i32 @ppc_write(i32 %14, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @printdec(i32 %0) {
%2 = alloca i8
%3 = icmp ugt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = udiv i32 %0, 10
tail call void @printdec(i32 %5)
br label %6
6: ; preds = %4, %1
%7 = urem i32 %0, 10
%8 = trunc i32 %7 to i8
%9 = or i8 %8, 48
store i8 %9, i8* %2
%10 = load i32, i32* @STDOUT_FILENO
%11 = call i32 @ppc_write(i32 %10, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertEq(int /*<<< orphan*/, int);
int /*<<< orphan*/ endTest();
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ integral(int);
int /*<<< orphan*/ sum(int);
int main() {
  assertEq(integral(10), 3628800);
  assertEq(sum(200), 20100);
  assertEq(fib(20), 6765);
  endTest();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <integral@plt>
mov    %eax,%edi
mov    $0x375f00,%esi
call   1070 <assertEq@plt>
mov    $0xc8,%edi
call   1050 <sum@plt>
mov    %eax,%edi
mov    $0x4e84,%esi
call   1070 <assertEq@plt>
mov    $0x14,%edi
call   1060 <fib@plt>
mov    %eax,%edi
mov    $0x1a6d,%esi
call   1070 <assertEq@plt>
mov    $0x0,%al
call   1040 <endTest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <integral@plt>
mov    %eax,%edi
mov    $0x375f00,%esi
call   1070 <assertEq@plt>
mov    $0xc8,%edi
call   1050 <sum@plt>
mov    %eax,%edi
mov    $0x4e84,%esi
call   1070 <assertEq@plt>
mov    $0x14,%edi
call   1060 <fib@plt>
mov    %eax,%edi
mov    $0x1a6d,%esi
call   1070 <assertEq@plt>
xor    %eax,%eax
call   1040 <endTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @integral(i32 10)
%2 = call i32 @assertEq(i32 %1, i32 3628800)
%3 = call i32 @sum(i32 200)
%4 = call i32 @assertEq(i32 %3, i32 20100)
%5 = call i32 @fib(i32 20)
%6 = call i32 @assertEq(i32 %5, i32 6765)
%7 = call i32 (...) @endTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @integral(i32 10)
%2 = tail call i32 @assertEq(i32 %1, i32 3628800)
%3 = tail call i32 @sum(i32 200)
%4 = tail call i32 @assertEq(i32 %3, i32 20100)
%5 = tail call i32 @fib(i32 20)
%6 = tail call i32 @assertEq(i32 %5, i32 6765)
%7 = tail call i32 (...) @endTest()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct utmp {
  int /*<<< orphan*/ ut_time;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
char *utmp_ctime(struct utmp *u) {
  time_t t = (time_t)u->ut_time;
  return ctime(&t);
}


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

x86 assembly (clang, -O2):
<utmp_ctime>:
push   %rax
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.utmp = type { i32 }
define i8* @utmp_ctime(%struct.utmp* %0) {
%2 = alloca %struct.utmp*
%3 = alloca i32
store %struct.utmp* %0, %struct.utmp** %2
%4 = load %struct.utmp*, %struct.utmp** %2
%5 = getelementptr inbounds %struct.utmp, %struct.utmp* %4, i32 0, i32 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i8* @ctime(i32* %3)
ret i8* %7
}

LLVM IR (-O2):
%struct.utmp = type { i32 }
define i8* @utmp_ctime(%struct.utmp* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = call i8* @ctime(i32* %2)
ret i8* %6
}
double add(double d1, double d2) { return (d1 + d2); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ wserror_fun(char *);
void wserror_builtin(char *str) { wserror_fun(str); }


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

x86 assembly (clang, -O2):
<wserror_builtin>:
jmp    1030 <wserror_fun@plt>

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

LLVM IR (-O2):
define void @wserror_builtin(i8* %0) {
%2 = tail call i32 @wserror_fun(i8* %0)
ret void
}
/* Variables and functions */
double utc_offset(double);
double local_time(double utc_ms) { return utc_ms + utc_offset(utc_ms); }


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

x86 assembly (clang, -O2):
<local_time>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <utc_offset@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @local_time(double %0) {
%2 = tail call double @utc_offset(double %0)
%3 = fadd double %2, %0
ret double %3
}
int fastFloor(double x) {
  int xi = (int)x;
  return x < xi ? xi - 1 : xi;
}


x86 assembly (clang, -O0):
<fastFloor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <fastFloor+0x33>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1139 <fastFloor+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastFloor>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fastFloor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %6, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
br label %15
13: ; preds = %1
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @fastFloor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp ogt double %3, %0
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %2
ret i32 %6
}
int test_imm_5Buint32_mem(unsigned int *val) {
  return ((*val) & (0x5B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 91
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_transmit_empty();
int /*<<< orphan*/ outb(int, char);
void serial_send(char a) {
  while (is_transmit_empty() == 0)
    ;
  outb(0x3f8, a);
}


x86 assembly (clang, -O0):
<serial_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <serial_send+0x24>
jmp    112e <serial_send+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_send>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <is_transmit_empty@plt>
test   %rax,%rax
je     1130 <serial_send+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_send(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @serial_send(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 1016, i8 signext %0)
ret void
}
unsigned int i2hash(void *key) {
  unsigned int *v = key;
  return v[0] + (v[1] << 16);
}


x86 assembly (clang, -O0):
<i2hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2hash>:
mov    0x4(%rdi),%eax
shl    $0x10,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i2hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = add i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @i2hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = add i32 %7, %3
ret i32 %8
}
void foo260(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo260(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_cli_reboot(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x31000009));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31000009,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_reboot>:
push   %rax
mov    $0x31000009,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_cli_reboot(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @hoic_sw(i32 %9, i32 822083593)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_cli_reboot(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 822083593)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun2(int a) { printf("Value of a is %d\n", a + 1); }


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

x86 assembly (clang, -O2):
<fun2>:
lea    0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Value of a is %d\0A\00"
define void @fun2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Value of a is %d\0A\00"
define void @fun2(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void __pure_virtual() {}


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

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

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

LLVM IR (-O2):
define void @__pure_virtual() {
ret void
}
/* Variables and functions */
long double log10(long double);
long double log2(long double x) { return log10(x) / log10((long double)2); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log10@plt>
fstpt  -0x1c(%rbp)
mov    %rsp,%rax
flds   0xec9(%rip)
fstpt  (%rax)
call   1030 <log10@plt>
fldt   -0x1c(%rbp)
fdivp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <log10@plt>
fstpt  0x1c(%rsp)
flds   0xed6(%rip)
fstpt  (%rsp)
call   1030 <log10@plt>
fldt   0x1c(%rsp)
fdivp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @log2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @log10(x86_fp80 %3)
%5 = call x86_fp80 @log10(x86_fp80 0xK40008000000000000000)
%6 = fdiv x86_fp80 %4, %5
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @log2(x86_fp80 %0) {
%2 = tail call x86_fp80 @log10(x86_fp80 %0)
%3 = tail call x86_fp80 @log10(x86_fp80 0xK40008000000000000000)
%4 = fdiv x86_fp80 %2, %3
ret x86_fp80 %4
}
int comparefunc(const void *arg1, const void *arg2) {
  const int *ptr1 = (const int *)arg1;
  const int *ptr2 = (const int *)arg2;
  int val1 = *ptr1;
  int val2 = *ptr2;
  if (val1 < val2) {
    return -1;
  }
  if (val1 == val2) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<comparefunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1146 <comparefunc+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <comparefunc+0x65>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jne    115e <comparefunc+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <comparefunc+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparefunc>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comparefunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int iscntrl(int ch) {
  if ((ch >= 0x00 && ch <= 0x1F) || (ch == 0x7F))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <iscntrl+0x1b>
cmpl   $0x1f,-0x8(%rbp)
jle    1125 <iscntrl+0x25>
cmpl   $0x7f,-0x8(%rbp)
jne    1131 <iscntrl+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <iscntrl+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long font;
};
typedef TYPE_1__ XTextItem16;

/* Variables and functions */
void set_XTextItem16_font(void *_p, unsigned long _v) {
  ((XTextItem16 *)_p)->font = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XTextItem16_font(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XTextItem16_font(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int exp(int);
double link_function(double x) {
  return 2 * (8 * 8) / (1 + exp((-1) * x)) - (8 * 8);
}


x86 assembly (clang, -O0):
<link_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x80,%eax
cltd
idiv   %ecx
sub    $0x40,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_function>:
push   %rax
xorpd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x80,%eax
xor    %edx,%edx
idiv   %ecx
add    $0xffffffc0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @link_function(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call i32 @exp(i32 %5)
%7 = add nsw i32 1, %6
%8 = sdiv i32 128, %7
%9 = sub nsw i32 %8, 64
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @link_function(double %0) {
%2 = fneg double %0
%3 = fptosi double %2 to i32
%4 = tail call i32 @exp(i32 %3)
%5 = add nsw i32 %4, 1
%6 = sdiv i32 128, %5
%7 = add nsw i32 %6, -64
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[]) {
  float a = 1.3 * 365, b = 1 + 0.05, i = 1;
  while (i++ <= 10) {
    a = (a + 1.3 * 365) * b;
  }
  printf("%g\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xeb8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  0xea6(%rip),%xmm2
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe9e(%rip),%xmm0
ucomiss %xmm1,%xmm0
jb     11a7 <main+0x97>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe88(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    114d <main+0x3d>
movss  -0x14(%rbp),%xmm0
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 4.745000e+02, float* %6
store float 0x3FF0CCCCC0000000, float* %7
store float 1.000000e+00, float* %8
br label %9
9: ; preds = %13, %2
%10 = load float, float* %8
%11 = fadd float %10, 1.000000e+00
store float %11, float* %8
%12 = fcmp ole float %10, 1.000000e+01
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = fadd double %15, 4.745000e+02
%17 = load float, float* %7
%18 = fpext float %17 to double
%19 = fmul double %16, %18
%20 = fptrunc double %19 to float
store float %20, float* %6
br label %9
21: ; preds = %9
%22 = load float, float* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x40BB7F8780000000)
ret i32 0
}
void testLocations(char *a) {
  char *b = a;
  if (!(b == a))
    ((void)*(char *)0);
  if (!(b >= a))
    ((void)*(char *)0);
  if (!(b <= a))
    ((void)*(char *)0);
  if (b != a)
    ((void)*(char *)0);
  if (b > a)
    ((void)*(char *)0);
  if (b < a)
    ((void)*(char *)0);
  if (b - a)
    ((void)*(char *)0);
}


x86 assembly (clang, -O0):
<testLocations>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     111e <testLocations+0x1e>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112c <testLocations+0x2c>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    113a <testLocations+0x3a>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1148 <testLocations+0x48>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1156 <testLocations+0x56>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1164 <testLocations+0x64>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
je     1179 <testLocations+0x79>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testLocations(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = icmp eq i8* %5, %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8, i8* null
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = icmp uge i8* %11, %12
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = load i8, i8* null
br label %16
16: ; preds = %14, %10
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = icmp ule i8* %17, %18
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = load i8, i8* null
br label %22
22: ; preds = %20, %16
%23 = load i8*, i8** %3
%24 = load i8*, i8** %2
%25 = icmp ne i8* %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i8, i8* null
br label %28
28: ; preds = %26, %22
%29 = load i8*, i8** %3
%30 = load i8*, i8** %2
%31 = icmp ugt i8* %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load i8, i8* null
br label %34
34: ; preds = %32, %28
%35 = load i8*, i8** %3
%36 = load i8*, i8** %2
%37 = icmp ult i8* %35, %36
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load i8, i8* null
br label %40
40: ; preds = %38, %34
%41 = load i8*, i8** %3
%42 = load i8*, i8** %2
%43 = ptrtoint i8* %41 to i64
%44 = ptrtoint i8* %42 to i64
%45 = sub i64 %43, %44
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %40
%48 = load i8, i8* null
br label %49
49: ; preds = %47, %40
ret void
}

LLVM IR (-O2):
define void @testLocations(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void subsFill(char *substab[2], char *origptr, int subsval) {
  char *subsptr;
  subsptr = malloc(32 * sizeof(char));
  sprintf(subsptr, "%d",
          (int)((subsval + sizeof(double) - 1) / sizeof(double)));
  substab[0] = origptr;
  substab[1] = subsptr;
}


x86 assembly (clang, -O0):
<subsFill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    $0x8,%rax
sub    $0x1,%rax
shr    $0x3,%rax
mov    %eax,%edx
lea    0xea2(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsFill>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rdx
add    $0x7,%rdx
shr    $0x3,%rdx
lea    0xeb1(%rip),%rsi
mov    %rax,%rdi
call   1040 <sprintf@plt>
mov    %r14,(%rbx)
mov    %rbp,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @subsFill(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i8* @malloc(i32 32)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = add i64 %11, 8
%13 = sub i64 %12, 1
%14 = udiv i64 %13, 8
%15 = trunc i64 %14 to i32
%16 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i8*, i8** %5
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 0
store i8* %17, i8** %19
%20 = load i8*, i8** %7
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 1
store i8* %20, i8** %22
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @subsFill(i8** nocapture writeonly %0, i8* %1, i32 %2) {
%4 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
%5 = sext i32 %2 to i64
%6 = add nsw i64 %5, 7
%7 = lshr i64 %6, 3
%8 = trunc i64 %7 to i32
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
store i8* %1, i8** %0
%10 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %4, i8** %10
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire8() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE8"
                                             : "INPUT_KEYB_FIRE8");
}


x86 assembly (clang, -O0):
<f_input_fire8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire8>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE8\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE8\00"
define i8* @f_input_fire8() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE8\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE8\00"
define i8* @f_input_fire8() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Variables and functions */
int log(int);
unsigned long long pow(int, unsigned long long);
unsigned long long int lsb(unsigned long long int n) {
  unsigned long long int x = (unsigned long long int)(log((double)n) / log(2));
  return pow(2, x);
}


x86 assembly (clang, -O0):
<lsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xecd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xecc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1040 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsb>:
push   %rbx
call   1030 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
movslq %eax,%rsi
mov    $0x2,%edi
pop    %rbx
jmp    1040 <pow@plt>

LLVM IR (-O0):
define i64 @lsb(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fptosi double %5 to i32
%7 = call i32 @log(i32 %6)
%8 = call i32 @log(i32 2)
%9 = sdiv i32 %7, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = call i64 @pow(i32 2, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @lsb(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @log(i32 %2)
%4 = tail call i32 @log(i32 2)
%5 = sdiv i32 %3, %4
%6 = sext i32 %5 to i64
%7 = tail call i64 @pow(i32 2, i64 %6)
ret i64 %7
}
long max(const long a, const long b) {
  if (a > b) {
    return a;
  } else if (b > a) {
    return b;
  } else if (b == a) {
    return 0;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <max+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1142 <max+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <max+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    115d <max+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    1167 <max+0x67>
jmp    1162 <max+0x62>
jmp    1167 <max+0x67>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
xor    %eax,%eax
cmp    %rdi,%rsi
cmovg  %rsi,%rax
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp sgt i64 %1, %0
%5 = select i1 %4, i64 %1, i64 0
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("Hello, I'm a shared library"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello, I'm a shared library\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello, I'm a shared library\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int const *knot_wire_seek_label(int const *, int const *);
const uint8_t *knot_wire_next_label(const uint8_t *lp, const uint8_t *wire) {
  return knot_wire_seek_label(lp + (lp[0] + sizeof(uint8_t)), wire);
}


x86 assembly (clang, -O0):
<knot_wire_next_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
add    $0x4,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <knot_wire_seek_label@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_next_label>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rdi
add    $0x10,%rdi
jmp    1030 <knot_wire_seek_label@plt>

LLVM IR (-O0):
define i32* @knot_wire_next_label(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = add i64 %9, 4
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32*, i32** %4
%13 = call i32* @knot_wire_seek_label(i32* %11, i32* %12)
ret i32* %13
}

LLVM IR (-O2):
define i32* @knot_wire_next_label(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 4
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = tail call i32* @knot_wire_seek_label(i32* %6, i32* %1)
ret i32* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_drv_radio802154_energy_detected(int /*<<< orphan*/);
void nrf_drv_radio802154_notify_energy_detected(int8_t result) {
  nrf_drv_radio802154_energy_detected(result);
}


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

x86 assembly (clang, -O2):
<nrf_drv_radio802154_notify_energy_detected>:
jmp    1030 <nrf_drv_radio802154_energy_detected@plt>

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

LLVM IR (-O2):
define void @nrf_drv_radio802154_notify_energy_detected(i32 %0) {
%2 = tail call i32 @nrf_drv_radio802154_energy_detected(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage() {
  fputs("Usage: tee [OPTION(S)]  [FILE] \n\n"
        "OPTIONS:\n"
        "-a, --append         append to the given FILEs, do not overwrite\n"
        "    --help           print this message and exit\n"
        "    --version        print version and exit\n",
        stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [201 x i8] c"Usage: tee [OPTION(S)] [FILE] \0A\0AOPTIONS:\0A-a, --append append to the given FILEs, do not overwrite\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [201 x i8] c"Usage: tee [OPTION(S)] [FILE] \0A\0AOPTIONS:\0A-a, --append append to the given FILEs, do not overwrite\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double floor(double);
double round_down_double(double x, double d) {
  return (d > 0.0) ? floor(x / d) * d : x;
}


x86 assembly (clang, -O0):
<round_down_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <round_down_double+0x42>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115c <round_down_double+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_down_double>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1132 <round_down_double+0x22>
push   %rax
divsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <floor@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @round_down_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = call double @llvm.floor.f64(double %10)
%12 = load double, double* %4
%13 = fmul double %11, %12
br label %16
14: ; preds = %2
%15 = load double, double* %3
br label %16
16: ; preds = %14, %7
%17 = phi double [ %13, %7 ], [ %15, %14 ]
ret double %17
}

LLVM IR (-O2):
define double @round_down_double(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fdiv double %0, %1
%6 = tail call double @llvm.floor.f64(double %5)
%7 = fmul double %6, %1
br label %8
8: ; preds = %2, %4
%9 = phi double [ %7, %4 ], [ %0, %2 ]
ret double %9
}
void gdk_pango_renderer_set_drawable() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pango_renderer_set_drawable() {
ret void
}
/* Type definitions */
struct _critbit_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _critbit_has_tag(uintptr_t const);
int /*<<< orphan*/ assert(int);
uintptr_t _critbit_add_tag(const struct _critbit_node *const node) {
  const uintptr_t v = (uintptr_t)node;
  assert(!_critbit_has_tag(v));
  return v + 1;
}


x86 assembly (clang, -O0):
<_critbit_add_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_critbit_has_tag@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_critbit_add_tag>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_critbit_has_tag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct._critbit_node = type { i32 }
define i64 @_critbit_add_tag(%struct._critbit_node* %0) {
%2 = alloca %struct._critbit_node*
%3 = alloca i64
store %struct._critbit_node* %0, %struct._critbit_node** %2
%4 = load %struct._critbit_node*, %struct._critbit_node** %2
%5 = ptrtoint %struct._critbit_node* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @_critbit_has_tag(i64 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 1
ret i64 %13
}

LLVM IR (-O2):
%struct._critbit_node = type { i32 }
define i64 @_critbit_add_tag(%struct._critbit_node* %0) {
%2 = ptrtoint %struct._critbit_node* %0 to i64
%3 = tail call i32 @_critbit_has_tag(i64 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = add i64 %2, 1
ret i64 %7
}