xunge/DecIR huggingface dataset:
unsigned xrop3_197_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_197_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
and    $0xffffff00,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_197_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, %6
%8 = or i32 %7, 255
%9 = xor i32 %8, -1
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *bar = "abcdefgh";
  printf("Before bar* = '%s'\n\n", bar);
  bar[3] = '@';
  printf("After  bar* = '%s'\n\n", bar);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movb   $0x40,0x3(%rax)
mov    -0x18(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef1(%rip),%rdi
lea    0xee1(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"abcdefgh\00"
@.str.1 = [21 x i8] c"Before bar* = '%s'\0A\0A\00"
@.str.2 = [21 x i8] c"After bar* = '%s'\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 64, i8* %10
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"abcdefgh\00"
@.str.1 = [21 x i8] c"Before bar* = '%s'\0A\0A\00"
@.str.2 = [21 x i8] c"After bar* = '%s'\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dpush(int /*<<< orphan*/);
int /*<<< orphan*/ rpop();
void primitive_from_r_impl(void) { dpush(rpop()); }


x86 assembly (clang, -O0):
<primitive_from_r_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rpop@plt>
mov    %eax,%edi
call   1030 <dpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_from_r_impl>:
push   %rax
xor    %eax,%eax
call   1040 <rpop@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <dpush@plt>

LLVM IR (-O0):
define void @primitive_from_r_impl() {
%1 = call i32 (...) @rpop()
%2 = call i32 @dpush(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_from_r_impl() {
%1 = tail call i32 (...) @rpop()
%2 = tail call i32 @dpush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int firstMissingPositive(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {1, 2, 0};
  printf("%d\n", firstMissingPositive(x, sizeof(x) / sizeof(int)));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1040 <firstMissingPositive@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 1, i32 2, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @firstMissingPositive(i32* %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_imm_75uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7667712
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int PAPI_stop_counters(long long *, int);
void papif_stop_counters__(long long *values, int *array_len, int *check) {
  *check = PAPI_stop_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_stop_counters__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_stop_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_stop_counters__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_stop_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_stop_counters__(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_stop_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sdram_enable();
int /*<<< orphan*/ sdram_enable_refresh();
int /*<<< orphan*/ sdram_first_normal_reference();
int /*<<< orphan*/ sdram_set_registers();
int /*<<< orphan*/ sdram_set_spd_registers();
int /*<<< orphan*/ sdram_special_finishup();
void sdram_initialize(void) {
  sdram_set_registers();
  sdram_set_spd_registers();
  sdram_enable();
  sdram_first_normal_reference();
  sdram_enable_refresh();
  sdram_special_finishup();
}


x86 assembly (clang, -O0):
<sdram_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <sdram_set_registers@plt>
mov    $0x0,%al
call   1060 <sdram_set_spd_registers@plt>
mov    $0x0,%al
call   1070 <sdram_enable@plt>
mov    $0x0,%al
call   1030 <sdram_first_normal_reference@plt>
mov    $0x0,%al
call   1050 <sdram_enable_refresh@plt>
mov    $0x0,%al
call   1040 <sdram_special_finishup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_initialize>:
push   %rax
xor    %eax,%eax
call   1080 <sdram_set_registers@plt>
xor    %eax,%eax
call   1060 <sdram_set_spd_registers@plt>
xor    %eax,%eax
call   1070 <sdram_enable@plt>
xor    %eax,%eax
call   1030 <sdram_first_normal_reference@plt>
xor    %eax,%eax
call   1050 <sdram_enable_refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sdram_special_finishup@plt>

LLVM IR (-O0):
define void @sdram_initialize() {
%1 = call i32 (...) @sdram_set_registers()
%2 = call i32 (...) @sdram_set_spd_registers()
%3 = call i32 (...) @sdram_enable()
%4 = call i32 (...) @sdram_first_normal_reference()
%5 = call i32 (...) @sdram_enable_refresh()
%6 = call i32 (...) @sdram_special_finishup()
ret void
}

LLVM IR (-O2):
define void @sdram_initialize() {
%1 = tail call i32 (...) @sdram_set_registers()
%2 = tail call i32 (...) @sdram_set_spd_registers()
%3 = tail call i32 (...) @sdram_enable()
%4 = tail call i32 (...) @sdram_first_normal_reference()
%5 = tail call i32 (...) @sdram_enable_refresh()
%6 = tail call i32 (...) @sdram_special_finishup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double triangle(double, double);
int main() {
  printf("Triangle #1 %f\n", triangle(1.3, 8.3));
  printf("Triangle #2 %f\n", triangle(4.8, 9.8));
  printf("Triangle #3 %f\n", triangle(1.2, 2.0));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  0xee9(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
movsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe87(%rip),%xmm0
movsd  0xe87(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xef3(%rip),%rdi
call   1040 <printf@plt>
movsd  0xec6(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
movsd  0xeb5(%rip),%xmm0
movsd  0xeb5(%rip),%xmm1
call   1030 <triangle@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Triangle %f\0A\00"
@.str.1 = [16 x i8] c"Triangle %f\0A\00"
@.str.2 = [16 x i8] c"Triangle %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @triangle(double 1.300000e+00, double 8.300000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @triangle(double 4.800000e+00, double 9.800000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @triangle(double 1.200000e+00, double 2.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Triangle %f\0A\00"
@.str.1 = [16 x i8] c"Triangle %f\0A\00"
@.str.2 = [16 x i8] c"Triangle %f\0A\00"
define i32 @main() {
%1 = tail call double @triangle(double 1.300000e+00, double 8.300000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @triangle(double 4.800000e+00, double 9.800000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @triangle(double 1.200000e+00, double 2.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_absx();
int /*<<< orphan*/ e_lda();
void e_lda_absx() {
  e_absx();
  e_lda();
}


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

x86 assembly (clang, -O2):
<e_lda_absx>:
push   %rax
xor    %eax,%eax
call   1030 <e_absx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_lda@plt>

LLVM IR (-O0):
define void @e_lda_absx() {
%1 = call i32 (...) @e_absx()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_absx() {
%1 = tail call i32 (...) @e_absx()
%2 = tail call i32 (...) @e_lda()
ret void
}
__attribute__((swiftcall)) int
indirect_result_2(__attribute__((swift_indirect_result)) int *arg0,
                  __attribute__((swift_indirect_result)) float *arg1) {
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<indirect_result_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)

x86 assembly (clang, -O2):
LLVM IR (-O0):
define swiftcc i32 @indirect_result_2(i32* noalias align 4 dereferenceable(4) %0, float* noalias align 4 dereferenceable(4) %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ __NR_reboot;
scalar_t__ syscall(int /*<<< orphan*/, int, int, int, int /*<<< orphan*/);
long kexec_reboot(void) {
  return (long)syscall(__NR_reboot, 0xfee1dead, 672274793, 0x45584543, 0);
}


x86 assembly (clang, -O0):
<kexec_reboot>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    $0xfee1dead,%esi
mov    $0x28121969,%edx
mov    $0x45584543,%ecx
xor    %r8d,%r8d
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kexec_reboot>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    $0xfee1dead,%esi
mov    $0x28121969,%edx
mov    $0x45584543,%ecx
xor    %r8d,%r8d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_reboot = global i32 0
define i64 @kexec_reboot() {
%1 = load i32, i32* @__NR_reboot
%2 = call i64 @syscall(i32 %1, i32 -18751827, i32 672274793, i32 1163412803, i32 0)
ret i64 %2
}

LLVM IR (-O2):
@__NR_reboot = global i32 0
define i64 @kexec_reboot() {
%1 = load i32, i32* @__NR_reboot
%2 = tail call i64 @syscall(i32 %1, i32 -18751827, i32 672274793, i32 1163412803, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t);
void *Malloc(size_t sz) {
  char *p;
  p = (char *)malloc(sz);
  if (p == NULL) {
    (void)printf("malloc(%d) failed\n", sz);
    exit(1);
  }
  return (void *)p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <Malloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <Malloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"malloc(%d) failed\0A\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i64, i64* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"malloc(%d) failed\0A\00"
define i8* @Malloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cginc2ib(void) { ngen("%s\t(%%edx)", "incb", 0); }


x86 assembly (clang, -O0):
<cginc2ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc2ib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginc2ib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginc2ib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void aml_array_int_1d_save(FILE *file, int *arr, int s1) {
  int i;
  for (i = 0; i < s1; i++)
    fprintf(file, "%d ", arr[i]);
}


x86 assembly (clang, -O0):
<aml_array_int_1d_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <aml_array_int_1d_save+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <aml_array_int_1d_save+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_int_1d_save>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <aml_array_int_1d_save+0x38>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <aml_array_int_1d_save+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @aml_array_int_1d_save(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
char *calloc(int, int);
char *get_c_array(void) {
  char *tmp = calloc(1000, 1);
  tmp += 100;
  return tmp;
}


x86 assembly (clang, -O0):
<get_c_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x64,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_c_array>:
push   %rax
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
add    $0x64,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_c_array() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 1000, i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 100
store i8* %4, i8** %1
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @get_c_array() {
%1 = tail call dereferenceable_or_null(1000) i8* @calloc(i32 1000, i32 1)
%2 = getelementptr inbounds i8, i8* %1, i64 100
ret i8* %2
}
int test_libdl(int x) { return x * 1337; }


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

x86 assembly (clang, -O2):
<test_libdl>:
imul   $0x539,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_libdl(i32 %0) {
%2 = mul nsw i32 %0, 1337
ret i32 %2
}
/* Variables and functions */
int f(int);
int main(void) { return f(42); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 42)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 42)
ret i32 %1
}
/* Variables and functions */
int LZ4_decompress_fast(char const *, char *, int);
int LZ4_uncompress(const char *source, char *dest, int outputSize) {
  return LZ4_decompress_fast(source, dest, outputSize);
}


x86 assembly (clang, -O0):
<LZ4_uncompress>:
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 <LZ4_decompress_fast@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_uncompress>:
jmp    1030 <LZ4_decompress_fast@plt>

LLVM IR (-O0):
define i32 @LZ4_uncompress(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 i32 @LZ4_decompress_fast(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @LZ4_uncompress(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @LZ4_decompress_fast(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
void default_action() {}


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

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

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

LLVM IR (-O2):
define void @default_action() {
ret void
}
void toLower(char *c) {
  while (*c != '\0') {
    if (*c >= 'A' && *c <= 'Z')
      *c = *c + 32;
    c++;
  }
}


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <toLower+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114a <toLower+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114a <toLower+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <toLower+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
mov    (%rdi),%al
test   %al,%al
je     112a <toLower+0x2a>
add    $0x1,%rdi
jmp    111b <toLower+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <toLower+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <toLower+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <toLower+0x10>
ret

LLVM IR (-O0):
define void @toLower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, 32
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %2
store i8 %23, i8* %24
br label %25
25: ; preds = %18, %13, %8
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @toLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
int jam_isalpha(char ch) {
  return (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')));
}


x86 assembly (clang, -O0):
<jam_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <jam_isalpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <jam_isalpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <jam_isalpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %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):
<jam_isalpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @jam_isalpha(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 %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
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 @jam_isalpha(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 coord2mc_full(char **, double, double, int, int /*<<< orphan*/);
int coord2mc(char **v, double lat, double lon, int tc) {
  return coord2mc_full(v, lat, lon, tc, 0);
}


x86 assembly (clang, -O0):
<coord2mc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
xor    %edx,%edx
call   1030 <coord2mc_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coord2mc>:
xor    %edx,%edx
jmp    1030 <coord2mc_full@plt>

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

LLVM IR (-O2):
define i32 @coord2mc(i8** %0, double %1, double %2, i32 %3) {
%5 = tail call i32 @coord2mc_full(i8** %0, double %1, double %2, i32 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int test2(int);
int test1(int x) {
  static int thestatic;
  int y;
  thestatic = x;
  y = test2(thestatic - 1);
  return y + x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f08(%rip)
mov    0x2f02(%rip),%edi
sub    $0x1,%edi
call   1030 <test2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <test2@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@test1.thestatic = internal global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* @test1.thestatic
%5 = load i32, i32* @test1.thestatic
%6 = sub nsw i32 %5, 1
%7 = call i32 @test2(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @test2(i32 %2)
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
bool ST8_DIV_OVFCHK(unsigned char a, unsigned char b) {
  return (!b || (a == 0x80U && b == 0xFFU));
}


x86 assembly (clang, -O0):
<ST8_DIV_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x1,%al
cmpb   $0x0,-0x2(%rbp)
mov    %al,-0x3(%rbp)
je     1149 <ST8_DIV_OVFCHK+0x49>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
mov    %al,-0x4(%rbp)
jne    1143 <ST8_DIV_OVFCHK+0x43>
movzbl -0x2(%rbp),%eax
cmp    $0xff,%eax
sete   %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST8_DIV_OVFCHK>:
test   %esi,%esi
sete   %al
xor    $0x80,%dil
not    %sil
or     %dil,%sil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ST8_DIV_OVFCHK(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
%4 = icmp eq i8 %0, -128
%5 = icmp eq i8 %1, -1
%6 = and i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int f() { return 3.14; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 3
}

LLVM IR (-O2):
define i32 @f() {
ret i32 3
}
/* Variables and functions */
char decrunch(unsigned char);
char get_char_from_msb_lsb(unsigned char msb, unsigned char lsb) {
  return decrunch((msb << 3) | lsb);
}


x86 assembly (clang, -O0):
<get_char_from_msb_lsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%edi
call   1030 <decrunch@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_from_msb_lsb>:
shl    $0x3,%dil
or     %sil,%dil
movzbl %dil,%edi
jmp    1030 <decrunch@plt>

LLVM IR (-O0):
define signext i8 @get_char_from_msb_lsb(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 3
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i8
%12 = call signext i8 @decrunch(i8 zeroext %11)
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @get_char_from_msb_lsb(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 3
%4 = or i8 %3, %1
%5 = tail call signext i8 @decrunch(i8 zeroext %4)
ret i8 %5
}
void f(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
double glmDegd(double r) { return r * 57.295779513082320876798154814105; }


x86 assembly (clang, -O0):
<glmDegd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDegd>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @glmDegd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x404CA5DC1A63C1F8
ret double %4
}

LLVM IR (-O2):
define double @glmDegd(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helloFunc() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @helloFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int val(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @val() {
ret i32 1
}
/* Type definitions */
struct timespec {
  double tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double currenttime(struct timespec rawtime) {
  double time;
  clock_gettime(CLOCK_REALTIME, &rawtime);
  time = (rawtime.tv_sec) + (double)(rawtime.tv_nsec) / (double)1E9;
  return time;
}


x86 assembly (clang, -O0):
<currenttime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xeba(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currenttime>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,0x10(%rsp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xebc(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
@CLOCK_REALTIME = global i32 0
define double @currenttime(double %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca double
%5 = bitcast %struct.timespec* %3 to { double, i64 }*
%6 = getelementptr inbounds { double, i64 }, { double, i64 }* %5, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, i64 }, { double, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = load i32, i32* @CLOCK_REALTIME
%9 = call i32 @clock_gettime(i32 %8, %struct.timespec* %3)
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = fdiv double %14, 1.000000e+09
%16 = fadd double %11, %15
store double %16, double* %4
%17 = load double, double* %4
ret double %17
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
@CLOCK_REALTIME = global i32 0
define double @currenttime(double %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i64 %1, i64* %5
%6 = load i32, i32* @CLOCK_REALTIME
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %3)
%8 = load double, double* %4
%9 = load i64, i64* %5
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %8, %11
ret double %12
}
int my_strlen(char *string) {
  int i = 0;
  while (string[i] != '0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x30,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @my_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 48
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw 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 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 48
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int vbr_finish_dummy(void *state) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @vbr_finish_dummy(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ __NR_open;
int ppc_syscall(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                int /*<<< orphan*/);
int ppc_open_rdwr(const char *filename) {
  return ppc_syscall(__NR_open, filename, O_RDWR, 0);
}


x86 assembly (clang, -O0):
<ppc_open_rdwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <ppc_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc_open_rdwr>:
mov    %rdi,%rsi
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <ppc_syscall@plt>

LLVM IR (-O0):
@__NR_open = global i32 0
@O_RDWR = global i32 0
define i32 @ppc_open_rdwr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @__NR_open
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @ppc_syscall(i32 %3, i8* %4, i32 %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@__NR_open = global i32 0
@O_RDWR = global i32 0
define i32 @ppc_open_rdwr(i8* %0) {
%2 = load i32, i32* @__NR_open
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @ppc_syscall(i32 %2, i8* %0, i32 %3, i32 0)
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int filesize(char *input) {
  struct stat s;
  int r = stat(input, &s);
  if (r == -1) {
    fprintf(stderr, "Unable to stat\n");
    exit(1);
  }
  return (s.st_size);
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1175 <filesize+0x45>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1143 <filesize+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Unable to stat\0A\00"
define i32 @filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Unable to stat\0A\00"
define i32 @filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ DoError(char *, int);
void DoUnkError(char *localerrstr) { DoError(localerrstr, 01); }


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

x86 assembly (clang, -O2):
<DoUnkError>:
mov    $0x1,%esi
jmp    1030 <DoError@plt>

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

LLVM IR (-O2):
define void @DoUnkError(i8* %0) {
%2 = tail call i32 @DoError(i8* %0, i32 1)
ret void
}