xunge/DecIR huggingface dataset:
/* Variables and functions */
char const *frame_str(char *, char const *);
const char *blob_path(const char *game) { return frame_str("%s.blob", game); }


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

x86 assembly (clang, -O2):
<blob_path>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <frame_str@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s.blob\00"
define i8* @blob_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @frame_str(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s.blob\00"
define i8* @blob_path(i8* %0) {
%2 = tail call i8* @frame_str(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
bool nrf_drv_usb_errata_199(void) { return (1 && true); }


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

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

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

LLVM IR (-O2):
define i32 @nrf_drv_usb_errata_199() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @test_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void and_eax_imm32(unsigned int imm32) {
  put8(0x25);
  put32(imm32);
}


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

x86 assembly (clang, -O2):
<and_eax_imm32>:
push   %rbx
mov    %edi,%ebx
mov    $0x25,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @and_eax_imm32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 37)
%4 = load i32, i32* %2
%5 = call i32 @put32(i32 %4)
ret void
}

LLVM IR (-O2):
define void @and_eax_imm32(i32 %0) {
%2 = tail call i32 @put8(i32 37)
%3 = tail call i32 @put32(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  while (scanf("%d", &n) != EOF)
    printf("%c", (char)n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     116d <main+0x4d>
mov    -0x14(%rbp),%eax
lea    0xea3(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
je     117e <main+0x5e>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
movsbl 0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %15, label %8
8: ; preds = %2, %8
%9 = load i32, i32* %3
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret i32 0
}
void vec_func(double y[], double x[], double n, double (*f)(double)) {
  int i;
  for (i = 0; i < n; ++i) {
    y[i] = (*f)(x[i]);
  }
}


x86 assembly (clang, -O0):
<vec_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <vec_func+0x62>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
call   *%rax
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1120 <vec_func+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_func>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1155 <vec_func+0x55>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
movsd  %xmm1,(%rsp)
cs nopw 0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   *%r14
movsd  (%rsp),%xmm1
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
ucomisd %xmm0,%xmm1
ja     1130 <vec_func+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vec_func(double* %0, double* %1, double %2, double (double)* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double (double)*
%9 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double %2, double* %7
store double (double)* %3, double (double)** %8
store i32 0, i32* %9
br label %10
10: ; preds = %27, %4
%11 = load i32, i32* %9
%12 = sitofp i32 %11 to double
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %30
15: ; preds = %10
%16 = load double (double)*, double (double)** %8
%17 = load double*, double** %6
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = call double %16(double %21)
%23 = load double*, double** %5
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
br label %27
27: ; preds = %15
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %10
30: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @vec_func(double* nocapture writeonly %0, double* nocapture %1, double %2, double (double)* nocapture %3) {
%5 = fcmp ogt double %2, 0.000000e+00
br i1 %5, label %6, label %16
6: ; preds = %4, %6
%7 = phi i64 [ %12, %6 ], [ 0, %4 ]
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = tail call double %3(double %9)
%11 = getelementptr inbounds double, double* %0, i64 %7
store double %10, double* %11
%12 = add nuw i64 %7, 1
%13 = trunc i64 %12 to i32
%14 = sitofp i32 %13 to double
%15 = fcmp olt double %14, %2
br i1 %15, label %6, label %16
16: ; preds = %6, %4
ret void
}
void ThreadAPI_Sleep(unsigned int milliseconds) {}


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

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

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

LLVM IR (-O2):
define void @ThreadAPI_Sleep(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
char const *inet_ntoa(struct in_addr);
const char *my_inet_ntoa(uint32_t addr) {
  struct in_addr a;
  a.s_addr = addr;
  return inet_ntoa(a);
}


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

x86 assembly (clang, -O2):
<my_inet_ntoa>:
jmp    1030 <inet_ntoa@plt>

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

LLVM IR (-O2):
define i8* @my_inet_ntoa(i32 %0) {
%2 = tail call i8* @inet_ntoa(i32 %0)
ret i8* %2
}
int effect_wait_update(struct razer_fx_render_node *render) { return (1); }


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

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

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

LLVM IR (-O2):
%struct.razer_fx_render_node = type opaque
define i32 @effect_wait_update(%struct.razer_fx_render_node* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ hal_write(int, char const *, int);
void console_nprint(const char *str, int size) { hal_write(1, str, size); }


x86 assembly (clang, -O0):
<console_nprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <hal_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_nprint>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <hal_write@plt>

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

LLVM IR (-O2):
define void @console_nprint(i8* %0, i32 %1) {
%3 = tail call i32 @hal_write(i32 1, i8* %0, i32 %1)
ret void
}
int((access_transport_receive))(struct ss7 *ss7, struct isup_call *c,
                                int messagetype, unsigned char *parm, int len) {
  return len;
}


x86 assembly (clang, -O0):
<access_transport_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<access_transport_receive>:
mov    %r8d,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @access_transport_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @access_transport_receive(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 returned %4) {
ret i32 %4
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_cmdc2_lfo_delay(struct fmdriver_work *,
                                       struct driver_pmd *, struct pmd_part *);
int /*<<< orphan*/ pmd_part_lfo_flip(struct pmd_part *);
void pmd_cmdb9_lfo2_delay(struct fmdriver_work *work, struct driver_pmd *pmd,
                          struct pmd_part *part) {
  pmd_part_lfo_flip(part);
  pmd_cmdc2_lfo_delay(work, pmd, part);
  pmd_part_lfo_flip(part);
}


x86 assembly (clang, -O0):
<pmd_cmdb9_lfo2_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <pmd_part_lfo_flip@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <pmd_cmdc2_lfo_delay@plt>
mov    -0x18(%rbp),%rdi
call   1030 <pmd_part_lfo_flip@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmd_cmdb9_lfo2_delay>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <pmd_part_lfo_flip@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <pmd_cmdc2_lfo_delay@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pmd_part_lfo_flip@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdb9_lfo2_delay(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.pmd_part*, %struct.pmd_part** %6
%8 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %7)
%9 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%10 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%11 = load %struct.pmd_part*, %struct.pmd_part** %6
%12 = call i32 @pmd_cmdc2_lfo_delay(%struct.fmdriver_work* %9, %struct.driver_pmd* %10, %struct.pmd_part* %11)
%13 = load %struct.pmd_part*, %struct.pmd_part** %6
%14 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %13)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdb9_lfo2_delay(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
%5 = tail call i32 @pmd_cmdc2_lfo_delay(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2)
%6 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op7c(void) { CX4_immediate_reg(45); }


x86 assembly (clang, -O0):
<CX4_op7c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <CX4_immediate_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op7c>:
mov    $0x2d,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op7c() {
%1 = call i32 @CX4_immediate_reg(i32 45)
ret void
}

LLVM IR (-O2):
define void @CX4_op7c() {
%1 = tail call i32 @CX4_immediate_reg(i32 45)
ret void
}
cbuf26(f, n) int f, n;
{ cbuf(f, n, 26); }


x86 assembly (clang, -O0):
<cbuf26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1a,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf26>:
mov    $0x1a,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf26(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* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 26)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf26(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 26)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int students;
  int *studentsp;
  students = 12;
  studentsp = &students;
  printf("students: %d\n", students);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"students: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
void HI_RegWrite32(unsigned long value, unsigned long mask,
                   unsigned long addr) {
  unsigned long t;
  t = readl((const volatile void *)addr);
  t &= ~mask;
  t |= value & mask;
  writel(t, (volatile void *)addr);
}


x86 assembly (clang, -O0):
<HI_RegWrite32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <readl@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <writel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HI_RegWrite32>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <readl@plt>
cltq
xor    %rax,%rbx
and    %r14,%rbx
xor    %rax,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @HI_RegWrite32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = inttoptr i64 %8 to i8*
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @readl to i32 (i8*, ...)*)(i8* %9)
%11 = sext i32 %10 to i64
store i64 %11, i64* %7
%12 = load i64, i64* %5
%13 = xor i64 %12, -1
%14 = load i64, i64* %7
%15 = and i64 %14, %13
store i64 %15, i64* %7
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = and i64 %16, %17
%19 = load i64, i64* %7
%20 = or i64 %19, %18
store i64 %20, i64* %7
%21 = load i64, i64* %7
%22 = load i64, i64* %6
%23 = inttoptr i64 %22 to i8*
%24 = call i32 (i64, i8*, ...) bitcast (i32 (...)* @writel to i32 (i64, i8*, ...)*)(i64 %21, i8* %23)
ret void
}

LLVM IR (-O2):
define void @HI_RegWrite32(i64 %0, i64 %1, i64 %2) {
%4 = inttoptr i64 %2 to i8*
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @readl to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = xor i64 %1, -1
%8 = and i64 %6, %7
%9 = and i64 %1, %0
%10 = or i64 %8, %9
%11 = tail call i32 (i64, i8*, ...) bitcast (i32 (...)* @writel to i32 (i64, i8*, ...)*)(i64 %10, i8* %4)
ret void
}
short __ocl_rhadd_short(short src1, short src2) {
  short carry = (src1 & 1) | (src2 & 1);
  return (src1 >> 1) + (src2 >> 1) + carry;
}


x86 assembly (clang, -O0):
<__ocl_rhadd_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
and    $0x1,%eax
movswl -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x1,%eax
movswl -0x4(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_rhadd_short>:
mov    %esi,%eax
or     %edi,%eax
and    $0x1,%eax
sar    %edi
sar    %esi
add    %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @__ocl_rhadd_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = and i32 %7, 1
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = and i32 %10, 1
%12 = or i32 %8, %11
%13 = trunc i32 %12 to i16
store i16 %13, i16* %5
%14 = load i16, i16* %3
%15 = sext i16 %14 to i32
%16 = ashr i32 %15, 1
%17 = load i16, i16* %4
%18 = sext i16 %17 to i32
%19 = ashr i32 %18, 1
%20 = add nsw i32 %16, %19
%21 = load i16, i16* %5
%22 = sext i16 %21 to i32
%23 = add nsw i32 %20, %22
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @__ocl_rhadd_short(i16 signext %0, i16 signext %1) {
%3 = or i16 %1, %0
%4 = and i16 %3, 1
%5 = ashr i16 %0, 1
%6 = ashr i16 %1, 1
%7 = add nsw i16 %6, %5
%8 = add nsw i16 %7, %4
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void unknown(FILE *client_write) {
  fputs("Unknown Request!", client_write);
  fflush(client_write);
  fclose(client_write);
}


x86 assembly (clang, -O0):
<unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Unknown Request!\00"
define void @unknown(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fflush(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Unknown Request!\00"
define void @unknown(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
%4 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void build_command_key(char *key, char *command) {
  snprintf(key, 50, "%s#%s", "PRIVMSG", command);
}


x86 assembly (clang, -O0):
<build_command_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%r8
mov    $0x32,%esi
lea    0xecc(%rip),%rdx
lea    0xecb(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_command_key>:
mov    %rsi,%r8
lea    0xee6(%rip),%rdx
lea    0xee5(%rip),%rcx
mov    $0x32,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s#%s\00"
@.str.1 = [8 x i8] c"PRIVMSG\00"
define void @build_command_key(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 @snprintf(i8* %5, i32 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s#%s\00"
@.str.1 = [8 x i8] c"PRIVMSG\00"
define void @build_command_key(i8* %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
uint32_t get_uint32(const void *p) {
  uint32_t x;
  memcpy((void *)&x, p, sizeof(x));
  return x;
}


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

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

LLVM IR (-O0):
define i32 @get_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = bitcast i32* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 4)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_uint32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
double vmir_vm_arg_dbl(const void **rfp) {
  const void *rf = *rfp = *rfp - 8;
  return *(double *)rf;
}


x86 assembly (clang, -O0):
<vmir_vm_arg_dbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffff8,%rax
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmir_vm_arg_dbl>:
mov    (%rdi),%rax
lea    -0x8(%rax),%rcx
mov    %rcx,(%rdi)
movsd  -0x8(%rax),%xmm0
ret

LLVM IR (-O0):
define double @vmir_vm_arg_dbl(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr i8, i8* %5, i64 -8
%7 = load i8**, i8*** %2
store i8* %6, i8** %7
store i8* %6, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @vmir_vm_arg_dbl(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 -8
store i8* %3, i8** %0
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
ret double %5
}
/* Variables and functions */
void *calloc(unsigned long, unsigned int);
int /*<<< orphan*/ free(void *);
void f4(int i) {
  unsigned long j;
  j = 10;
  if (i > 0) {
    void *ptr = calloc(j, (unsigned)i);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1156 <f4+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
test   %edi,%edi
jle    113a <f4+0x1a>
push   %rax
mov    %edi,%esi
mov    $0xa,%edi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
store i64 10, i64* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = call i8* @calloc(i64 %8, i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i8* @calloc(i64 10, i32 %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
int main() {
  int test_int;
  unsigned long test;
  test = (unsigned long)test_int;
  if (!(test + 256UL)) {
    goto ERROR;
  ERROR:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x100,%rax
cmp    $0x0,%rax
jne    1138 <main+0x38>
jmp    112c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = add i64 %6, 256
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
br label %10
10: ; preds = %9
store i32 -1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *timlib_dollar_string(double amount) {
  char return_string[64];
  sprintf(return_string, "%.2lf", amount);
  return place_commas_in_number_string(return_string);
}


x86 assembly (clang, -O0):
<timlib_dollar_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_dollar_string>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2lf\00"
define i8* @timlib_dollar_string(double %0) {
%2 = alloca double
%3 = alloca [64 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i8* @place_commas_in_number_string(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2lf\00"
define i8* @timlib_dollar_string(double %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i8* @place_commas_in_number_string(i8* %3)
ret i8* %5
}
/* Variables and functions */
int dwarf_get_VIRTUALITY_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_VIRTUALITY_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_VIRTUALITY_name(val_in, &v);
  return ellipname(res, val_in, v, "VIRTUALITY", printonerr);
}


x86 assembly (clang, -O0):
<get_VIRTUALITY_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_VIRTUALITY_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_VIRTUALITY_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_VIRTUALITY_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"VIRTUALITY\00"
define i8* @get_VIRTUALITY_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_VIRTUALITY_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"VIRTUALITY\00"
define i8* @get_VIRTUALITY_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_VIRTUALITY_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
char eq2(long d11, long d12, long d21, long d22) {
  return ((d11 == d21) && (d12 == d22));
}


x86 assembly (clang, -O0):
<eq2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jne    1135 <eq2+0x35>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq2>:
xor    %rdx,%rdi
xor    %rcx,%rsi
or     %rdi,%rsi
sete   %al
ret

LLVM IR (-O0):
define signext i8 @eq2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %7
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i64, i64* %6
%14 = load i64, i64* %8
%15 = icmp eq i64 %13, %14
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @eq2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %0, %2
%6 = icmp eq i64 %1, %3
%7 = and i1 %5, %6
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ _mulx_u32(unsigned int, unsigned int, unsigned int *);
__attribute__((no)) unsigned calc_mulx_u32(unsigned x, unsigned y,
                                           unsigned *res_h) {
  return (unsigned)_mulx_u32(x, y, res_h);
}


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

x86 assembly (clang, -O2):
<calc_mulx_u32>:
jmp    1030 <_mulx_u32@plt>

LLVM IR (-O0):
define i32 @calc_mulx_u32(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @_mulx_u32(i32 %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @calc_mulx_u32(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @_mulx_u32(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
uint32_t __int32_t_encoded_array_size(const int32_t *p, uint32_t elements) {
  (void)p;
  return (4) * elements;
}


x86 assembly (clang, -O0):
<__int32_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int32_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @__int32_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl nsw i32 %1, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int /*<<< orphan*/, char *, int);
void console_buffer_open(void) {
  if (write(STDOUT_FILENO, "\x1b[?47h", 6) == -1) {
    perror("Write to stdout failed");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<console_buffer_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1171 <console_buffer_open+0x41>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_buffer_open>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     1152 <console_buffer_open+0x22>
pop    %rax
ret
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"\1B[?47h\00"
@.str.1 = [23 x i8] c"Write to stdout failed\00"
@EXIT_FAILURE = global i32 0
define void @console_buffer_open() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"\1B[?47h\00"
@.str.1 = [23 x i8] c"Write to stdout failed\00"
@EXIT_FAILURE = global i32 0
define void @console_buffer_open() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
int main() {
  int i, a[5];
  for (i = 0; i < sizeof(a); i++)
    a[i] = i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x14,%rax
jae    1139 <main+0x39>
mov    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 20
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %11
store i32 %9, i32* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned xrop3_38_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_38_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_38_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_38_1_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
int ceilX(float x) {
  int i = (int)x;
  if (i == x)
    return i;
  return (i + 1);
}


x86 assembly (clang, -O0):
<ceilX>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1131 <ceilX+0x31>
jp     1131 <ceilX+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <ceilX+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilX>:
cvttss2si %xmm0,%eax
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceilX(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %3
%10 = fcmp oeq float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ceilX(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp une float %3, %0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %2
ret i32 %6
}
unsigned char FPT_scvalq(unsigned char p_quintet) {
  unsigned char count;
  for (count = 1; count < 0x08; count <<= 1) {
    if (!(p_quintet & count))
      p_quintet -= 0x80;
  }
  if (p_quintet & 0x18)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<FPT_scvalq>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movb   $0x1,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x8,%eax
jge    114e <FPT_scvalq+0x4e>
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113a <FPT_scvalq+0x3a>
movzbl -0x2(%rbp),%eax
sub    $0x80,%eax
mov    %al,-0x2(%rbp)
jmp    113f <FPT_scvalq+0x3f>
movzbl -0x3(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x3(%rbp)
jmp    110e <FPT_scvalq+0xe>
movzbl -0x2(%rbp),%eax
and    $0x18,%eax
cmp    $0x0,%eax
je     1167 <FPT_scvalq+0x67>
movb   $0x0,-0x1(%rbp)
jmp    116b <FPT_scvalq+0x6b>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPT_scvalq>:
test   $0x18,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @FPT_scvalq(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 1, i8* %4
br label %5
5: ; preds = %22, %1
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %9
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 128
%20 = trunc i32 %19 to i8
store i8 %20, i8* %3
br label %21
21: ; preds = %16, %9
br label %22
22: ; preds = %21
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
br label %5
27: ; preds = %5
%28 = load i8, i8* %3
%29 = zext i8 %28 to i32
%30 = and i32 %29, 24
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %27
store i8 0, i8* %2
br label %34
33: ; preds = %27
store i8 1, i8* %2
br label %34
34: ; preds = %33, %32
%35 = load i8, i8* %2
ret i8 %35
}

LLVM IR (-O2):
define zeroext i8 @FPT_scvalq(i8 zeroext %0) {
%2 = and i8 %0, 24
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i8
ret i8 %4
}
void __attribute__((used)) f0(void) {}


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

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

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

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @f0 to i8*)], section "llvm.metadata"
define void @f0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ two();
int main(int argc, char *argv[]) { two(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <two@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <two@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @two()
ret i32 0
}