xunge/DecIR huggingface dataset:
double f(double x) { return (x * x * x - x * x - 41.0 * x + 105.0); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mulsd  0xee8(%rip),%xmm0
subsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %5, double %6, double %10)
%12 = load double, double* %2
%13 = call double @llvm.fmuladd.f64(double -4.100000e+01, double %12, double %11)
%14 = fadd double %13, 1.050000e+02
ret double %14
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, %0
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%5 = tail call double @llvm.fmuladd.f64(double %0, double -4.100000e+01, double %4)
%6 = fadd double %5, 1.050000e+02
ret double %6
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ ispunct(int);
scalar_t__ isspace(int);
int isprint(int c) { return (isalnum(c) || isspace(c) || ispunct(c)); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isprint+0x51>
mov    -0x4(%rbp),%edi
call   1050 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isprint+0x51>
mov    -0x4(%rbp),%edi
call   1040 <ispunct@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <isalnum@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115f <isprint+0x2f>
mov    %ebp,%edi
call   1050 <isspace@plt>
test   %rax,%rax
jne    115f <isprint+0x2f>
mov    %ebp,%edi
call   1040 <ispunct@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @ispunct(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @ispunct(i32 %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _pio_to_sram();
void pio_to_sram(void) { _pio_to_sram(); }


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

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

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

LLVM IR (-O2):
define void @pio_to_sram() {
%1 = tail call i32 (...) @_pio_to_sram()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IO_write(char *);
void command_unknown(void) { IO_write("command not found\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"command not found\0A\00"
define void @command_unknown() {
%1 = call i32 @IO_write(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"command not found\0A\00"
define void @command_unknown() {
%1 = tail call i32 @IO_write(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_18uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x18 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_18uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 24
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ send_ctrl_cmd(int);
int /*<<< orphan*/ send_data_cmd(unsigned int);
void lcm_setbacklight(unsigned int level) {
  if (level > 255)
    level = 255;
  send_ctrl_cmd(0x51);
  send_data_cmd(level);
}


x86 assembly (clang, -O0):
<lcm_setbacklight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jbe    113f <lcm_setbacklight+0x1f>
movl   $0xff,-0x4(%rbp)
mov    $0x51,%edi
call   1040 <send_ctrl_cmd@plt>
mov    -0x4(%rbp),%edi
call   1030 <send_data_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_setbacklight>:
push   %rbx
mov    %edi,%ebx
cmp    $0xff,%edi
mov    $0xff,%eax
cmovae %eax,%ebx
mov    $0x51,%edi
call   1040 <send_ctrl_cmd@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <send_data_cmd@plt>

LLVM IR (-O0):
define void @lcm_setbacklight(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 255, i32* %2
br label %6
6: ; preds = %5, %1
%7 = call i32 @send_ctrl_cmd(i32 81)
%8 = load i32, i32* %2
%9 = call i32 @send_data_cmd(i32 %8)
ret void
}

LLVM IR (-O2):
define void @lcm_setbacklight(i32 %0) {
%2 = icmp ult i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = tail call i32 @send_ctrl_cmd(i32 81)
%5 = tail call i32 @send_data_cmd(i32 %3)
ret void
}
IgualReales(double d1, double d2) {
  double resta;
  resta = d1 - d2;
  if (((resta) < 0 ? (-(resta)) : (resta)) < 0.000001)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IgualReales>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1151 <IgualReales+0x51>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115b <IgualReales+0x5b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xe98(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <IgualReales+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <IgualReales+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IgualReales>:
subsd  %xmm1,%xmm0
movapd 0xef4(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movsd  0xedf(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm3,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @IgualReales(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %6
%14 = fneg double %13
br label %17
15: ; preds = %2
%16 = load double, double* %6
br label %17
17: ; preds = %15, %12
%18 = phi double [ %14, %12 ], [ %16, %15 ]
%19 = fcmp olt double %18, 0x3EB0C6F7A0B5ED8D
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @IgualReales(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
%7 = fcmp olt double %6, 0x3EB0C6F7A0B5ED8D
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ PROT_NONE;
int pkey_mprotect(void *, int, int /*<<< orphan*/, int);
int main(void) { return pkey_mprotect((void *)0, 4096, PROT_NONE, -1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1000,%esi
mov    $0xffffffff,%ecx
call   1030 <pkey_mprotect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
mov    $0x1000,%esi
mov    $0xffffffff,%ecx
jmp    1030 <pkey_mprotect@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @PROT_NONE
%3 = call i32 @pkey_mprotect(i8* null, i32 4096, i32 %2, i32 -1)
ret i32 %3
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
define i32 @main() {
%1 = load i32, i32* @PROT_NONE
%2 = tail call i32 @pkey_mprotect(i8* null, i32 4096, i32 %1, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
int /*<<< orphan*/ fexpectf(char *, int, double, int);
void test_comma() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/arith.c",
          87, 3, (1, 3));
  ;
  fexpectf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/arith.c",
           88, 7.0, (1, 3, 5, 7.0));
  ;
}


x86 assembly (clang, -O0):
<test_comma>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
mov    $0x57,%esi
mov    $0x3,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xec5(%rip),%rdi
mov    $0x58,%esi
movsd  0xeb0(%rip),%xmm0
mov    $0x7,%edx
call   1040 <fexpectf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_comma>:
push   %rbx
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
mov    $0x57,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
call   1030 <fexpect@plt>
movsd  0xeb9(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x58,%esi
mov    $0x7,%edx
pop    %rbx
jmp    1040 <fexpectf@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/arith.c\00"
define void @test_comma() {
%1 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 87, i32 3, i32 3)
%2 = call i32 @fexpectf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 88, double 7.000000e+00, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/arith.c\00"
define void @test_comma() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 87, i32 3, i32 3)
%2 = tail call i32 @fexpectf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 88, double 7.000000e+00, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x23() {
  Assert_real((isascii(35)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              180, ("isascii should be 1 for #"));
}


x86 assembly (clang, -O0):
<t_isascii_0x23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x23>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xb4,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for #\00"
define void @t_isascii_0x23() {
%1 = call i32 @isascii(i32 35)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for #\00"
define void @t_isascii_0x23() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char inb(int);
unsigned char uart_getNextByte() { return inb(0x3f8); }


x86 assembly (clang, -O0):
<uart_getNextByte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f8,%edi
call   1030 <inb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getNextByte>:
mov    $0x3f8,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @uart_getNextByte() {
%1 = call zeroext i8 @inb(i32 1016)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @uart_getNextByte() {
%1 = tail call zeroext i8 @inb(i32 1016)
ret i8 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bcdtoi(uint8_t bcd) {
  uint8_t i = 10 * (bcd >> 4) + (bcd & 0x0F);
  return i;
}


x86 assembly (clang, -O0):
<bcdtoi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcdtoi>:
mov    %edi,%eax
sar    $0x4,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @bcdtoi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 4
%6 = mul nsw i32 10, %5
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @bcdtoi(i32 %0) {
%2 = ashr i32 %0, 4
%3 = mul nsw i32 %2, 10
%4 = and i32 %0, 15
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int strContains(char *str, char *key) { return strstr(str, key) != NULL; }


x86 assembly (clang, -O0):
<strContains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strContains>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strContains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32* @strstr(i8* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @strContains(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int fltLt(const void *f1, const void *f2) {
  return (*((float *)f1) < *((float *)f2));
  ;
}


x86 assembly (clang, -O0):
<fltLt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltLt>:
movss  (%rsi),%xmm0
xor    %eax,%eax
ucomiss (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @fltLt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp olt float %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fltLt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ visual;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void *get_XVisualInfo_visual(void *_p) {
  return (void *)((XVisualInfo *)_p)->visual;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XVisualInfo_visual(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
void mcnet_write_int16(uint8_t *out, int16_t in) {
  out[0] = ((in >> 8) & 0xFF);
  out[1] = ((in >> 0) & 0xFF);
}


x86 assembly (clang, -O0):
<mcnet_write_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_write_int16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @mcnet_write_int16(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @mcnet_write_int16(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cksum(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc != 2)
    usage();
  cksum(argv[1], 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1157 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1030 <cksum@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1140 <main+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
call   1030 <cksum@plt>
xor    %edi,%edi
call   1050 <exit@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 ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @cksum(i8* %13, i32 0)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @cksum(i8* %8, i32 0)
%10 = tail call i32 @exit(i32 0)
unreachable
}
__attribute__((section("socket"), used)) int no_relocation() { return 0; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @no_relocation to i8*)], section "llvm.metadata"
define i32 @no_relocation() section "socket" {
ret i32 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @no_relocation to i8*)], section "llvm.metadata"
define i32 @no_relocation() section "socket" {
ret i32 0
}
/* Variables and functions */
scalar_t__ atan(double);
float atanf(float x) { return (float)atan((double)x); }


x86 assembly (clang, -O0):
<atanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <atan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @atan(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @atanf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @atan(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int KMAPI_GetXVersion_MINOR() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @KMAPI_GetXVersion_MINOR() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fd_close(int);
int real_close(int);
int close(int fd) {
  do {
  } while (0);
  fd_close(fd);
  return real_close(fd);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
jmp    1130 <close+0x10>
mov    -0x4(%rbp),%edi
call   1030 <fd_close@plt>
mov    -0x4(%rbp),%edi
call   1040 <real_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
call   1030 <fd_close@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <real_close@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i32, i32* %2
%6 = call i32 @fd_close(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @real_close(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @fd_close(i32 %0)
%3 = tail call i32 @real_close(i32 %0)
ret i32 %3
}
void finish_pending() {
  __asm__ volatile("mfence \n"
                   "wait \n");
}


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

x86 assembly (clang, -O2):
<finish_pending>:
mfence
fwait
ret

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

LLVM IR (-O2):
define void @finish_pending() {
tail call void asm sideeffect "mfence \0Await \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef scalar_t__ cl_context;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clReleaseContext(cl_context context) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)context;
  return (cl_int)syscall(325, 1007, sys_args);
}


x86 assembly (clang, -O0):
<clReleaseContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x3ef,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseContext>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x3ef,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clReleaseContext(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1007, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clReleaseContext(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1007, i32* %5)
ret i32 %6
}
int ls() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(10)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<ls>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls>:
mov    $0xa,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @ls() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_destroy(struct genlist *);
void entry_list_destroy(struct entry_list *tthis) {
  genlist_destroy((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_list_destroy>:
jmp    1030 <genlist_destroy@plt>

LLVM IR (-O0):
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define void @entry_list_destroy(%struct.entry_list* %0) {
%2 = alloca %struct.entry_list*
store %struct.entry_list* %0, %struct.entry_list** %2
%3 = load %struct.entry_list*, %struct.entry_list** %2
%4 = bitcast %struct.entry_list* %3 to %struct.genlist*
%5 = call i32 @genlist_destroy(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define void @entry_list_destroy(%struct.entry_list* %0) {
%2 = bitcast %struct.entry_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_destroy(%struct.genlist* %2)
ret void
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
struct Graph *construct_graph();
int /*<<< orphan*/ fill_adjacency_list(struct Graph *, int);
struct Graph *generate_graph_type_1() {
  struct Graph *graph = construct_graph();
  fill_adjacency_list(graph, 6);
  return graph;
}


x86 assembly (clang, -O0):
<generate_graph_type_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <construct_graph@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <fill_adjacency_list@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_graph_type_1>:
push   %rbx
xor    %eax,%eax
call   1040 <construct_graph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x6,%esi
call   1030 <fill_adjacency_list@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define %struct.Graph* @generate_graph_type_1() {
%1 = alloca %struct.Graph*
%2 = call %struct.Graph* (...) @construct_graph()
store %struct.Graph* %2, %struct.Graph** %1
%3 = load %struct.Graph*, %struct.Graph** %1
%4 = call i32 @fill_adjacency_list(%struct.Graph* %3, i32 6)
%5 = load %struct.Graph*, %struct.Graph** %1
ret %struct.Graph* %5
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define %struct.Graph* @generate_graph_type_1() {
%1 = tail call %struct.Graph* (...) @construct_graph()
%2 = tail call i32 @fill_adjacency_list(%struct.Graph* %1, i32 6)
ret %struct.Graph* %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  for (;;) {
    puts("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 <puts@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %1
}
void echoLine(fmt, arg1, arg2, arg3) char *fmt;
int arg1;
int arg2;
int arg3;
{
  move(0, 0);
  refresh();
  clrtoeol();
  printw(fmt, arg1, arg2, arg3);
  refresh();
}


x86 assembly (clang, -O0):
<echoLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1060 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <move@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <clrtoeol@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @echoLine(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
%10 = call i32 (...) @refresh()
%11 = call i32 (...) @clrtoeol()
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @printw to i32 (i8*, i32, i32, i32, ...)*)(i8* %12, i32 %13, i32 %14, i32 %15)
%17 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @echoLine(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 0, i32 0)
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 (...) @clrtoeol()
%8 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @printw to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2, i32 %3)
%9 = tail call i32 (...) @refresh()
ret void
}
void rcu_read_lock_qsbr(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_read_lock_qsbr() {
ret void
}
void upscale_1_5x_generic_output(void *data, unsigned *out_width,
                                 unsigned *out_height, unsigned width,
                                 unsigned height) {
  *out_width = width + (width >> 1);
  *out_height = height + (height >> 1);
}


x86 assembly (clang, -O0):
<upscale_1_5x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%eax
shr    $0x1,%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x20(%rbp),%eax
shr    $0x1,%eax
add    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upscale_1_5x_generic_output>:
mov    %ecx,%eax
shr    %eax
add    %ecx,%eax
mov    %eax,(%rsi)
mov    %r8d,%eax
shr    %eax
add    %r8d,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @upscale_1_5x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = load i32, i32* %9
%13 = lshr i32 %12, 1
%14 = add i32 %11, %13
%15 = load i32*, i32** %7
store i32 %14, i32* %15
%16 = load i32, i32* %10
%17 = load i32, i32* %10
%18 = lshr i32 %17, 1
%19 = add i32 %16, %18
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @upscale_1_5x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = lshr i32 %3, 1
%7 = add i32 %6, %3
store i32 %7, i32* %1
%8 = lshr i32 %4, 1
%9 = add i32 %8, %4
store i32 %9, i32* %2
ret void
}
void sighdl(int sig __attribute__((unused))) { return; }


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

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

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

LLVM IR (-O2):
define void @sighdl(i32 %0) {
ret void
}
int fun605() { return 605; }


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

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

LLVM IR (-O0):
define i32 @fun605() {
ret i32 605
}

LLVM IR (-O2):
define i32 @fun605() {
ret i32 605
}
void dump_matrix(int **vals, int rows, int cols) {
  int i, j;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      ;
    };
  }
}


x86 assembly (clang, -O0):
<dump_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <dump_matrix+0x5a>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1147 <dump_matrix+0x47>
jmp    1139 <dump_matrix+0x39>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <dump_matrix+0x28>
jmp    114c <dump_matrix+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <dump_matrix+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dump_matrix(i32** nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __unregister_chrdev(unsigned int, int /*<<< orphan*/, int,
                                       char const *);
__attribute__((always_)) void unregister_chrdev(unsigned int major,
                                                const char *name) {
  __unregister_chrdev(major, 0, 256, name);
}


x86 assembly (clang, -O0):
<unregister_chrdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <__unregister_chrdev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unregister_chrdev>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x100,%edx
jmp    1030 <__unregister_chrdev@plt>

LLVM IR (-O0):
define void @unregister_chrdev(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @__unregister_chrdev(i32 %5, i32 0, i32 256, i8* %6)
ret void
}

LLVM IR (-O2):
define void @unregister_chrdev(i32 %0, i8* %1) {
%3 = tail call i32 @__unregister_chrdev(i32 %0, i32 0, i32 256, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emq_route_release(void *);
void emq_route_list_free_handler(void *value) { emq_route_release(value); }


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

x86 assembly (clang, -O2):
<emq_route_list_free_handler>:
jmp    1030 <emq_route_release@plt>

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

LLVM IR (-O2):
define void @emq_route_list_free_handler(i8* %0) {
%2 = tail call i32 @emq_route_release(i8* %0)
ret void
}
void USBDevMode(unsigned long ulBase) {
  ;
  (*((volatile unsigned char *)(ulBase + 0x0000041C))) =
      0x00000002 | 0x00000001;
}


x86 assembly (clang, -O0):
<USBDevMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x3,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevMode>:
movb   $0x3,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBDevMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1052
%5 = inttoptr i64 %4 to i8*
store volatile i8 3, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBDevMode(i64 %0) {
%2 = add i64 %0, 1052
%3 = inttoptr i64 %2 to i8*
store volatile i8 3, i8* %3
ret void
}
int test_imm_EFint32_reg(int val) { return ((val) & (0xEF << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_EFint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xef,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EFint32_reg(i32 %0) {
%2 = and i32 %0, 239
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int pm_bitstomaxval(int const bits) { return (1 << bits) - 1; }


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

x86 assembly (clang, -O2):
<pm_bitstomaxval>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @pm_bitstomaxval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @pm_bitstomaxval(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
int charcmp(char *x, char *y) { return (int)*x - *y; }


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

x86 assembly (clang, -O2):
<charcmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @charcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @charcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bf10(int c) {
  int i;
  for (i = 0; i < c; i++) {
    printf("+");
  }
}


x86 assembly (clang, -O0):
<bf10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <bf10+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <bf10+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf10>:
push   %rbx
test   %edi,%edi
jle    112f <bf10+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2b,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <bf10+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bf10(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 43)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void startDescribeFunHeader(const char *descr) {
  printf("/*******************************************************\n");
  printf(" * \n");
  printf(" * %s \n", descr);
  printf(" * \n");
}


x86 assembly (clang, -O0):
<startDescribeFunHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startDescribeFunHeader>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.2 = [8 x i8] c" * %s \0A\00"
@str = [57 x i8] c"/*******************************************************\00"
@str.4 = [4 x i8] c" * \00"
define void @startDescribeFunHeader(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_nl();
int /*<<< orphan*/ print_str(char *);
void print_str_nl(char *str) {
  print_str(str);
  print_nl();
}


x86 assembly (clang, -O0):
<print_str_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <print_str@plt>
mov    $0x0,%al
call   1030 <print_nl@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_str_nl(i8* %0) {
%2 = tail call i32 @print_str(i8* %0)
%3 = tail call i32 (...) @print_nl()
ret void
}