xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFIFOEnable(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          484);
    }
  };
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<UARTFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTFIFOEnable+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x1e4,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTFIFOEnable+0x1e>
lea    0xecc(%rip),%rdi
mov    $0x1e4,%esi
call   1030 <AssertFailure@plt>
orq    $0x10,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFOEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 484)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 44
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, 16
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFOEnable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 484)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 16
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
unsigned int __udivsi3(unsigned int, unsigned int);
unsigned int __umodsi3(unsigned int a, unsigned int b) {
  return a - __udivsi3(a, b) * b;
}


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

x86 assembly (clang, -O2):
<__umodsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <__udivsi3@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__umodsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__udivsi3(i32 %0, i32 %1)
%4 = mul i32 %3, %1
%5 = sub i32 %0, %4
ret i32 %5
}
void gtk_window_position_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_position_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XmbLookupString() {
  printf("XmbLookupString called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"XmbLookupString called\00"
define i32 @XmbLookupString() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double fmod(double __x, double __y) {
  register double __val;
  __asm __volatile__("1:        fprem\n\t"
                     "fstsw     %%ax\n\t"
                     "sahf\n\t"
                     "jp        1b"
                     : "=t"(__val)
                     : "0"(__x), "u"(__y)
                     : "ax", "cc");
  return __val;
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldl   -0x20(%rbp)
fldl   -0x28(%rbp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     112a <fmod+0x2a>
fstp   %st(1)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     1116 <fmod+0x16>
fstp   %st(1)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double asm sideeffect "1: fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b", "={st},0,{st(1)},~{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = tail call double asm sideeffect "1: fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b", "={st},0,{st(1)},~{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(double %0, double %1)
ret double %3
}
int test_imm_1Aint8_mem(signed char *val) {
  return ((*val) & (0x1A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 26
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int min_i(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min_i+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_i+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_i>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min_i(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int uart_calc_divisor(int baudRate) { return (48054850 / baudRate + 8) / 16; }


x86 assembly (clang, -O0):
<uart_calc_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2dd4242,%eax
cltd
idivl  -0x4(%rbp)
add    $0x8,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_calc_divisor>:
mov    $0x2dd4242,%eax
xor    %edx,%edx
idiv   %edi
lea    0x8(%rax),%ecx
add    $0x17,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @uart_calc_divisor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 48054850, %3
%5 = add nsw i32 %4, 8
%6 = sdiv i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @uart_calc_divisor(i32 %0) {
%2 = sdiv i32 48054850, %0
%3 = add nsw i32 %2, 8
%4 = sdiv i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int tch_process_burst(char *, int, int);
int main() {
  char x[] = {1, 2, 3};
  printf("%i\n", tch_process_burst(x, 1, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <tch_process_burst@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x3,0x6(%rsp)
movw   $0x201,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <tch_process_burst@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.x = [3 x i8] c"\01\02\03"
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = bitcast [3 x i8]* %1 to i8*
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @tch_process_burst(i8* %3, i32 1, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [3 x i8] c"\01\02\03"
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @tch_process_burst(i8* %2, i32 1, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned int read32(unsigned int);
unsigned int fetch32(unsigned int addr) { return (read32(addr)); }


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

x86 assembly (clang, -O2):
<fetch32>:
jmp    1030 <read32@plt>

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

LLVM IR (-O2):
define i32 @fetch32(i32 %0) {
%2 = tail call i32 @read32(i32 %0)
ret i32 %2
}
void g_value_get_enum() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_enum() {
ret void
}
int test_or(int a, int b, int c) {
  if (a < b || b < c)
    return a;
  else
    return c;
}


x86 assembly (clang, -O0):
<test_or>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1125 <test_or+0x25>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <test_or+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <test_or+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_or>:
mov    %edx,%eax
cmp    %edx,%esi
cmovl  %edi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_or(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %1, %2
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %2
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ TsHasAdaptationField(int const *);
int TsPayloadOffset(const uint8_t *p) {
  int o = TsHasAdaptationField(p) ? p[4] + 5 : 4;
  return o <= 188 ? o : 188;
}


x86 assembly (clang, -O0):
<TsPayloadOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <TsHasAdaptationField@plt>
cmp    $0x0,%rax
je     1141 <TsPayloadOffset+0x31>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <TsPayloadOffset+0x3e>
mov    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <TsPayloadOffset+0x3e>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xbc,-0xc(%rbp)
jg     116c <TsPayloadOffset+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <TsPayloadOffset+0x69>
mov    $0xbc,%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <TsPayloadOffset+0x69>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TsPayloadOffset>:
push   %rbx
mov    %rdi,%rbx
call   1030 <TsHasAdaptationField@plt>
test   %rax,%rax
je     1135 <TsPayloadOffset+0x25>
mov    0x10(%rbx),%ecx
mov    $0xbc,%eax
cmp    $0xb6,%ecx
jg     1133 <TsPayloadOffset+0x23>
add    $0x5,%ecx
mov    %ecx,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @TsPayloadOffset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @TsHasAdaptationField(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 4
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 5
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %7
%14 = phi i32 [ %11, %7 ], [ 4, %12 ]
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 188
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %3
br label %20
19: ; preds = %13
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 188, %19 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @TsPayloadOffset(i32* %0) {
%2 = tail call i64 @TsHasAdaptationField(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 5
%8 = icmp slt i32 %6, 183
br i1 %8, label %9, label %11
9: ; preds = %1, %4
%10 = phi i32 [ %7, %4 ], [ 4, %1 ]
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ 188, %4 ]
ret i32 %12
}
/* Type definitions */
struct ptdump_options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct ptdump_options const *, char *, unsigned int,
                         char);
void fillup_column(const struct ptdump_options *options, unsigned actual_width,
                   unsigned col_width) {
  if (actual_width >= col_width)
    return;
  print(options, "%*c", col_width - actual_width, ' ');
}


x86 assembly (clang, -O0):
<fillup_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jb     1133 <fillup_column+0x23>
jmp    114e <fillup_column+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
lea    0xebc(%rip),%rsi
mov    $0x20,%ecx
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillup_column>:
sub    %esi,%edx
jbe    1125 <fillup_column+0x15>
lea    0xee5(%rip),%rsi
mov    $0x20,%ecx
jmp    1030 <print@plt>
ret

LLVM IR (-O0):
%struct.ptdump_options = type { i32 }
@.str = [4 x i8] c"%*c\00"
define void @fillup_column(%struct.ptdump_options* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ptdump_options*
%5 = alloca i32
%6 = alloca i32
store %struct.ptdump_options* %0, %struct.ptdump_options** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp uge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %17
11: ; preds = %3
%12 = load %struct.ptdump_options*, %struct.ptdump_options** %4
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sub i32 %13, %14
%16 = call i32 @print(%struct.ptdump_options* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15, i8 signext 32)
br label %17
17: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.ptdump_options = type { i32 }
@.str = [4 x i8] c"%*c\00"
define void @fillup_column(%struct.ptdump_options* %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %2, %1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = sub i32 %2, %1
%7 = tail call i32 @print(%struct.ptdump_options* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6, i8 signext 32)
br label %8
8: ; preds = %3, %5
ret void
}
int read_ip_from_file(char *filename) {}


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

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

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

LLVM IR (-O2):
define i32 @read_ip_from_file(i8* nocapture readnone %0) {
ret i32 undef
}
int main(void) {
  char c;
  c = 'c';
  c = 'cc';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0x63,-0x1(%rbp)
movb   $0x63,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int lsetxattr(const char *__path, const char *__name, const void *__value,
              size_t __size, int __flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<lsetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsetxattr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @lsetxattr(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @lsetxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
int IsAPowerOfTwo(unsigned int a) {
  int i;
  for (i = 0; i < 8 * sizeof(unsigned int); i++) {
    if ((a >> i) == 2) {
      return 1;
    } else if ((a >> i) % 2 != 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<IsAPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1171 <IsAPowerOfTwo+0x71>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
cmp    $0x2,%eax
jne    1139 <IsAPowerOfTwo+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1178 <IsAPowerOfTwo+0x78>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1159 <IsAPowerOfTwo+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1178 <IsAPowerOfTwo+0x78>
jmp    115e <IsAPowerOfTwo+0x5e>
jmp    1163 <IsAPowerOfTwo+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <IsAPowerOfTwo+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAPowerOfTwo>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%edx
shr    %cl,%edx
cmp    $0x2,%edx
je     113f <IsAPowerOfTwo+0x3f>
xor    %eax,%eax
test   $0x1,%dl
jne    113e <IsAPowerOfTwo+0x3e>
add    $0x1,%ecx
mov    %edi,%edx
shr    %cl,%edx
cmp    $0x2,%edx
je     113f <IsAPowerOfTwo+0x3f>
test   $0x1,%dl
jne    113e <IsAPowerOfTwo+0x3e>
add    $0x1,%ecx
mov    $0x1,%eax
cmp    $0x20,%ecx
jne    1110 <IsAPowerOfTwo+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @IsAPowerOfTwo(i32 %0) {
br label %12
2: ; preds = %16
%3 = or i32 %13, 1
%4 = lshr i32 %0, %3
%5 = icmp eq i32 %4, 2
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = and i32 %4, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = add nuw nsw i32 %13, 2
%11 = icmp eq i32 %10, 32
br i1 %11, label %19, label %12
12: ; preds = %9, %1
%13 = phi i32 [ 0, %1 ], [ %10, %9 ]
%14 = lshr i32 %0, %13
%15 = icmp eq i32 %14, 2
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = and i32 %14, 1
%18 = icmp eq i32 %17, 0
br i1 %18, label %2, label %19
19: ; preds = %9, %6, %2, %16, %12
%20 = phi i32 [ 1, %12 ], [ 0, %16 ], [ 1, %2 ], [ 0, %6 ], [ 1, %9 ]
ret i32 %20
}
int strcmp(const char *str1, const char *str2) {
  while (*str1++ == *str2++) {
    if (*str1 == '\0') {
      break;
    }
  }
  return *str1 - *str2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1152 <strcmp+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114d <strcmp+0x4d>
jmp    1152 <strcmp+0x52>
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    $0x1,%edx
nopw   0x0(%rax,%rax,1)
mov    %rdx,%rcx
cmp    -0x1(%rsi,%rdx,1),%al
movzbl (%rdi,%rdx,1),%eax
jne    1129 <strcmp+0x29>
lea    0x1(%rcx),%rdx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
jmp    112c <strcmp+0x2c>
movsbl %al,%eax
movsbl (%rsi,%rcx,1),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @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 = %21, %2
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %22
15: ; preds = %5
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
br label %22
21: ; preds = %15
br label %5
22: ; preds = %20, %5
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %25, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %15, %2
%5 = phi i8 [ %3, %2 ], [ %12, %15 ]
%6 = phi i8* [ %0, %2 ], [ %8, %15 ]
%7 = phi i8* [ %1, %2 ], [ %9, %15 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = icmp eq i8 %5, %10
%12 = load i8, i8* %8
br i1 %11, label %15, label %13
13: ; preds = %4
%14 = sext i8 %12 to i32
br label %17
15: ; preds = %4
%16 = icmp eq i8 %12, 0
br i1 %16, label %17, label %4
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ 0, %15 ]
%19 = load i8, i8* %9
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %18, %20
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mkversion [-v version-file] [-a alpha-file]\n"
                  "                 [-r releasedate-file] [outfile]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [101 x i8] c"usage: mkversion [-v version-file] [-a alpha-file]\0A [-r releasedate-file] [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [101 x i8] c"usage: mkversion [-v version-file] [-a alpha-file]\0A [-r releasedate-file] [outfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *);
void TestC() {
  while (1) {
    printf("C");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <TestC+0x9>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1129 <TestC+0x9>

x86 assembly (clang, -O2):
<TestC>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestC+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
define void @TestC() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @milli_delay(i32 200)
br label %1
}

LLVM IR (-O2):
define void @TestC() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(i32 67)
%3 = tail call i32 @milli_delay(i32 200)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ clear_local_APIC();
void smp_callin_clear_local_apic(void) { clear_local_APIC(); }


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

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

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

LLVM IR (-O2):
define void @smp_callin_clear_local_apic() {
%1 = tail call i32 (...) @clear_local_APIC()
ret void
}
/* Type definitions */
typedef int uint8_t;
struct scsi_cmd {
  int dummy;
};

/* Variables and functions */
uint8_t ssc_allow_prevent_removal(struct scsi_cmd *cmd) {
  ;
  return 0x00;
}


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

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

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

LLVM IR (-O2):
%struct.scsi_cmd = type { i32 }
define i32 @ssc_allow_prevent_removal(%struct.scsi_cmd* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *argv0) {
  fprintf(stderr,
          "Usage: %s <list_length> <loop_start_index>\n"
          "\tlist_length can not be negative or zero\n"
          "\tloop_start can be negative, that means no loop.\n",
          argv0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [134 x i8] c"Usage: %s <list_length> <loop_start_index>\0A\09list_length can not be negative or zero\0A\09loop_start can be negative, that means no loop.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [134 x i8] c"Usage: %s <list_length> <loop_start_index>\0A\09list_length can not be negative or zero\0A\09loop_start can be negative, that means no loop.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int eloop_open(struct eloop *eloop) {
  (void)((eloop));
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.eloop = type opaque
define i32 @eloop_open(%struct.eloop* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wFileSize(int);
scalar_t__ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinLof() { wStackPushNumber(wFileSize((int)wStackPopNumber())); }


x86 assembly (clang, -O0):
<wBuiltinLof>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <wFileSize@plt>
mov    %eax,%edi
call   1040 <wStackPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinLof>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <wFileSize@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumber@plt>

LLVM IR (-O0):
define void @wBuiltinLof() {
%1 = call i64 (...) @wStackPopNumber()
%2 = trunc i64 %1 to i32
%3 = call i32 @wFileSize(i32 %2)
%4 = call i32 @wStackPushNumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @wBuiltinLof() {
%1 = tail call i64 (...) @wStackPopNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @wFileSize(i32 %2)
%4 = tail call i32 @wStackPushNumber(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ int64Clear(int /*<<< orphan*/ *);
void int64Destroy(int64_t *data) {
  int64Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<int64Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <int64Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @int64Destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @int64Clear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @int64Destroy(i32* %0) {
%2 = tail call i32 @int64Clear(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutReshapeFunc(void *);
void glutReshapeFunc(void *fn) { fn_glutReshapeFunc(fn); }


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

x86 assembly (clang, -O2):
<glutReshapeFunc>:
jmp    1030 <fn_glutReshapeFunc@plt>

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

LLVM IR (-O2):
define void @glutReshapeFunc(i8* %0) {
%2 = tail call i32 @fn_glutReshapeFunc(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func4(void) { printf("Hello from func4!\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Hello from func4!\00"
define void @func4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int drinks[] = {4, 2, 3};
  printf("1st order: %i drinks\n", drinks[0]);
  printf("1st order: %i drinks\n", *drinks);
  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)
mov    0xed3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.drinks = [3 x i32] [i32 4, i32 2, i32 3]
@.str = [22 x i8] c"1st order: %i drinks\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"1st order: %i drinks\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct orderedmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct orderedmap *);
int /*<<< orphan*/ orderedmap_destroy_contents(struct orderedmap *);
void *orderedmap_destroy(struct orderedmap *o) {
  orderedmap_destroy_contents(o);
  free(o);
  return 0;
}


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

x86 assembly (clang, -O2):
<orderedmap_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <orderedmap_destroy_contents@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.orderedmap = type { i32 }
define i8* @orderedmap_destroy(%struct.orderedmap* %0) {
%2 = alloca %struct.orderedmap*
store %struct.orderedmap* %0, %struct.orderedmap** %2
%3 = load %struct.orderedmap*, %struct.orderedmap** %2
%4 = call i32 @orderedmap_destroy_contents(%struct.orderedmap* %3)
%5 = load %struct.orderedmap*, %struct.orderedmap** %2
%6 = call i32 @free(%struct.orderedmap* %5)
ret i8* null
}

LLVM IR (-O2):
%struct.orderedmap = type { i32 }
define noalias i8* @orderedmap_destroy(%struct.orderedmap* %0) {
%2 = tail call i32 @orderedmap_destroy_contents(%struct.orderedmap* %0)
%3 = tail call i32 @free(%struct.orderedmap* %0)
ret i8* null
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *src = s;
  while (*s++ != '\0')
    ;
  return (s - src - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <strlen+0x30>
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
/* Variables and functions */
void *memrchr(void const *, int, unsigned int);
unsigned int byte_rchr(const void *s, unsigned int n, int c) {
  const void *p;
  return (p = memrchr(s, c, n)) == 0 ? n : (p - s);
}


x86 assembly (clang, -O0):
<byte_rchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <memrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114b <byte_rchr+0x3b>
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
jmp    115a <byte_rchr+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_rchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ebp,%edx
call   1030 <memrchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @byte_rchr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i8* @memrchr(i8* %8, i32 %9, i32 %10)
store i8* %11, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
br label %22
16: ; preds = %3
%17 = load i8*, i8** %7
%18 = load i8*, i8** %4
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
br label %22
22: ; preds = %16, %13
%23 = phi i64 [ %15, %13 ], [ %21, %16 ]
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @byte_rchr(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @memrchr(i8* %0, i32 %2, i32 %1)
%5 = icmp eq i8* %4, null
%6 = zext i32 %1 to i64
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = select i1 %5, i64 %6, i64 %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void Userdef_OSTM1_WaitInt(void) {}


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

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

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

LLVM IR (-O2):
define void @Userdef_OSTM1_WaitInt() {
ret void
}
int xls_is_bigendian() {
  static int n = 1;
  if (*(char *)&n == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<xls_is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0x2f15(%rip),%eax
cmp    $0x1,%eax
jne    1120 <xls_is_bigendian+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1127 <xls_is_bigendian+0x27>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@xls_is_bigendian.n = internal global i32 1
define i32 @xls_is_bigendian() {
%1 = alloca i32
%2 = load i8, i8* bitcast (i32* @xls_is_bigendian.n to i8*)
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @xls_is_bigendian() {
ret i32 0
}
void set_fiq_handler(void *start, unsigned int length) {}


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

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

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

LLVM IR (-O2):
define void @set_fiq_handler(i8* nocapture %0, i32 %1) {
ret void
}
void reverse_string(char *begin, char *end) {
  char aux;
  while (end > begin)
    aux = *end, *end-- = *begin, *begin++ = aux;
}


x86 assembly (clang, -O0):
<reverse_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <reverse_string+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <reverse_string+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_string>:
cmp    %rdi,%rsi
jbe    112c <reverse_string+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <reverse_string+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_string(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}