xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void GiveInstructions(void) {
  printf("Enter numbers, one per line, ending with the\n");
  printf("sentinel value %d.  The program will then\n", 0);
  printf("display those values in reverse order.\n");
}


x86 assembly (clang, -O0):
<GiveInstructions>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GiveInstructions>:
push   %rax
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Enter numbers, one per line, ending with the\0A\00"
@.str.1 = [43 x i8] c"sentinel value %d. The program will then\0A\00"
@.str.2 = [40 x i8] c"display those values in reverse order.\0A\00"
define void @GiveInstructions() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [43 x i8] c"sentinel value %d. The program will then\0A\00"
@str = [45 x i8] c"Enter numbers, one per line, ending with the\00"
@str.3 = [39 x i8] c"display those values in reverse order.\00"
define void @GiveInstructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ not_implemented_error();
void primitive_os_envs(void) { not_implemented_error(); }


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

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

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

LLVM IR (-O2):
define void @primitive_os_envs() {
%1 = tail call i32 (...) @not_implemented_error()
ret void
}
void _init_stack() {}


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

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

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

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

/* Variables and functions */
int *_func_in_cond_input(struct struct_automata *, int *, int *, int,
                         int /*<<< orphan*/);
int *func_in_cond_input(struct struct_automata *p, int *stat_p, int *input_p,
                        int mode) {
  return _func_in_cond_input(p, stat_p, input_p, mode, 0);
}


x86 assembly (clang, -O0):
<func_in_cond_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <_func_in_cond_input@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_in_cond_input>:
xor    %r8d,%r8d
jmp    1030 <_func_in_cond_input@plt>

