xunge/DecIR huggingface dataset:
int f5(int t, int v) {
  if (v == 0 || v == -1)
    __builtin_unreachable();
  int a = t - 1U;
  int b = a * v;
  return b + v;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <f5+0x1e>
cmpl   $0xffffffff,-0x8(%rbp)
jne    111e <f5+0x1e>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, -2
tail call void @llvm.assume(i1 %4)
%5 = mul i32 %1, %0
ret i32 %5
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(int units, int unit_size) {
  void *block = calloc(units, unit_size);
  if (block == NULL) {
    fprintf(stderr, "OUT OF MEMMORY");
  }
  return block;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <xcalloc+0x3d>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xcalloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"OUT OF MEMMORY\00"
define noalias i8* @xcalloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret i8* %3
}
void Write_To_68K_Space(int adr, int data) {}


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

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

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

LLVM IR (-O2):
define void @Write_To_68K_Space(i32 %0, i32 %1) {
ret void
}
int ld_ne_mm1(long double *a1, long double *a2) { return (((*a1) != (*a2))); }


x86 assembly (clang, -O0):
<ld_ne_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_mm1>:
fldt   (%rdi)
fldt   (%rsi)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ld_ne_mm1(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp une x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int sum_num(const int a, const int b) {
  if (a == 0) {
    return b;
  }
  return (a + b);
}


x86 assembly (clang, -O0):
<sum_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <sum_num+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <sum_num+0x28>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sum_num(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @sum_num(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int b1(int index) { return ((int *)00377777)[index]; }


x86 assembly (clang, -O0):
<b1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x1ffff,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1>:
movslq %edi,%rax
mov    0x1ffff(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @b1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* inttoptr (i64 131071 to i32*), i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @b1(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds i32, i32* inttoptr (i64 131071 to i32*), i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RLCA();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0x07(void) {
  RLCA();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0x07>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <RLCA@plt>
mov    $0x4,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0x07>:
push   %rax
xor    %eax,%eax
call   1040 <RLCA@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0x07() {
%1 = call i32 (...) @RLCA()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0x07() {
%1 = tail call i32 (...) @RLCA()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
/* Type definitions */
struct frame_info {
  int dummy;
};

/* Variables and functions */
struct frame_info *create_new_frame(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ read_pc();
struct frame_info *get_current_frame(void) {
  return create_new_frame(0, read_pc());
}


x86 assembly (clang, -O0):
<get_current_frame>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <read_pc@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <create_new_frame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_frame>:
push   %rax
xor    %eax,%eax
call   1040 <read_pc@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <create_new_frame@plt>

LLVM IR (-O0):
%struct.frame_info = type { i32 }
define %struct.frame_info* @get_current_frame() {
%1 = call i32 (...) @read_pc()
%2 = call %struct.frame_info* @create_new_frame(i32 0, i32 %1)
ret %struct.frame_info* %2
}

LLVM IR (-O2):
%struct.frame_info = type { i32 }
define %struct.frame_info* @get_current_frame() {
%1 = tail call i32 (...) @read_pc()
%2 = tail call %struct.frame_info* @create_new_frame(i32 0, i32 %1)
ret %struct.frame_info* %2
}
/* Variables and functions */
int euler_problem_5();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_5());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_5()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int is_alphabetic(const char c) {
  return ('A' <= c && 'Z' >= c) || ('a' <= c && 'z' >= c);
}


x86 assembly (clang, -O0):
<is_alphabetic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1131 <is_alphabetic+0x31>
movsbl -0x1(%rbp),%edx
mov    $0x1,%al
mov    $0x5a,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jge    115e <is_alphabetic+0x5e>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1158 <is_alphabetic+0x58>
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
cmp    %ecx,%eax
setge  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphabetic>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alphabetic(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 90, %8
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 122, %16
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alphabetic(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP200_StatePermute(void *, int);
int /*<<< orphan*/ Ket_StateXORByte(void *, int, int);
void Ket_Step(void *state, unsigned int size,
              unsigned char frameAndPaddingBits) {
  Ket_StateXORByte(state, size, frameAndPaddingBits);
  Ket_StateXORByte(state, (2 * 1), 0x08);
  KeccakP200_StatePermute(state, 1);
}


x86 assembly (clang, -O0):
<Ket_Step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movzbl -0xd(%rbp),%edx
call   1030 <Ket_StateXORByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x8,%edx
call   1030 <Ket_StateXORByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <KeccakP200_StatePermute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ket_Step>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Ket_StateXORByte@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x8,%edx
call   1030 <Ket_StateXORByte@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <KeccakP200_StatePermute@plt>

LLVM IR (-O0):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = call i32 @Ket_StateXORByte(i8* %7, i32 %8, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @Ket_StateXORByte(i8* %12, i32 2, i32 8)
%14 = load i8*, i8** %4
%15 = call i32 @KeccakP200_StatePermute(i8* %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @Ket_StateXORByte(i8* %0, i32 %1, i32 %4)
%6 = tail call i32 @Ket_StateXORByte(i8* %0, i32 2, i32 8)
%7 = tail call i32 @KeccakP200_StatePermute(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int davinci_rev();
int is_davinci_dm644x(void) { return (davinci_rev() == (0x6446)) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_davinci_dm644x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <davinci_rev@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x6446,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_davinci_dm644x>:
push   %rax
xor    %eax,%eax
call   1030 <davinci_rev@plt>
xor    %ecx,%ecx
cmp    $0x6446,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_davinci_dm644x() {
%1 = call i32 (...) @davinci_rev()
%2 = icmp eq i32 %1, 25670
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_davinci_dm644x() {
%1 = tail call i32 (...) @davinci_rev()
%2 = icmp eq i32 %1, 25670
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int __builtin_mips_cabs_nge_s(float, float);
int test13(float a, float b) { return __builtin_mips_cabs_nge_s(a, b); }


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_nge_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
jmp    1030 <__builtin_mips_cabs_nge_s@plt>

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

LLVM IR (-O2):
define i32 @test13(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_nge_s(float %0, float %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LCDSend(unsigned char);
int /*<<< orphan*/ LCDSetXY(unsigned char, unsigned char);
void LCDSetPixel(unsigned char x, unsigned char y, unsigned char color) {
  LCDSetXY(x, y);
  LCDSend(0x12C);
  LCDSend(color);
}


x86 assembly (clang, -O0):
<LCDSetPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1040 <LCDSetXY@plt>
mov    $0x2c,%edi
call   1030 <LCDSend@plt>
movzbl -0x3(%rbp),%edi
call   1030 <LCDSend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDSetPixel>:
push   %rbx
mov    %edx,%ebx
call   1040 <LCDSetXY@plt>
mov    $0x2c,%edi
call   1030 <LCDSend@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <LCDSend@plt>

LLVM IR (-O0):
define void @LCDSetPixel(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = call i32 @LCDSetXY(i8 zeroext %7, i8 zeroext %8)
%10 = call i32 @LCDSend(i8 zeroext 44)
%11 = load i8, i8* %6
%12 = call i32 @LCDSend(i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @LCDSetPixel(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @LCDSetXY(i8 zeroext %0, i8 zeroext %1)
%5 = tail call i32 @LCDSend(i8 zeroext 44)
%6 = tail call i32 @LCDSend(i8 zeroext %2)
ret void
}
unsigned dict_rand() {
  extern long random();
  return (unsigned)random();
}


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

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

LLVM IR (-O0):
define i32 @dict_rand() {
%1 = call i64 (...) @random()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @dict_rand() {
%1 = tail call i64 (...) @random()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ islower(char);
int pre_process(char ch) {
  if (ch == 'A' || ch == 'Q' || ch == 'Z' || ch == '`')
    return 0;
  if (islower(ch))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<pre_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
je     1152 <pre_process+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x51,%eax
je     1152 <pre_process+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
je     1152 <pre_process+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x60,%eax
jne    115e <pre_process+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1184 <pre_process+0x74>
movsbl -0x5(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     117d <pre_process+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <pre_process+0x74>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_process>:
lea    -0x41(%rdi),%ecx
cmp    $0x1f,%cl
ja     1129 <pre_process+0x19>
xor    %eax,%eax
movzbl %cl,%ecx
mov    $0x82010001,%edx
bt     %rcx,%rdx
jae    1129 <pre_process+0x19>
ret
push   %rax
movsbl %dil,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @pre_process(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 eq i32 %5, 65
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 81
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 90
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 96
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 0, i32* %2
br label %26
20: ; preds = %15
%21 = load i8, i8* %3
%22 = call i64 @islower(i8 signext %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %2
br label %26
25: ; preds = %20
store i32 1, i32* %2
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @pre_process(i8 signext %0) {
switch i8 %0, label %2 [
i8 96, label %6
i8 90, label %6
i8 81, label %6
i8 65, label %6
]
2: ; preds = %1
%3 = tail call i64 @islower(i8 signext %0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1, %1, %1
%7 = phi i32 [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Variables and functions */
double fabs(float);
int h(float x) { return 0.0 > fabs(x); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
call   1030 <fabs@plt>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @h(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @fabs(float %3)
%5 = fcmp ogt double 0.000000e+00, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @h(float %0) {
%2 = tail call double @fabs(float %0)
%3 = fcmp olt double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
void prune_constant_not_Bad() {
  int x = 0;
  int a[1];
  if (!x) {
    a[x + 1] = 0;
  }
}


x86 assembly (clang, -O0):
<prune_constant_not_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1125 <prune_constant_not_Bad+0x25>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x0,-0x8(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_constant_not_Bad() {
%1 = alloca i32
%2 = alloca [1 x i32]
store i32 0, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @prune_constant_not_Bad() {
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};
typedef int /*<<< orphan*/ fpos_t;

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int fsetpos(int /*<<< orphan*/, int /*<<< orphan*/ const *);
int my_fsetpos(struct aFILE *fp, const fpos_t *pos) {
  return fsetpos(_get_actual_fp(fp), pos);
}


x86 assembly (clang, -O0):
<my_fsetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <fsetpos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fsetpos>:
push   %rbx
mov    %rsi,%rbx
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fsetpos@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_fsetpos(%struct.aFILE* %0, i32* %1) {
%3 = alloca %struct.aFILE*
%4 = alloca i32*
store %struct.aFILE* %0, %struct.aFILE** %3
store i32* %1, i32** %4
%5 = load %struct.aFILE*, %struct.aFILE** %3
%6 = call i32 @_get_actual_fp(%struct.aFILE* %5)
%7 = load i32*, i32** %4
%8 = call i32 @fsetpos(i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_fsetpos(%struct.aFILE* %0, i32* %1) {
%3 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%4 = tail call i32 @fsetpos(i32 %3, i32* %1)
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int fstat(int, struct stat *);
int open(char const *, int /*<<< orphan*/);
int stat(const char *file, struct stat *st) {
  int fd;
  int rc;
  fd = open(file, 0);
  rc = fstat(fd, st);
  close(fd);
  return rc;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fstat@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%7 = load i8*, i8** %3
%8 = call i32 @open(i8* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load %struct.stat*, %struct.stat** %4
%11 = call i32 @fstat(i32 %9, %struct.stat* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @open(i8* %0, i32 0)
%4 = tail call i32 @fstat(i32 %3, %struct.stat* %1)
%5 = tail call i32 @close(i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ isalnum(int);
int isdebpkgchar(int c) {
  return isalnum(c) || c == '-' || c == '.' || c == '+';
}


x86 assembly (clang, -O0):
<isdebpkgchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115d <isdebpkgchar+0x4d>
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115d <isdebpkgchar+0x4d>
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115d <isdebpkgchar+0x4d>
cmpl   $0x2b,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdebpkgchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
lea    -0x2d(%rbx),%ecx
cmp    $0x2,%ecx
setb   %cl
or     %al,%cl
cmp    $0x2b,%ebx
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isdebpkgchar(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = add i32 %0, -45
%5 = icmp ult i32 %4, 2
%6 = or i1 %5, %3
%7 = icmp eq i32 %0, 43
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
void change(int *p) { (*p)++; }


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @change(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
enum { a, b } c(void) {
  int d = a;
  if (e() < 0)
    d = b;
  return d;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <e@plt>
cmp    $0x0,%eax
jge    1136 <c+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rax
xor    %eax,%eax
call   1030 <e@plt>
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @c() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @e()
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @e()
%2 = lshr i32 %1, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ eflags_main();
int /*<<< orphan*/ fib_main();
int /*<<< orphan*/ recurse_main();
int /*<<< orphan*/ retaddr_main();
int /*<<< orphan*/ wrap_main1(int, int, int, int, int, int);
int /*<<< orphan*/ wrap_main2(int, int, int, int, int, int);
int /*<<< orphan*/ xsave_main();
void run_tests(void) {
  fib_main();
  eflags_main();
  retaddr_main();
  recurse_main();
  xsave_main();
  wrap_main1(1, 2, 3, 4, 5, 6);
  wrap_main2(1, 2, 3, 4, 5, 6);
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <fib_main@plt>
mov    $0x0,%al
call   1030 <eflags_main@plt>
mov    $0x0,%al
call   1050 <retaddr_main@plt>
mov    $0x0,%al
call   1070 <recurse_main@plt>
mov    $0x0,%al
call   1060 <xsave_main@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1040 <wrap_main1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1090 <wrap_main2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rax
xor    %eax,%eax
call   1080 <fib_main@plt>
xor    %eax,%eax
call   1030 <eflags_main@plt>
xor    %eax,%eax
call   1050 <retaddr_main@plt>
xor    %eax,%eax
call   1070 <recurse_main@plt>
xor    %eax,%eax
call   1060 <xsave_main@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1040 <wrap_main1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
pop    %rax
jmp    1090 <wrap_main2@plt>

LLVM IR (-O0):
define void @run_tests() {
%1 = call i32 (...) @fib_main()
%2 = call i32 (...) @eflags_main()
%3 = call i32 (...) @retaddr_main()
%4 = call i32 (...) @recurse_main()
%5 = call i32 (...) @xsave_main()
%6 = call i32 @wrap_main1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
%7 = call i32 @wrap_main2(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @fib_main()
%2 = tail call i32 (...) @eflags_main()
%3 = tail call i32 (...) @retaddr_main()
%4 = tail call i32 (...) @recurse_main()
%5 = tail call i32 (...) @xsave_main()
%6 = tail call i32 @wrap_main1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
%7 = tail call i32 @wrap_main2(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettime() {
  struct timeval time;
  gettimeofday(&time, NULL);
  return (double)time.tv_sec + (double)time.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  *(int *)0 = 1;
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
movl   $0x1,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* null
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
unreachable
}
double atan_ru(double x) { return 0; }


x86 assembly (clang, -O0):
<atan_ru>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan_ru>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @atan_ru(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @atan_ru(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int plus(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @plus(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @plus(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int abi2(int x) { return x + 64; }


x86 assembly (clang, -O0):
<abi2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abi2>:
lea    0x40(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @abi2(i32 %0) {
%2 = add nsw i32 %0, 64
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int const);
void copy_to_little_endian_32(void *out, const void *in, const unsigned n) {
  memcpy(out, in, n * 4);
}


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

x86 assembly (clang, -O2):
<copy_to_little_endian_32>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy_to_little_endian_32(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
int isdigit(int c) {
  if (c >= '0' && c <= '9')
    return 1;
  else
    return 0;
}


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

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

LLVM IR (-O0):
define i32 @isdigit(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, 57
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 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t left_shift(uint32_t v) {
  v <<= 1;
  v |= (v & (1 << 28)) ? 1 : 0;
  v &= ~(1 << 28);
  return v;
}


x86 assembly (clang, -O0):
<left_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x10000000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xefffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_shift>:
mov    %edi,%eax
shr    $0x1b,%eax
and    $0x1,%eax
and    $0xf7ffffff,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @left_shift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 268435456
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = and i32 %12, -268435457
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @left_shift(i32 %0) {
%2 = shl i32 %0, 1
%3 = lshr i32 %0, 27
%4 = and i32 %3, 1
%5 = and i32 %2, -268435458
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
scalar_t__ ERR_GET_REASON(unsigned long);
unsigned long ERR_get_error();
scalar_t__ RSA_R_UNKNOWN_PADDING_TYPE;
int pad_unknown(void) {
  unsigned long l;
  while ((l = ERR_get_error()) != 0)
    if (ERR_GET_REASON(l) == RSA_R_UNKNOWN_PADDING_TYPE)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<pad_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ERR_get_error@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1167 <pad_unknown+0x47>
mov    -0x10(%rbp),%rdi
call   1040 <ERR_GET_REASON@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
jne    1162 <pad_unknown+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116e <pad_unknown+0x4e>
jmp    1128 <pad_unknown+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_unknown>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1030 <ERR_get_error@plt>
test   %rax,%rax
je     114e <pad_unknown+0x2e>
mov    %rax,%rdi
call   1040 <ERR_GET_REASON@plt>
cmp    (%r14),%rax
jne    1130 <pad_unknown+0x10>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RSA_R_UNKNOWN_PADDING_TYPE = global i64 0
define i32 @pad_unknown() {
%1 = alloca i32
%2 = alloca i64
br label %3
3: ; preds = %12, %0
%4 = call i64 (...) @ERR_get_error()
store i64 %4, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i64, i64* %2
%8 = call i64 @ERR_GET_REASON(i64 %7)
%9 = load i64, i64* @RSA_R_UNKNOWN_PADDING_TYPE
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 1, i32* %1
br label %14
12: ; preds = %6
br label %3
13: ; preds = %3
store i32 0, i32* %1
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@RSA_R_UNKNOWN_PADDING_TYPE = global i64 0
define i32 @pad_unknown() {
br label %1
1: ; preds = %4, %0
%2 = tail call i64 (...) @ERR_get_error()
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @ERR_GET_REASON(i64 %2)
%6 = load i64, i64* @RSA_R_UNKNOWN_PADDING_TYPE
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %1
8: ; preds = %1, %4
%9 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fseek(int /*<<< orphan*/ *, long, int);
int __wrap_fseek(FILE *stream, long offset, int whence) {
  return dll_fseek(stream, offset, whence);
}


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

x86 assembly (clang, -O2):
<__wrap_fseek>:
jmp    1030 <dll_fseek@plt>

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

LLVM IR (-O2):
define i32 @__wrap_fseek(i32* %0, i64 %1, i32 %2) {
%4 = tail call i32 @dll_fseek(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int /*<<< orphan*/);
void strncat_zero(char *src) {
  char dst[] = "123";
  strncat(dst, src, 0);
}


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

x86 assembly (clang, -O2):
<strncat_zero>:
push   %rax
mov    %rdi,%rsi
movl   $0x333231,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %edx,%edx
call   1030 <strncat@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.strncat_zero.dst = [4 x i8] c"123\00"
define void @strncat_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strncat(i8* %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @strncat_zero(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 3355185, i32* %2
%4 = call i32 @strncat(i8* %3, i8* %0, i32 0)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int /*<<< orphan*/, char *, size_t,
                              unsigned int *, struct timespec const *);
ssize_t mq_timedreceive(mqd_t mqd, char *msg, size_t len, unsigned *prio,
                        const struct timespec *at) {
  return syscall_cp(277, mqd, msg, len, prio, at);
}


x86 assembly (clang, -O0):
<mq_timedreceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x115,%edi
call   1030 <syscall_cp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_timedreceive>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x115,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @mq_timedreceive(i32 %0, i8* %1, i64 %2, i32* %3, %struct.timespec* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = load %struct.timespec*, %struct.timespec** %10
%16 = call i32 @syscall_cp(i32 277, i32 %11, i8* %12, i64 %13, i32* %14, %struct.timespec* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @mq_timedreceive(i32 %0, i8* %1, i64 %2, i32* %3, %struct.timespec* %4) {
%6 = tail call i32 @syscall_cp(i32 277, i32 %0, i8* %1, i64 %2, i32* %3, %struct.timespec* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void logDebug(char c) { printf("%c\n", c); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @logDebug(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char getchar();
int /*<<< orphan*/ putchar(char);
void consume_char_const() {
  char c = getchar();
  putchar(c);
  if (c == '\\') {
    putchar(getchar());
  }
  c = getchar();
  putchar(c);
  assert(c == '\'');
}


x86 assembly (clang, -O0):
<consume_char_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
jne    1167 <consume_char_const+0x37>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x27,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_char_const>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
cmp    $0x5c,%bl
jne    1156 <consume_char_const+0x26>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
cmp    $0x27,%bl
sete   %dil
pop    %rbx
jmp    1050 <assert@plt>

LLVM IR (-O0):
define void @consume_char_const() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @putchar(i8 signext %3)
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 92
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call signext i8 (...) @getchar()
%10 = call i32 @putchar(i8 signext %9)
br label %11
11: ; preds = %8, %0
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %1
%13 = load i8, i8* %1
%14 = call i32 @putchar(i8 signext %13)
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 39
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
define void @consume_char_const() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @putchar(i8 signext %1)
%3 = icmp eq i8 %1, 92
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call signext i8 (...) @getchar()
%6 = tail call i32 @putchar(i8 signext %5)
br label %7
7: ; preds = %4, %0
%8 = tail call signext i8 (...) @getchar()
%9 = tail call i32 @putchar(i8 signext %8)
%10 = icmp eq i8 %8, 39
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}