xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int x_fun() {
  printf("hello, world\n");
  return 5;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @x_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test8();
int main(int argc, char **argv) {
  if (!test8())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test8@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test8@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test8()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test8()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
void ASN1_item_ex_d2i(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_ex_d2i() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int get_bit(uint8_t *x, int bit_num) { return ((*x & (1 << (bit_num)))); }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_bit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 __sw32(__u32 x) {
  __u32 v = x;
  return v << 24 | (v & (__u32)0x0000ff00UL) << 8 |
         (v & (__u32)0x00ff0000UL) >> 8 | v >> 24;
}


x86 assembly (clang, -O0):
<__sw32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sw32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__sw32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = shl i32 %5, 24
%7 = load i32, i32* %3
%8 = and i32 %7, 65280
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %3
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %3
%16 = ashr i32 %15, 24
%17 = or i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__sw32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int rom_present(char *);
int ega_standalone_available() {
  return rom_present("ibm_6277356_ega_card_u44_27128.bin");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"ibm_6277356_ega_card_u44_27128.bin\00"
define i32 @ega_standalone_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i8] c"ibm_6277356_ega_card_u44_27128.bin\00"
define i32 @ega_standalone_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_vinfo_header();
void fgmvwrite_vinfo_header_() { gmvwrite_vinfo_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_vinfo_header_() {
%1 = tail call i32 (...) @gmvwrite_vinfo_header()
ret void
}
void UART3_TX_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART3_TX_intr() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_tw(uint32_t key) {
  key += ~(key << 15);
  key ^= (key >> 10);
  key += (key << 3);
  key ^= (key >> 6);
  key += ~(key << 11);
  key ^= (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<hash_tw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_tw>:
mov    %edi,%eax
shl    $0xf,%eax
not    %eax
add    %edi,%eax
mov    %eax,%ecx
sar    $0xa,%ecx
xor    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %eax,%ecx
sar    $0x6,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xb,%edx
not    %edx
add    %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_tw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 15
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 10
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 %12, 3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 6
%18 = load i32, i32* %2
%19 = xor i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = shl i32 %20, 11
%22 = xor i32 %21, -1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 16
%27 = load i32, i32* %2
%28 = xor i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @hash_tw(i32 %0) {
%2 = shl i32 %0, 15
%3 = xor i32 %2, -1
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 10
%6 = xor i32 %5, %4
%7 = mul i32 %6, 9
%8 = ashr i32 %7, 6
%9 = xor i32 %8, %7
%10 = shl i32 %9, 11
%11 = xor i32 %10, -1
%12 = add nsw i32 %9, %11
%13 = ashr i32 %12, 16
%14 = xor i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float fltnum = 11.257f;
  printf("Float = %5.3f\n", fltnum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Float = %5.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x4026839580000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Float = %5.3f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float 0x4026839580000000)
ret i32 0
}
float sum(float x, float y) {
  float z;
  z = x + y;
  return z;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sum(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @sum(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_mul_d(double *, double, double);
double xil_fpo_mul_d(double a, double b) {
  double res_d;
  xip_fpo_mul_d(&res_d, a, b);
  return res_d;
}


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

x86 assembly (clang, -O2):
<xil_fpo_mul_d>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_mul_d@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_mul_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call i32 @xip_fpo_mul_d(double* %5, double %6, double %7)
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @xil_fpo_mul_d(double %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @xip_fpo_mul_d(double* %3, double %0, double %1)
%6 = load double, double* %3
ret double %6
}
int ft_isoctale(int c) {
  if (c >= '0' && c <= '7')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isoctale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isoctale+0x27>
cmpl   $0x37,-0x8(%rbp)
jg     1127 <ft_isoctale+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isoctale+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isoctale>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ft_isoctale(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 55
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isoctale(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int pop(int *stack) {
  int p = stack[stack[0]];
  stack[stack[0]] = 0;
  stack[0] = stack[0] - 1;
  return p;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq (%rdi),%rcx
mov    (%rdi,%rcx,4),%eax
movl   $0x0,(%rdi,%rcx,4)
addl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define i32 @pop(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %4, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %11, i64 %15
store i32 0, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 %20, i32* %22
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @pop(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
store i32 0, i32* %4
%6 = load i32, i32* %0
%7 = add nsw i32 %6, -1
store i32 %7, i32* %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Please enter three integers:\n");
  scanf("%*d %*d %d", &n);
  printf("The last integer was %d\n", n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Please enter three integers:\0A\00"
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [25 x i8] c"The last integer was %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [25 x i8] c"The last integer was %d\0A\00"
@str = [29 x i8] c"Please enter three integers:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int chr2hex(char c) {
  if (c <= 57 && c >= 48)
    return c - 48;
  else if (c <= 102 && c >= 97)
    return c - 97 + 10;
  return -1;
}


x86 assembly (clang, -O0):
<chr2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <chr2hex+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <chr2hex+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <chr2hex+0x6b>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     115f <chr2hex+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     115f <chr2hex+0x5f>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <chr2hex+0x6b>
jmp    1164 <chr2hex+0x64>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr2hex>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110e <chr2hex+0xe>
add    $0xffffffd0,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffffa9,%eax
cmp    $0x6,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @chr2hex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %30
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 97
%27 = add nsw i32 %26, 10
store i32 %27, i32* %2
br label %30
28: ; preds = %19, %15
br label %29
29: ; preds = %28
store i32 -1, i32* %2
br label %30
30: ; preds = %29, %23, %11
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @chr2hex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 6
%10 = add nsw i32 %2, -87
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ get_return_ops();
int /*<<< orphan*/ get_return_ops_len();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void output_statements_complete(unsigned char *buf, unsigned int buf_size,
                                unsigned int *bytes_written) {
  write_bytes("return val", buf, buf_size, bytes_written, get_return_ops(),
              get_return_ops_len());
}


x86 assembly (clang, -O0):
<output_statements_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <get_return_ops@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <get_return_ops_len@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    %eax,%r9d
lea    0xe7d(%rip),%rdi
call   1040 <write_bytes@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_statements_complete>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_return_ops@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <get_return_ops_len@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <write_bytes@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"return val\00"
define void @output_statements_complete(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 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @get_return_ops()
%11 = call i32 (...) @get_return_ops_len()
%12 = call i32 @write_bytes(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"return val\00"
define void @output_statements_complete(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @get_return_ops()
%5 = tail call i32 (...) @get_return_ops_len()
%6 = tail call i32 @write_bytes(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32* %2, i32 %4, i32 %5)
ret void
}
int par(int a) {
  int res;
  if ((a % 2) == 0)
    res = 1;
  else
    res = 0;
  return res;
}


x86 assembly (clang, -O0):
<par>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <par+0x27>
movl   $0x1,-0x8(%rbp)
jmp    112e <par+0x2e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<par>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @par(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %3
br label %9
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @par(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t morton(uint8_t b) {
  uint16_t r = 0;
  int i;
  for (i = 0; i < 8; i++) {
    r |= (b & 0x1) << (2 * i);
    b >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<morton>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114a <morton+0x4a>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <morton+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<morton>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
and    $0x2,%ecx
lea    (%rax,%rcx,2),%eax
mov    %edi,%ecx
and    $0x4,%ecx
lea    (%rax,%rcx,4),%eax
mov    %edi,%ecx
and    $0x8,%ecx
lea    (%rax,%rcx,8),%eax
mov    %edi,%ecx
and    $0x10,%ecx
shl    $0x4,%ecx
or     %eax,%ecx
mov    %edi,%edx
and    $0x20,%edx
shl    $0x5,%edx
or     %ecx,%edx
mov    %edi,%eax
and    $0x40,%eax
shl    $0x6,%eax
or     %edx,%eax
shl    $0x7,%edi
and    $0x4000,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @morton(i32 %0) {
%2 = and i32 %0, 1
%3 = shl i32 %0, 1
%4 = and i32 %3, 4
%5 = or i32 %4, %2
%6 = shl i32 %0, 2
%7 = and i32 %6, 16
%8 = or i32 %7, %5
%9 = shl i32 %0, 3
%10 = and i32 %9, 64
%11 = or i32 %10, %8
%12 = shl i32 %0, 4
%13 = and i32 %12, 256
%14 = or i32 %13, %11
%15 = shl i32 %0, 5
%16 = and i32 %15, 1024
%17 = or i32 %16, %14
%18 = shl i32 %0, 6
%19 = and i32 %18, 4096
%20 = or i32 %19, %17
%21 = shl i32 %0, 7
%22 = and i32 %21, 16384
%23 = or i32 %22, %20
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("System page size = %ld\n", sysconf(_SC_PAGESIZE));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"System page size = %ld\0A\00"
@_SC_PAGESIZE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @_SC_PAGESIZE
%7 = call i32 @sysconf(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"System page size = %ld\0A\00"
@_SC_PAGESIZE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @_SC_PAGESIZE
%4 = tail call i32 @sysconf(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printCharArray(unsigned char *array, int array_length) {
  int i;
  for (i = 0; i < array_length; i++) {
    printf("%c", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printCharArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printCharArray+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printCharArray+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printCharArray+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printCharArray+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printCharArray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendByte(int /*<<< orphan*/);
void startTransmission() {
  for (int i = 0; i < 4; i++) {
    sendByte(0);
  }
}


x86 assembly (clang, -O0):
<startTransmission>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    113e <startTransmission+0x2e>
xor    %edi,%edi
call   1030 <sendByte@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <startTransmission+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startTransmission>:
push   %rax
xor    %edi,%edi
call   1030 <sendByte@plt>
xor    %edi,%edi
call   1030 <sendByte@plt>
xor    %edi,%edi
call   1030 <sendByte@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <sendByte@plt>

LLVM IR (-O0):
define void @startTransmission() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 4
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @sendByte(i32 0)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @startTransmission() {
%1 = tail call i32 @sendByte(i32 0)
%2 = tail call i32 @sendByte(i32 0)
%3 = tail call i32 @sendByte(i32 0)
%4 = tail call i32 @sendByte(i32 0)
ret void
}
int is_digit(int ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void e_nop() {}


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

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

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

LLVM IR (-O2):
define void @e_nop() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void _debug(const char *format, va_list args) {
  fprintf(stderr, "Debug: ");
  vfprintf(stderr, format, args);
}


x86 assembly (clang, -O0):
<_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_debug>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"Debug: \00"
define void @_debug(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"Debug: \00"
define void @_debug(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %0, i32 %1)
ret void
}
const char *f2(void) { return "a"; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i8* @f2() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i8* @f2() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
double OP_Eq(double op1, double op2) { return op1 == op2; }


x86 assembly (clang, -O0):
<OP_Eq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_Eq>:
cmpeqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @OP_Eq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @OP_Eq(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void *thread2(void *arg) {
  long i = (long)arg;
  printf("t%ld': running!\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"t%ld': running!\0A\00"
define i8* @thread2(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [17 x i8] c"t%ld': running!\0A\00"
define noalias i8* @thread2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void do_bzero(void *ptr, size_t size) { memset(ptr, 0, size); }


x86 assembly (clang, -O0):
<do_bzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @do_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
void omap4_ion_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @omap4_ion_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *, int **);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char sentence[100];
  int diagram[26][3];
  scanf("%[^\n]s", sentence);
  create_letter_distribution_diagram(sentence, diagram);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1b0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0x70(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [26 x [3 x i32]]
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [26 x [3 x i32]], [26 x [3 x i32]]* %3, i64 0, i64 0
%8 = bitcast [3 x i32]* %7 to i32**
%9 = call i32 @create_letter_distribution_diagram(i8* %6, i32** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [26 x [3 x i32]]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast [26 x [3 x i32]]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = bitcast [26 x [3 x i32]]* %2 to i32**
%7 = call i32 @create_letter_distribution_diagram(i8* %3, i32** %6)
ret i32 0
}
void curl_global_init_mem() {}


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

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

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

LLVM IR (-O2):
define void @curl_global_init_mem() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void cvt_u8BGRA_u8BGRA(const uint8_t *src, uint8_t *dest, int w) {
  memcpy(dest, src, w * 4);
}


x86 assembly (clang, -O0):
<cvt_u8BGRA_u8BGRA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_u8BGRA_u8BGRA>:
mov    %rdi,%rax
shl    $0x2,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @cvt_u8BGRA_u8BGRA(i32* %0, i32* %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %4)
ret void
}
/* Variables and functions */
int FIND_MAX(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 7;
  int a[] = {5, 15, -30, 10, -5, 40, 10};
  int max = FIND_MAX(a, n);
  printf("max =%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <FIND_MAX@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <FIND_MAX@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 5, i32 15, i32 -30, i32 10, i32 -5, i32 40, i32 10]
@.str = [9 x i8] c"max =%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
%4 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
%5 = bitcast [7 x i32]* %3 to i8*
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @FIND_MAX(i32* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 5, i32 15, i32 -30, i32 10, i32 -5, i32 40, i32 10]
@.str = [9 x i8] c"max =%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @FIND_MAX(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
void *memdup_suffix0(void const *, size_t);
scalar_t__ size_multiply_overflow(size_t, size_t);
__attribute__((__alloc_size__(2, 3))) void *
memdup_suffix0_multiply(const void *p, size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return memdup_suffix0(p, size * need);
}


x86 assembly (clang, -O0):
<memdup_suffix0_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1158 <memdup_suffix0_multiply+0x38>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup_suffix0_multiply+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1040 <memdup_suffix0@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup_suffix0_multiply>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     1146 <memdup_suffix0_multiply+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memdup_suffix0@plt>

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

LLVM IR (-O2):
define i8* @memdup_suffix0_multiply(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @size_multiply_overflow(i64 %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = mul i64 %2, %1
%8 = tail call i8* @memdup_suffix0(i8* %0, i64 %7)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
char *read_argument(char name, char **argv) {
  if (!*argv) {
    fprintf(stderr, "-%c needs an argument\n", name);
    exit(1);
  }
  return *argv;
}


x86 assembly (clang, -O0):
<read_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1163 <read_argument+0x43>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_argument>:
push   %rax
mov    (%rsi),%rax
test   %rax,%rax
je     112b <read_argument+0xb>
pop    %rcx
ret
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
movsbl %dil,%edx
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"-%c needs an argument\0A\00"
define i8* @read_argument(i8 signext %0, i8** %1) {
%3 = alloca i8
%4 = alloca i8**
store i8 %0, i8* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8, i8* %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"-%c needs an argument\0A\00"
define i8* @read_argument(i8 signext %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}