xunge/DecIR huggingface dataset:
char lower(char c) { return c >= 'A' && c <= 'Z' ? c + 32 : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <lower+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <lower+0x33>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <lower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("10.2d4");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"10.2d4\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void SSMR3RegisterExternal(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3RegisterExternal() {
ret void
}
unsigned int f5(int xxx, unsigned yyy, short uuu) { return xxx ? uuu : yyy; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1127 <f5+0x27>
movswl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112d <f5+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f5(i32 %0, i32 %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i16, i16* %6
%11 = sext i16 %10 to i32
br label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1, i16 signext %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i16 %2 to i32
%6 = select i1 %4, i32 %1, i32 %5
ret i32 %6
}
void caller_1_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_2_2_1_1() {
ret void
}
unsigned int countbits(unsigned int n) {
  unsigned int i;
  for (i = 0; n != 0; i++)
    n &= (n - 1);
  return i;
}


x86 assembly (clang, -O0):
<countbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <countbits+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <countbits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countbits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <countbits+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <countbits+0x10>
ret

LLVM IR (-O0):
define i32 @countbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sub i32 %8, 1
%10 = load i32, i32* %2
%11 = and i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @countbits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint13(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint13(i32 %0) {
ret void
}
unsigned monkc_version() { return 10; }


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

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

LLVM IR (-O0):
define i32 @monkc_version() {
ret i32 10
}

LLVM IR (-O2):
define i32 @monkc_version() {
ret i32 10
}
int test(void) {
  int __seg_fs *f = (int __seg_fs *)16;
  int __seg_gs *g = (int __seg_gs *)16;
  return *f + *g;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movq   $0x10,-0x8(%rbp)
movq   $0x10,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %gs:(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %gs:0x10,%eax
add    %fs:0x10,%eax
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32 addrspace(257)*
%2 = alloca i32 addrspace(256)*
store i32 addrspace(257)* inttoptr (i64 16 to i32 addrspace(257)*), i32 addrspace(257)** %1
store i32 addrspace(256)* inttoptr (i64 16 to i32 addrspace(256)*), i32 addrspace(256)** %2
%3 = load i32 addrspace(257)*, i32 addrspace(257)** %1
%4 = load i32, i32 addrspace(257)* %3
%5 = load i32 addrspace(256)*, i32 addrspace(256)** %2
%6 = load i32, i32 addrspace(256)* %5
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test() {
%1 = load i32, i32 addrspace(257)* inttoptr (i64 16 to i32 addrspace(257)*)
%2 = load i32, i32 addrspace(256)* inttoptr (i64 16 to i32 addrspace(256)*)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int maj_elem(int *, int);
int test_no_maj_elem_odd() {
  int array[] = {1, 2, 5, 9, 4, 9, 5, 3, 5};
  return -1 == maj_elem(array, 9);
}


x86 assembly (clang, -O0):
<test_no_maj_elem_odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <maj_elem@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_maj_elem_odd>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <maj_elem@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_no_maj_elem_odd.array = [9 x i32] [i32 1, i32 2, i32 5, i32 9, i32 4, i32 9, i32 5, i32 3, i32 5]
define i32 @test_no_maj_elem_odd() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 9)
%5 = icmp eq i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_no_maj_elem_odd.array = [9 x i32] [i32 1, i32 2, i32 5, i32 9, i32 4, i32 9, i32 5, i32 3, i32 5]
define i32 @test_no_maj_elem_odd() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 9)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
bool block_delete_machine(void) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @block_delete_machine() {
ret i32 1
}
void f(void) {
  float a = 1e+100000000f;
  double b = 1e+100000000;
  long double c = 1e+100000000l;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7f800000,-0x4(%rbp)
movabs $0x7ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
flds   0xee1(%rip)
fstpt  -0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
store float 0x7FF0000000000000, float* %1
store double 0x7FF0000000000000, double* %2
store x86_fp80 0xK7FFF8000000000000000, x86_fp80* %3
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brake(double);
int /*<<< orphan*/ move_cursor_to(int /*<<< orphan*/, int /*<<< orphan*/);
void keyboard_up(unsigned char key, int x, int y) {
  move_cursor_to(0, 0);
  brake(0.1);
}


x86 assembly (clang, -O0):
<keyboard_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <move_cursor_to@plt>
movsd  0xebb(%rip),%xmm0
call   1040 <brake@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_up>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <move_cursor_to@plt>
movsd  0xece(%rip),%xmm0
pop    %rax
jmp    1040 <brake@plt>

LLVM IR (-O0):
define void @keyboard_up(i8 zeroext %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 = call i32 @move_cursor_to(i32 0, i32 0)
%8 = call i32 @brake(double 1.000000e-01)
ret void
}

LLVM IR (-O2):
define void @keyboard_up(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @move_cursor_to(i32 0, i32 0)
%5 = tail call i32 @brake(double 1.000000e-01)
ret void
}
/* Variables and functions */
float scalbf(float, int);
float ldexpf(float x, int fn) { return scalbf(x, fn); }


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

x86 assembly (clang, -O2):
<ldexpf>:
jmp    1030 <scalbf@plt>

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

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float @scalbf(float %0, i32 %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int ToInt(const char *In, int Hex) {
  int v = 0;
  sscanf(In, Hex ? "%X" : "%d", &v);
  return v;
}


x86 assembly (clang, -O0):
<ToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rsi
lea    0xec5(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToInt>:
push   %rax
movl   $0x0,0x4(%rsp)
test   %esi,%esi
lea    0xee1(%rip),%rax
lea    0xed7(%rip),%rsi
cmove  %rax,%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%X\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ToInt(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
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 @sscanf(i8* %6, i8* %10, i32* %5)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ToInt(i8* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%7 = call i32 @sscanf(i8* %0, i8* %6, i32* %3)
%8 = load i32, i32* %3
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void LCDRasterDisable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44050000);
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<LCDRasterDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffffe,0x28(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDRasterDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141178368
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 40
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -2
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @LCDRasterDisable(i32 %0) {
%2 = icmp eq i32 %0, 1141178368
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 40
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -2
store volatile i32 %9, i32* %7
ret void
}
void _OS_ClrReadySetClrCanContinue(void) {}


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

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

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

LLVM IR (-O2):
define void @_OS_ClrReadySetClrCanContinue() {
ret void
}
/* Variables and functions */
unsigned int read_keyboard_state(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @read_keyboard_state() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void report_to_stderr(const char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<report_to_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_to_stderr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_to_stderr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_to_stderr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void foo(void) {
  static void *p = &&lab;
  goto *p;
lab:;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <foo+0x16>
pop    %rbp
ret
mov    -0x8(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@foo.p = internal global i8* blockaddress(@foo, %2)
define void @foo() {
%1 = load i8*, i8** @foo.p
br label %3
2: ; preds = %3
ret void
3: ; preds = %0
%4 = phi i8* [ %1, %0 ]
indirectbr i8* %4, [label %2]
}

LLVM IR (-O2):
define void @foo() {
ret void
}
int bool_flip_flop() {
  static int result = 0;
  if (result)
    result = 0;
  else
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<bool_flip_flop>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     1120 <bool_flip_flop+0x20>
movl   $0x0,0x2f09(%rip)
jmp    112a <bool_flip_flop+0x2a>
movl   $0x1,0x2efa(%rip)
mov    0x2ef4(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_flip_flop>:
movzbl 0x2f1d(%rip),%eax
xor    $0x1,%eax
mov    %al,0x2f14(%rip)
ret

LLVM IR (-O0):
@bool_flip_flop.result = internal global i32 0
define i32 @bool_flip_flop() {
%1 = load i32, i32* @bool_flip_flop.result
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @bool_flip_flop.result
br label %5
4: ; preds = %0
store i32 1, i32* @bool_flip_flop.result
br label %5
5: ; preds = %4, %3
%6 = load i32, i32* @bool_flip_flop.result
ret i32 %6
}

LLVM IR (-O2):
@bool_flip_flop.result = internal unnamed_addr global i1 false
define i32 @bool_flip_flop() {
%1 = load i1, i1* @bool_flip_flop.result
%2 = xor i1 %1, true
store i1 %2, i1* @bool_flip_flop.result
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void dummy2(void *cc, int x) {
  fprintf(stdout, "dummy2 %d!\n", x + *(int *)cc);
}


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

x86 assembly (clang, -O2):
<dummy2>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
add    (%rdi),%edx
lea    0xedc(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"dummy2 %d!\0A\00"
define void @dummy2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
%11 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"dummy2 %d!\0A\00"
define void @dummy2(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %1
%7 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int multi();
int main(int argc, char *argv[]) { return multi(); }


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   1030 <multi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <multi@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 (...) @multi()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @multi()
ret i32 %3
}
/* Variables and functions */
char *strstr(char *, char *);
int indexOf(char *str, char *substr) {
  int i;
  char *pos = strstr(str, substr);
  if (pos == NULL) {
    i = -1;
  } else {
    i = (int)(pos - str);
  }
  return i;
}


x86 assembly (clang, -O0):
<indexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <indexOf+0x38>
movl   $0xffffffff,-0x14(%rbp)
jmp    1156 <indexOf+0x46>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @indexOf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %5
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %5
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @indexOf(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
__int128_t quad_fetch_xor_acq_rel(__int128_t *ptr, __int128_t value) {
  return __atomic_fetch_xor(ptr, value, 4);
}


x86 assembly (clang, -O0):
<quad_fetch_xor_acq_rel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdi,-0x28(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x68(%rbp)
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <__atomic_fetch_xor_16@plt>
mov    %rax,-0x80(%rbp)
mov    %rdx,-0x78(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_fetch_xor_acq_rel>:
mov    $0x4,%ecx
jmp    1030 <__atomic_fetch_xor_16@plt>

LLVM IR (-O0):
define { i64, i64 } @quad_fetch_xor_acq_rel(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128*
%7 = alloca i128
%8 = alloca i128
%9 = alloca i128
%10 = alloca i128
%11 = alloca i128
%12 = bitcast i128* %5 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
store i64 %1, i64* %13
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
store i64 %2, i64* %14
%15 = load i128, i128* %5
store i128* %0, i128** %6
store i128 %15, i128* %7
%16 = load i128*, i128** %6
%17 = load i128, i128* %7
store i128 %17, i128* %8
%18 = bitcast i128* %16 to i8*
%19 = load i128, i128* %8
store i128 %19, i128* %10
%20 = bitcast i128* %10 to { i64, i64 }*
%21 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 1
%24 = load i64, i64* %23
%25 = call { i64, i64 } @__atomic_fetch_xor_16(i8* %18, i64 %22, i64 %24, i32 4)
%26 = bitcast i128* %11 to { i64, i64 }*
%27 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 0
%28 = extractvalue { i64, i64 } %25, 0
store i64 %28, i64* %27
%29 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 1
%30 = extractvalue { i64, i64 } %25, 1
store i64 %30, i64* %29
%31 = load i128, i128* %11
store i128 %31, i128* %9
%32 = load i128, i128* %9
store i128 %32, i128* %4
%33 = bitcast i128* %4 to { i64, i64 }*
%34 = load { i64, i64 }, { i64, i64 }* %33
ret { i64, i64 } %34
}

LLVM IR (-O2):
define { i64, i64 } @quad_fetch_xor_acq_rel(i128* %0, i64 %1, i64 %2) {
%4 = bitcast i128* %0 to i8*
%5 = tail call { i64, i64 } @__atomic_fetch_xor_16(i8* %4, i64 %1, i64 %2, i32 4)
ret { i64, i64 } %5
}
/* Variables and functions */
scalar_t__ ceil(double);
int commCeil_D(double x) { return (int)ceil(x); }


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

x86 assembly (clang, -O2):
<commCeil_D>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @commCeil_D(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @ceil(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @commCeil_D(double %0) {
%2 = tail call i64 @ceil(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_ERR;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void logErrorMessage(char *message) {
  openlog("dt228Yr4", LOG_PID | LOG_CONS, LOG_USER);
  syslog(LOG_ERR, "%s", message);
  closelog();
}


x86 assembly (clang, -O0):
<logErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e84(%rip),%rax
or     (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logErrorMessage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"dt228Yr4\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @logErrorMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_CONS
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_USER
%7 = call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @LOG_ERR
%9 = load i8*, i8** %2
%10 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"dt228Yr4\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @logErrorMessage(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_CONS
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_USER
%6 = tail call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* @LOG_ERR
%8 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = tail call i32 (...) @closelog()
ret void
}
char *key_to_keybinding(char what) {
  static char buffer[3];
  buffer[1] = buffer[2] = 0x00;
  if (what < 32) {
    buffer[0] = '^';
    buffer[1] = 'a' + what - 1;
  } else {
    buffer[0] = what;
  }
  return buffer;
}


x86 assembly (clang, -O0):
<key_to_keybinding>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,0x2f12(%rip)
movb   $0x0,0x2f0a(%rip)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jge    1141 <key_to_keybinding+0x41>
movb   $0x5e,0x2ef5(%rip)
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x1,%eax
mov    %al,0x2ee6(%rip)
jmp    114a <key_to_keybinding+0x4a>
mov    -0x1(%rbp),%al
mov    %al,0x2ed7(%rip)
lea    0x2ed0(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_to_keybinding>:
movw   $0x0,0x2f19(%rip)
cmp    $0x1f,%dil
jg     1129 <key_to_keybinding+0x29>
movb   $0x5e,0x2f0b(%rip)
add    $0x60,%dil
mov    %dil,0x2f01(%rip)
lea    0x2ef9(%rip),%rax
ret
mov    %dil,0x2ef1(%rip)
lea    0x2eea(%rip),%rax
ret

LLVM IR (-O0):
@key_to_keybinding.buffer = internal global [3 x i8] zeroinitializer
define i8* @key_to_keybinding(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 1)
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %12
6: ; preds = %1
store i8 94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 97, %8
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i8
store i8 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 1)
br label %14
12: ; preds = %1
%13 = load i8, i8* %2
store i8 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
br label %14
14: ; preds = %12, %6
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@key_to_keybinding.buffer = internal global [3 x i8] zeroinitializer
define i8* @key_to_keybinding(i8 signext %0) {
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 1)
%2 = icmp slt i8 %0, 32
br i1 %2, label %3, label %5
3: ; preds = %1
store i8 94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
%4 = add nsw i8 %0, 96
store i8 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 1)
br label %6
5: ; preds = %1
store i8 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
br label %6
6: ; preds = %5, %3
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @key_to_keybinding.buffer, i64 0, i64 0)
}
int Square(int Value) { return Value * Value; }


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

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

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

LLVM IR (-O2):
define i32 @Square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int test_imm_7Aint16_mem(short *val) {
  return ((*val) & (-0x7A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Aint16_mem>:
movzwl (%rdi),%eax
test   $0xff86,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -122
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void speakup_reset(int fg_console, unsigned char type) {}


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

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

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

LLVM IR (-O2):
define void @speakup_reset(i32 %0, i8 zeroext %1) {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t xchg(uint64_t *ptr, uint64_t val) {
  __asm volatile("lock; xchgq %0, %1\n\t"
                 : "+m"(*ptr), "+r"(val)
                 :
                 : "memory", "cc");
  return val;
}


x86 assembly (clang, -O0):
<xchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
lock xchg %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @xchg(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %4
%7 = call i8* asm sideeffect "lock; xchgq $0, $1\0A\09", "=*m,=r,*m,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %5, i8** elementtype(i8*) %5, i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @xchg(i8** %0, i8* %1) {
%3 = tail call i8* asm sideeffect "lock; xchgq $0, $1\0A\09", "=*m,=r,*m,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8** elementtype(i8*) %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ get_speed(unsigned int);
int dev_speed_valid(unsigned int speed) { return 0 != get_speed(speed); }


x86 assembly (clang, -O0):
<dev_speed_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_speed@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dev_speed_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @get_speed(i32 %3)
%5 = icmp ne i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dev_speed_valid(i32 %0) {
%2 = tail call i64 @get_speed(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *intReplaceF(char *, char *, int, char *);
char *intReplace(char *text, char *from, int to) {
  return intReplaceF(text, from, to, "%i");
}


x86 assembly (clang, -O0):
<intReplace>:
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
lea    0xecb(%rip),%rcx
call   1030 <intReplaceF@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intReplace>:
lea    0xee9(%rip),%rcx
jmp    1030 <intReplaceF@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i8* @intReplace(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 = call i8* @intReplaceF(i8* %7, i8* %8, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i8* @intReplace(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @intReplaceF(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
int mkdir(char *s) {
  char shellCommand[64];
  sprintf(shellCommand, "mkdir %s", s);
  if (0 != system(shellCommand)) {
    puts("mkdir failed");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <system@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     117f <mkdir+0x4f>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <mkdir+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
test   %rax,%rax
je     116a <mkdir+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    116c <mkdir+0x3c>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mkdir %s\00"
@.str.1 = [13 x i8] c"mkdir failed\00"
define i32 @mkdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [64 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = call i64 @system(i8* %8)
%10 = icmp ne i64 0, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"mkdir %s\00"
@.str.1 = [13 x i8] c"mkdir failed\00"
define i32 @mkdir(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ -1, %7 ], [ 0, %1 ]
ret i32 %10
}
int bi_subtract_limbs(unsigned long int *difference, unsigned long int *borrow,
                      unsigned long int lhs, unsigned long int rhs) {
  *difference = lhs - rhs;
  if (*difference > lhs) {
    *borrow = *borrow + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<bi_subtract_limbs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
sub    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jbe    1146 <bi_subtract_limbs+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi_subtract_limbs>:
sub    %rcx,%rdx
mov    %rdx,(%rdi)
jae    110c <bi_subtract_limbs+0xc>
addq   $0x1,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bi_subtract_limbs(i64* nocapture writeonly %0, i64* nocapture %1, i64 %2, i64 %3) {
%5 = sub i64 %2, %3
store i64 %5, i64* %0
%6 = icmp ult i64 %2, %3
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i64, i64* %1
%9 = add i64 %8, 1
store i64 %9, i64* %1
br label %10
10: ; preds = %7, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_quit(int sig) { printf("QUIT\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"QUIT\00"
define void @catch_quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
int main(void) { printf("%d\n", time(NULL)); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@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 = call i32 @time(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
profil(buff, bufsiz, offset, scale) char *buff;
int (*offset)();
{ _profil(buff, bufsiz, offset, scale, 7262); }


x86 assembly (clang, -O0):
<profil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    $0x1c5e,%r8d
mov    $0x0,%al
call   1030 <_profil@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<profil>:
mov    $0x1c5e,%r8d
xor    %eax,%eax
jmp    1030 <_profil@plt>

LLVM IR (-O0):
define i32 @profil(i8* %0, i32 %1, i32 (...)* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32 (...)*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 (...)* %2, i32 (...)** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32 (...)*, i32 (...)** %8
%13 = load i32, i32* %9
%14 = call i32 (i8*, i32, i32 (...)*, i32, i32, ...) bitcast (i32 (...)* @_profil to i32 (i8*, i32, i32 (...)*, i32, i32, ...)*)(i8* %10, i32 %11, i32 (...)* %12, i32 %13, i32 7262)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @profil(i8* %0, i32 %1, i32 (...)* %2, i32 %3) {
%5 = tail call i32 (i8*, i32, i32 (...)*, i32, i32, ...) bitcast (i32 (...)* @_profil to i32 (i8*, i32, i32 (...)*, i32, i32, ...)*)(i8* %0, i32 %1, i32 (...)* %2, i32 %3, i32 7262)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int endmntent(FILE *fp) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<endmntent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endmntent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @endmntent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @endmntent(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int CommDestory(int fd_com) {
  if (fd_com >= 0) {
    close(fd_com);
  }
  return 0;
}


x86 assembly (clang, -O0):
<CommDestory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <CommDestory+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommDestory>:
test   %edi,%edi
js     111e <CommDestory+0xe>
push   %rax
call   1030 <close@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @CommDestory(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret i32 0
}