xunge/DecIR huggingface dataset:
/* Variables and functions */
int rho_util_hash_secondary(int);
int hash(const char *key) {
  char *p = (char *)key;
  unsigned int h = 0;
  while (*p) {
    h = 31 * h + *p;
    ++p;
  }
  return rho_util_hash_secondary((int)h);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <hash+0x49>
imul   $0x1f,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <hash+0x1b>
mov    -0x14(%rbp),%edi
call   1030 <rho_util_hash_secondary@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113e <hash+0x2e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <hash+0x10>
mov    %eax,%edi
jmp    1030 <rho_util_hash_secondary@plt>
xor    %edi,%edi
jmp    1030 <rho_util_hash_secondary@plt>

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
%16 = tail call i32 @rho_util_hash_secondary(i32 %15)
ret i32 %16
}
int bitwise_lshift(int x, int y) { return x << y; }


x86 assembly (clang, -O0):
<bitwise_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bitwise_lshift(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* %4
%7 = shl i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bitwise_lshift(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
int os_thread_yield(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_thread_yield() {
ret i32 0
}
/* Variables and functions */
int printf(char *, ...);
int main(int argc, char *argv[]) {
  int ret;
  int n;
  ret = printf("123%n4", &n);
  printf("ret"
         ":%d, "
         "n"
         ":%d\n",
         (ret), (n));
  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)
lea    0xed3(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
lea    0xed8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"123%n4\00"
@.str.1 = [14 x i8] c"ret:%d, n:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"123%n4\00"
@.str.1 = [14 x i8] c"ret:%d, n:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
double quantize_255(double x) {
  int ix = x;
  if (ix < 0)
    return 0;
  if (ix > 255)
    return 255;
  return ix;
}


x86 assembly (clang, -O0):
<quantize_255>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1128 <quantize_255+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <quantize_255+0x51>
cmpl   $0xff,-0x14(%rbp)
jle    1147 <quantize_255+0x47>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <quantize_255+0x51>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize_255>:
cvttsd2si %xmm0,%eax
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovl  %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @quantize_255(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %10
store double 2.550000e+02, double* %2
br label %17
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
store double %16, double* %2
br label %17
17: ; preds = %14, %13, %9
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @quantize_255(double %0) {
%2 = fptosi double %0 to i32
%3 = icmp slt i32 %2, 255
%4 = select i1 %3, i32 %2, i32 255
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
char *app_name(char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void test_usage(char *path) {
  char *app = app_name(path);
  printf("usage:\n"
         "%s               - run all tests\n"
         "  or\n"
         "%s <test>        - run a specific test\n"
         "  or\n"
         "%s <from> <to>   - run a range of tests\n"
         "  or\n"
         "%s list          - list all tests\n",
         app, app, app, app);
}


x86 assembly (clang, -O0):
<test_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <app_name@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_usage>:
push   %rax
call   1040 <app_name@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"usage:\0A%s - run all tests\0A or\0A%s <test> - run a specific test\0A or\0A%s <from> <to> - run a range of tests\0A or\0A%s list - list all tests\0A\00"
define void @test_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @app_name(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"usage:\0A%s - run all tests\0A or\0A%s <test> - run a specific test\0A or\0A%s <from> <to> - run a range of tests\0A or\0A%s list - list all tests\0A\00"
define void @test_usage(i8* %0) {
%2 = tail call i8* @app_name(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2, i8* %2, i8* %2)
ret void
}
int TE3D_Console_SetPosition(int x, int y) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TE3D_Console_SetPosition(i32 %0, i32 %1) {
ret i32 0
}
void BASM_InitUnwind() {
  static int init = 0;
  void *p;
  if (init)
    return;
  init = 1;
}


x86 assembly (clang, -O0):
<BASM_InitUnwind>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     1116 <BASM_InitUnwind+0x16>
jmp    1120 <BASM_InitUnwind+0x20>
movl   $0x1,0x2f04(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BASM_InitUnwind>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <BASM_InitUnwind+0x10>
movb   $0x1,0x2f14(%rip)
ret

LLVM IR (-O0):
@BASM_InitUnwind.init = internal global i32 0
define void @BASM_InitUnwind() {
%1 = alloca i8*
%2 = load i32, i32* @BASM_InitUnwind.init
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
store i32 1, i32* @BASM_InitUnwind.init
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@BASM_InitUnwind.init = internal unnamed_addr global i1 false
define void @BASM_InitUnwind() {
%1 = load i1, i1* @BASM_InitUnwind.init
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @BASM_InitUnwind.init
br label %3
3: ; preds = %0, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ br();
int /*<<< orphan*/ ic();
int /*<<< orphan*/ printf(char *);
int main(void) {
  br();
  printf(", ");
  ic();
  printf("\n");
  ic();
  printf(",\n");
  br();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <br@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ic@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ic@plt>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <br@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <br@plt>
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <ic@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <ic@plt>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <br@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c",\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @br()
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @ic()
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @ic()
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @br()
%9 = 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 = [3 x i8] c", \00"
@str = [2 x i8] c",\00"
define i32 @main() {
%1 = tail call i32 (...) @br()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @ic()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @ic()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (...) @br()
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
unsigned long lrint(double);
unsigned long F_to_mkelvin(double f) {
  return lrint((f - 32) * 1000 / 1.8 + 273150);
}


x86 assembly (clang, -O0):
<F_to_mkelvin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <lrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_to_mkelvin>:
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
divsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i64 @F_to_mkelvin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double %4, 1.000000e+03
%6 = fdiv double %5, 1.800000e+00
%7 = fadd double %6, 2.731500e+05
%8 = call i64 @lrint(double %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @F_to_mkelvin(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 1.000000e+03
%4 = fdiv double %3, 1.800000e+00
%5 = fadd double %4, 2.731500e+05
%6 = tail call i64 @lrint(double %5)
ret i64 %6
}
/* Variables and functions */
int fn(int);
int fn2();
int main(int argc, char *argv[]) {
  if (argc > 1)
    return fn(argc);
  return fn2();
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    1150 <main+0x30>
mov    -0x8(%rbp),%edi
call   1030 <fn@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <main+0x3a>
mov    $0x0,%al
call   1040 <fn2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     112a <main+0xa>
jmp    1030 <fn@plt>
xor    %eax,%eax
jmp    1040 <fn2@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @fn(i32 %9)
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = call i32 (...) @fn2()
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @fn(i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @fn2()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Li Muyuan\n");
  printf("Li\nMuyuan\n");
  printf("Li");
  printf(" Muyuan\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>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Li Muyuan\0A\00"
@.str.1 = [11 x i8] c"Li\0AMuyuan\0A\00"
@.str.2 = [3 x i8] c"Li\00"
@.str.3 = [9 x i8] c" Muyuan\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"Li\00"
@str = [10 x i8] c"Li Muyuan\00"
@str.4 = [10 x i8] c"Li\0AMuyuan\00"
@str.5 = [8 x i8] c" Muyuan\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct echo_can_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct echo_can_state *);
void echo_can_free(struct echo_can_state *ec) { free(ec); }


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

x86 assembly (clang, -O2):
<echo_can_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.echo_can_state = type { i32 }
define void @echo_can_free(%struct.echo_can_state* nocapture %0) {
%2 = tail call i32 @free(%struct.echo_can_state* %0)
ret void
}
int emac1_etherstatspkts_set(unsigned int dev_id,
                             union emac1_etherstatspkts_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_etherstatspkts_u = type opaque
define i32 @emac1_etherstatspkts_set(i32 %0, %union.emac1_etherstatspkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts_u* %1, %union.emac1_etherstatspkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts_u = type opaque
define i32 @emac1_etherstatspkts_set(i32 %0, %union.emac1_etherstatspkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_tx_start(int pi) { return pigpio_command(pi, 30, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_tx_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1e,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_tx_start>:
mov    $0x1e,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @wave_tx_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pigpio_command(i32 %3, i32 30, i32 0, i32 0, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wave_tx_start(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 30, i32 0, i32 0, i32 1)
ret i32 %2
}
void PDMCritSectHasWaiters(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMCritSectHasWaiters() {
ret void
}
void __attribute__((weak)) otg_hs_wkup_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<otg_hs_wkup_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.otg_hs_wkup_isr = [16 x i8] c"otg_hs_wkup_isr\00"
define weak void @otg_hs_wkup_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.otg_hs_wkup_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.otg_hs_wkup_isr = [16 x i8] c"otg_hs_wkup_isr\00"
define weak void @otg_hs_wkup_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.otg_hs_wkup_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int floor(double);
int main() {
  if (floor(0.1) != 0.)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <floor@plt>
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1158 <main+0x38>
jp     1158 <main+0x38>
jmp    115f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <floor@plt>
test   %eax,%eax
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @floor(double 1.000000e-01)
%3 = sitofp i32 %2 to double
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @floor(double 1.000000e-01)
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int tgetent(char *buf, int *type) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tgetent(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
int vkel_strcmp(const char *str1, const char *str2) {
  while (*str1 && (*str1 == *str2)) {
    str1++, str2++;
  }
  return *(const unsigned char *)str1 - *(const unsigned char *)str2;
}


x86 assembly (clang, -O0):
<vkel_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <vkel_strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <vkel_strcmp+0x47>
jmp    1164 <vkel_strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <vkel_strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vkel_strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <vkel_strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <vkel_strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <vkel_strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @vkel_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
double eval_as_double(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @eval_as_double(double returned %0) {
ret double %0
}
void check_options_tcp_rr(struct options *opts, struct callbacks *cb) {}


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

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

LLVM IR (-O0):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_tcp_rr(%struct.options* %0, %struct.callbacks* %1) {
%3 = alloca %struct.options*
%4 = alloca %struct.callbacks*
store %struct.options* %0, %struct.options** %3
store %struct.callbacks* %1, %struct.callbacks** %4
ret void
}

LLVM IR (-O2):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_tcp_rr(%struct.options* nocapture %0, %struct.callbacks* nocapture %1) {
ret void
}
long int inttoInt(long int i) { return i; }


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

x86 assembly (clang, -O2):
<inttoInt>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @inttoInt(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ system(char *);
int idevicedate() {
  system("idevicedate");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<idevicedate>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idevicedate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"idevicedate\00"
@EXIT_SUCCESS = global i32 0
define i32 @idevicedate() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"idevicedate\00"
@EXIT_SUCCESS = global i32 0
define i32 @idevicedate() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
struct private_widget {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ draw_area(struct private_widget *, int, int, int, int);
void draw_widgetarea(struct private_widget *cw, int rx1, int ry1, int rx2,
                     int ry2) {
  draw_area(cw, rx1, ry1, rx2, ry2);
}


x86 assembly (clang, -O0):
<draw_widgetarea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <draw_area@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_widgetarea>:
jmp    1030 <draw_area@plt>

LLVM IR (-O0):
%struct.private_widget = type { i32 }
define void @draw_widgetarea(%struct.private_widget* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.private_widget*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.private_widget* %0, %struct.private_widget** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.private_widget*, %struct.private_widget** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @draw_area(%struct.private_widget* %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.private_widget = type { i32 }
define void @draw_widgetarea(%struct.private_widget* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @draw_area(%struct.private_widget* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int count_zero(long unsigned int n) {
  int count = 0;
  printf("%ld\n", n);
  while (n) {
    if (n % 10 == 0)
      count++;
    n /= 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1176 <count_zero+0x66>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    115f <count_zero+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1133 <count_zero+0x23>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_zero>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %ecx,%ecx
test   %rbx,%rbx
je     1166 <count_zero+0x56>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rax
mul    %rsi
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
add    %edi,%ecx
cmp    $0x9,%rbx
mov    %rdx,%rbx
ja     1140 <count_zero+0x30>
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @count_zero(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = icmp eq i64 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %11, %4 ], [ %0, %1 ]
%7 = urem i64 %6, 10
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = udiv i64 %6, 10
%12 = icmp ult i64 %6, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Variables and functions */
int first_2_of_4(int);
int last_2_of_4(int value) {
  int first2 = first_2_of_4(value);
  return value - first2 * 100;
}


x86 assembly (clang, -O0):
<last_2_of_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <first_2_of_4@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x64,-0x8(%rbp),%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_2_of_4>:
push   %rbx
mov    %edi,%ebx
call   1030 <first_2_of_4@plt>
imul   $0xffffff9c,%eax,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @last_2_of_4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @first_2_of_4(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 100
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @last_2_of_4(i32 %0) {
%2 = tail call i32 @first_2_of_4(i32 %0)
%3 = mul i32 %2, -100
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ machdep_ClockStop();
void McSrv_ClockStop(void) { machdep_ClockStop(); }


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

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

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

LLVM IR (-O2):
define void @McSrv_ClockStop() {
%1 = tail call i32 (...) @machdep_ClockStop()
ret void
}
int bit_toggle(int n, int pos_zb) { return (n ^= (1 << pos_zb)); }


x86 assembly (clang, -O0):
<bit_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bit_toggle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
store i32 %8, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_toggle(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int spi_close(int pi, unsigned handle) {
  return pigpio_command(pi, 72, handle, 0, 1);
}


x86 assembly (clang, -O0):
<spi_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x48,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_close>:
mov    %esi,%edx
mov    $0x48,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @spi_close(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* %4
%7 = call i32 @pigpio_command(i32 %5, i32 72, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @spi_close(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 72, i32 %1, i32 0, i32 1)
ret i32 %3
}
void INI_Bit_TYPE() {}


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

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

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

LLVM IR (-O2):
define void @INI_Bit_TYPE() {
ret void
}
/* Variables and functions */
double log(double);
double pow(double, double);
double gain_to_position(double g) {
  if (g == 0) {
    return 0;
  }
  return pow((6.0 * log(g) / log(2.0) + 192.0) / 198.0, 8.0);
}


x86 assembly (clang, -O0):
<gain_to_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <gain_to_position+0x32>
jp     1152 <gain_to_position+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <gain_to_position+0x93>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea0(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe57(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gain_to_position>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <gain_to_position+0x11>
jp     1131 <gain_to_position+0x11>
xorpd  %xmm0,%xmm0
ret
push   %rax
call   1030 <log@plt>
mulsd  0xec1(%rip),%xmm0
divsd  0xec1(%rip),%xmm0
addsd  0xec1(%rip),%xmm0
divsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @gain_to_position(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %16
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @log(double %8)
%10 = fmul double 6.000000e+00, %9
%11 = call double @log(double 2.000000e+00)
%12 = fdiv double %10, %11
%13 = fadd double %12, 1.920000e+02
%14 = fdiv double %13, 1.980000e+02
%15 = call double @pow(double %14, double 8.000000e+00)
store double %15, double* %2
br label %16
16: ; preds = %7, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @gain_to_position(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call double @log(double %0)
%5 = fmul double %4, 6.000000e+00
%6 = fdiv double %5, 0x3FE62E42FEFA39EF
%7 = fadd double %6, 1.920000e+02
%8 = fdiv double %7, 1.980000e+02
%9 = tail call double @pow(double %8, double 8.000000e+00)
br label %10
10: ; preds = %1, %3
%11 = phi double [ %9, %3 ], [ 0.000000e+00, %1 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("START");
  puts("KONIEC");
  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 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@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>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"START\00"
@.str.1 = [7 x i8] c"KONIEC\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"START\00"
@.str.1 = [7 x i8] c"KONIEC\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void __DELETE_java_nio_ReadWriteHeapByteBuffer(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_nio_ReadWriteHeapByteBuffer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_nio_ReadWriteHeapByteBuffer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_write_cell(unsigned int, char, int, int);
void fb_write(char *buf, unsigned int len) {
  unsigned int i;
  for (i = 0; i < len; i++) {
    fb_write_cell(i * 2, buf[i], 2, 8);
  }
}


x86 assembly (clang, -O0):
<fb_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1162 <fb_write+0x52>
mov    -0x10(%rbp),%edi
shl    $0x1,%edi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
movsbl (%rax,%rsi,1),%esi
call   1030 <fb_write_cell@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fb_write+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1152 <fb_write+0x42>
mov    %rdi,%r14
mov    %esi,%r15d
add    %r15,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%r14),%esi
mov    %ebx,%edi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1030 <fb_write_cell@plt>
add    $0x1,%r14
add    $0x2,%rbx
cmp    %rbx,%r15
jne    1130 <fb_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fb_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = mul i32 %11, 2
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @fb_write_cell(i32 %12, i8 signext %17, i32 2, i32 8)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fb_write(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = load i8, i8* %10
%12 = tail call i32 @fb_write_cell(i32 %9, i8 signext %11, i32 2, i32 8)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
void *stack_push4(struct tcb_regs *regs, void *stack, unsigned long value) {
  tcb_regs_stack_push(regs, sizeof(value));
  unsigned long *top = ((unsigned long *)stack) - 1;
  top[0] = value;
  return top;
}


x86 assembly (clang, -O0):
<stack_push4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <tcb_regs_stack_push@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_push4>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <tcb_regs_stack_push@plt>
mov    %r14,-0x8(%rbx)
add    $0xfffffffffffffff8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tcb_regs = type opaque
define i8* @stack_push4(%struct.tcb_regs* %0, i8* %1, i64 %2) {
%4 = alloca %struct.tcb_regs*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64*
store %struct.tcb_regs* %0, %struct.tcb_regs** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.tcb_regs*, %struct.tcb_regs** %4
%9 = call i32 (%struct.tcb_regs*, i64, ...) bitcast (i32 (...)* @tcb_regs_stack_push to i32 (%struct.tcb_regs*, i64, ...)*)(%struct.tcb_regs* %8, i64 8)
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i64*
%12 = getelementptr inbounds i64, i64* %11, i64 -1
store i64* %12, i64** %7
%13 = load i64, i64* %6
%14 = load i64*, i64** %7
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
%16 = load i64*, i64** %7
%17 = bitcast i64* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
%struct.tcb_regs = type opaque
define i8* @stack_push4(%struct.tcb_regs* %0, i8* writeonly %1, i64 %2) {
%4 = tail call i32 (%struct.tcb_regs*, i64, ...) bitcast (i32 (...)* @tcb_regs_stack_push to i32 (%struct.tcb_regs*, i64, ...)*)(%struct.tcb_regs* %0, i64 8)
%5 = getelementptr inbounds i8, i8* %1, i64 -8
%6 = bitcast i8* %5 to i64*
store i64 %2, i64* %6
ret i8* %5
}
void SteamAPI_ISteamHTMLSurface_CopyToClipboard(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_CopyToClipboard>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_CopyToClipboard = [43 x i8] c"SteamAPI_ISteamHTMLSurface_CopyToClipboard\00"
define void @SteamAPI_ISteamHTMLSurface_CopyToClipboard(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_CopyToClipboard, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_CopyToClipboard = [43 x i8] c"SteamAPI_ISteamHTMLSurface_CopyToClipboard\00"
define void @SteamAPI_ISteamHTMLSurface_CopyToClipboard(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_CopyToClipboard, i64 0, i64 0), i8* %0)
ret void
}