LLVM IR (-O0):
%struct.struct_automata = type { i32 }
define i32* @func_in_cond_input(%struct.struct_automata* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca %struct.struct_automata*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store %struct.struct_automata* %0, %struct.struct_automata** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load %struct.struct_automata*, %struct.struct_automata** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32* @_func_in_cond_input(%struct.struct_automata* %9, i32* %10, i32* %11, i32 %12, i32 0)
ret i32* %13
}

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
define i32* @func_in_cond_input(%struct.struct_automata* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32* @_func_in_cond_input(%struct.struct_automata* %0, i32* %1, i32* %2, i32 %3, i32 0)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ safe_close(int);
void close_pipe(int fildes[2]) {
  safe_close(fildes[0]);
  safe_close(fildes[1]);
}


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

x86 assembly (clang, -O2):
<close_pipe>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <safe_close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <safe_close@plt>

LLVM IR (-O0):
define void @close_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @safe_close(i32 %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = call i32 @safe_close(i32 %9)
ret void
}

LLVM IR (-O2):
define void @close_pipe(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @safe_close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @safe_close(i32 %5)
ret void
}
int cmp_float_des(const void *x, const void *y) {
  if (*(float *)x > *(float *)y) {
    return -1;
  } else if (*(float *)x < *(float *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_float_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <cmp_float_des+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <cmp_float_des+0x5e>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <cmp_float_des+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <cmp_float_des+0x5e>
jmp    1157 <cmp_float_des+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_float_des>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
ucomiss %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_float_des(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 ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
__attribute__((always_)) unsigned int cpuid_edx(unsigned int op) {
  unsigned int eax, edx;
  __asm__("cpuid" : "=a"(eax), "=d"(edx) : "0"(op) : "bx", "cx");
  return edx;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "cpuid", "={ax},={dx},0,~{bx},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = tail call { i32, i32 } asm "cpuid", "={ax},={dx},0,~{bx},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
/* Variables and functions */
bool nrf52_errata_29(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_29() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cglit(int v) { ngen("%s\tax,%d", "mov", v); }


x86 assembly (clang, -O0):
<cglit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cglit>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee9(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09ax,%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cglit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09ax,%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cglit(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void foo_1_2_2_1_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_2_1_1_2() {
ret void
}
int test_imm_4Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x4E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Euint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 78
%7 = icmp ne i64 %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_4Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5111808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC18F67J94_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F67J94_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F67J94_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC18F67J94_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F67J94_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar20(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 20, v);
}


x86 assembly (clang, -O0):
<setDrawbar20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x14,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar20>:
mov    %esi,%edx
mov    $0x14,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar20(i8* %0, i8 zeroext %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 %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 20, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar20(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 20, i8 zeroext %1)
ret void
}
unsigned short get16(const void *buf_, unsigned offset) {
  unsigned char *buf = (unsigned char *)buf_ + offset;
  return buf[0] | (buf[1] << 8);
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
mov    %esi,%eax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @get16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @get16(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = shl nuw i16 %9, 8
%11 = or i16 %10, %6
ret i16 %11
}
void io_wait(void) { __asm__ volatile("outb %%al, $0x80" : : "a"(0)); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
xor    %eax,%eax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "outb %al, $$0x80", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
int map_parameter_meterological_nuclear_radiology(int center, int disc,
                                                  int param_cat,
                                                  int param_num) {
  (void)(center);
  (void)(disc);
  (void)(param_cat);
  (void)(param_num);
  return -1;
}


x86 assembly (clang, -O0):
<map_parameter_meterological_nuclear_radiology>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @map_parameter_meterological_nuclear_radiology(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @map_parameter_meterological_nuclear_radiology(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 -1
}
int popcount(int x) { return __builtin_popcount(x); }


x86 assembly (clang, -O0):
<popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @popcount(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
ret i32 %2
}
float celsius_to_kelvin(float temperature) { return temperature + 273.15; }


x86 assembly (clang, -O0):
<celsius_to_kelvin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_kelvin>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius_to_kelvin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 2.731500e+02
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @celsius_to_kelvin(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 2.731500e+02
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ position(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void clearscreen(void) {
  printf("\033[2J");
  position(0, 0);
}


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <position@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <position@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @clearscreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @position(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clearscreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @position(i32 0, i32 0)
ret void
}
int numa_num_configured_nodes() { return 1; }


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

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

LLVM IR (-O0):
define i32 @numa_num_configured_nodes() {
ret i32 1
}

LLVM IR (-O2):
define i32 @numa_num_configured_nodes() {
ret i32 1
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int feedback(const char *msg, void *cc) {
  if (cc == NULL) {
    return -1;
  }
  return fprintf(stdout, "\r[CHAT] %s\n", msg);
}


x86 assembly (clang, -O0):
<feedback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <feedback+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <feedback+0x43>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feedback>:
test   %rsi,%rsi
je     112d <feedback+0x1d>
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"\0D[CHAT] %s\0A\00"
define i32 @feedback(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"\0D[CHAT] %s\0A\00"
define i32 @feedback(i8* %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *execname) {
  printf("Usage: %s [-f fifo] [-h]\n"
         "  -f fifo | Path to fifo file to monitor\n"
         "  -d      | Display the contents of the fifo to stdout\n"
         "  -h      | This help message\n",
         execname);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [152 x i8] c"Usage: %s [-f fifo] [-h]\0A -f fifo | Path to fifo file to monitor\0A -d | Display the contents of the fifo to stdout\0A -h | This help message\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [152 x i8] c"Usage: %s [-f fifo] [-h]\0A -f fifo | Path to fifo file to monitor\0A -d | Display the contents of the fifo to stdout\0A -h | This help message\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int times2(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<times2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @times2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, unsigned long *);
void http_nonblock_socket(int sk) {
  unsigned long fc = 1;
  ioctl(sk, FIONBIO, &fc);
}


x86 assembly (clang, -O0):
<http_nonblock_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_nonblock_socket>:
push   %rax
movq   $0x1,(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rax
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define void @http_nonblock_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 1, i64* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %4, i32 %5, i64* %3)
ret void
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define void @http_nonblock_socket(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 1, i64* %2
%4 = load i32, i32* @FIONBIO
%5 = call i32 @ioctl(i32 %0, i32 %4, i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int CmdQuit(const char *Cmd) {
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<CmdQuit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<CmdQuit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @CmdQuit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @CmdQuit(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long double __qint(long double);
long double intr_wrap_329(long double p1) { return __qint(p1); }


x86 assembly (clang, -O0):
<intr_wrap_329>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_329>:
jmp    1030 <__qint@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_329(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qint(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
double P1_z(double, double, double, double);
double P3_x(double sign, double xi, double et, double qq) {
  return P1_z(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<P3_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <P1_z@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P3_x>:
jmp    1030 <P1_z@plt>

LLVM IR (-O0):
define double @P3_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @P1_z(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @P3_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @P1_z(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int EOF;
int EnvGetcRouter(void *, char *);
int /*<<< orphan*/ ExpandCommandString(void *, char);
int DefaultGetNextEvent(void *theEnv) {
  int inchar;
  inchar = EnvGetcRouter(theEnv, "stdin");
  if (inchar == EOF)
    inchar = '\n';
  ExpandCommandString(theEnv, (char)inchar);
  return 0;
}


x86 assembly (clang, -O0):
<DefaultGetNextEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <EnvGetcRouter@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
jne    1158 <DefaultGetNextEvent+0x38>
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%esi
call   1040 <ExpandCommandString@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefaultGetNextEvent>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <EnvGetcRouter@plt>
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%eax
mov    $0xa,%ecx
cmovne %eax,%ecx
movsbl %cl,%esi
mov    %rbx,%rdi
call   1040 <ExpandCommandString@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"stdin\00"
@EOF = global i32 0
define i32 @DefaultGetNextEvent(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @EnvGetcRouter(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 10, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
%14 = call i32 @ExpandCommandString(i8* %11, i8 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"stdin\00"
@EOF = global i32 0
define i32 @DefaultGetNextEvent(i8* %0) {
%2 = tail call i32 @EnvGetcRouter(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
%5 = trunc i32 %2 to i8
%6 = select i1 %4, i8 10, i8 %5
%7 = tail call i32 @ExpandCommandString(i8* %0, i8 signext %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
char *error_message(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_error(int ok) {
  char *message = error_message(ok);
  if (errno != 0) {
    fprintf(stderr, "\nERROR: %s: %m.\n", message);
  } else {
    fprintf(stderr, "\nERROR: %s.\n", message);
  }
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <error_message@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
cmpq   $0x0,(%rax)
je     1166 <print_error+0x46>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
jmp    117f <print_error+0x5f>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rax
call   1040 <error_message@plt>
mov    0x2eab(%rip),%rcx
cmpq   $0x0,(%rcx)
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edi
lea    0xed0(%rip),%rcx
lea    0xeb8(%rip),%rsi
cmove  %rcx,%rsi
mov    %rax,%rdx
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [17 x i8] c"\0AERROR: %s: %m.\0A\00"
@.str.1 = [13 x i8] c"\0AERROR: %s.\0A\00"
define void @print_error(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @error_message(i32 %4)
store i8* %5, i8** %3
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %16
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [17 x i8] c"\0AERROR: %s: %m.\0A\00"
@.str.1 = [13 x i8] c"\0AERROR: %s.\0A\00"
define void @print_error(i32 %0) {
%2 = tail call i8* @error_message(i32 %0)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @stderr
%6 = select i1 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @fprintf(i32 %5, i8* %6, i8* %2)
ret void
}
/* Variables and functions */
int __simc(int, int, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int simc_open(char *file, int flags, int mode) {
  return __simc(5, (int)file, flags, mode, 0, 0);
}


x86 assembly (clang, -O0):
<simc_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x5,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <__simc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simc_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x5,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <__simc@plt>

LLVM IR (-O0):
define i32 @simc_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @__simc(i32 5, i32 %8, i32 %9, i32 %10, i32 0, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @simc_open(i8* %0, i32 %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__simc(i32 5, i32 %5, i32 %1, i32 %2, i32 0, i32 0)
ret i32 %6
}
/* Variables and functions */
int f271(int *);
int f272(int *p) { return f271(p); }


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

x86 assembly (clang, -O2):
<f272>:
jmp    1030 <f271@plt>

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

LLVM IR (-O2):
define i32 @f272(i32* %0) {
%2 = tail call i32 @f271(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
void dosth(jmp_buf *buf) { longjmp(*buf, 2); }


x86 assembly (clang, -O0):
<dosth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x2,%esi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<dosth>:
push   %rax
mov    (%rdi),%edi
mov    $0x2,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
define void @dosth(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @longjmp(i32 %4, i32 2)
unreachable
}

LLVM IR (-O2):
define void @dosth(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @longjmp(i32 %2, i32 2)
unreachable
}
void gdk_x11_atom_to_xatom() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_atom_to_xatom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ queens(int, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n, k = 1;
  printf("enter the number of queens\n");
  scanf("%d", &n);
  queens(k, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <queens@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    $0x1,%edi
call   1030 <queens@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"enter the number of queens\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @queens(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [27 x i8] c"enter the number of queens\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @queens(i32 1, i32 %5)
ret i32 0
}
main() {
  int i = 1;
  __typeof(int) i2 = 2;
  __typeof(i) i3 = 3;
  __typeof(*(int *)0) i4 = 4;
  __typeof(i4) i5 = 5;
  __typeof(i5) i6 = 6;
  typedef int int_t;
  int_t a = 7;
  typedef int_t int_t2;
  int_t2 b = 8;
  typedef int_t2 int_t3;
  int_t3 c = 9;
  __typeof(int_t3) d = 10;
  assert(i + i2 + i3 + i4 + i5 + i6 + a + b + c + d == 55);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
movl   $0x9,-0x24(%rbp)
movl   $0xa,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
cmp    $0x37,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
store i32 5, i32* %5
store i32 6, i32* %6
store i32 7, i32* %7
store i32 8, i32* %8
store i32 9, i32* %9
store i32 10, i32* %10
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %9
%27 = add nsw i32 %25, %26
%28 = load i32, i32* %10
%29 = add nsw i32 %27, %28
%30 = icmp eq i32 %29, 55
%31 = zext i1 %30 to i32
%32 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %31)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
char *field_from_line(char const *, int);
int /*<<< orphan*/ free(char *);
int int_field_from_line(const char *line, int field) {
  char *tmp;
  int retval;
  tmp = field_from_line(line, field);
  if (tmp) {
    retval = atoi(tmp);
    free(tmp);
    return retval;
  }
  return -1;
}


x86 assembly (clang, -O0):
<int_field_from_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <field_from_line@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117a <int_field_from_line+0x4a>
mov    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <int_field_from_line+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_field_from_line>:
push   %rbp
push   %rbx
push   %rax
call   1040 <field_from_line@plt>
test   %rax,%rax
je     1156 <int_field_from_line+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <int_field_from_line+0x2b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @int_field_from_line(i8* %0, i32 %1) {
%3 = tail call i8* @field_from_line(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_int(int signo) { printf("interrupt no: %d\n", signo); }


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

x86 assembly (clang, -O2):
<sig_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"interrupt no: %d\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"interrupt no: %d\0A\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *jsonCmd(char *, int);
char *jsonCmdGetStatus(void) { return (jsonCmd("getstatus", 1)); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"getstatus\00"
define i8* @jsonCmdGetStatus() {
%1 = call i8* @jsonCmd(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"getstatus\00"
define i8* @jsonCmdGetStatus() {
%1 = tail call i8* @jsonCmd(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}
int tcflush(int fd, int qs) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tcflush(i32 %0, i32 %1) {
ret i32 0
}
OP(ed, cd) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_WORM(struct list_head *);
uint8_t set_3592_WORM(struct list_head *m) {
  ;
  return set_WORM(m);
}


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

x86 assembly (clang, -O2):
<set_3592_WORM>:
jmp    1030 <set_WORM@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_3592_WORM(%struct.list_head* %0) {
%2 = tail call i32 @set_WORM(%struct.list_head* %0)
ret i32 %2
}
/* Variables and functions */
int _timeofday(int, void *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_timeofday(int cmd, void *arg) {
  int ret;
  monLock();
  ret = _timeofday(cmd, arg);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_timeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_timeofday@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_timeofday>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <_timeofday@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_timeofday(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 (...) @monLock()
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @_timeofday(i32 %7, i8* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_timeofday(i32 %0, i8* %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_timeofday(i32 %0, i8* %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_autospawn_lock_acquire() {
  printf("NOT IMPLEMENTED:"
         "pa_autospawn_lock_acquire"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_autospawn_lock_acquire\0A\00"
define i32 @pa_autospawn_lock_acquire() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_autospawn_lock_acquire\00"
define i32 @pa_autospawn_lock_acquire() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}