xunge/DecIR huggingface dataset:
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (!(0 >= r)) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jae    1135 <main+0x35>
movl   $0x7,-0x14(%rbp)
jmp    113c <main+0x3c>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x2a,%ecx
mov    $0x7,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp oge float 0.000000e+00, %10
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 42, i32 7
ret i32 %4
}
void draw_bitmap(void *bitmap, int x, int y, int w, int h) {
  __asm__ __volatile__("int $0x40" ::"a"(7), "b"(bitmap), "c"((w << 16) | h),
                       "d"((x << 16) | y));
}


x86 assembly (clang, -O0):
<draw_bitmap>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x1c(%rbp),%ecx
shl    $0x10,%ecx
or     -0x20(%rbp),%ecx
mov    -0x14(%rbp),%edx
shl    $0x10,%edx
or     -0x18(%rbp),%edx
mov    $0x7,%eax
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_bitmap>:
push   %rbx
mov    %rdi,%rbx
shl    $0x10,%ecx
or     %r8d,%ecx
shl    $0x10,%esi
or     %esi,%edx
mov    $0x7,%eax
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @draw_bitmap(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %9
%13 = shl i32 %12, 16
%14 = load i32, i32* %10
%15 = or i32 %13, %14
%16 = load i32, i32* %7
%17 = shl i32 %16, 16
%18 = load i32, i32* %8
%19 = or i32 %17, %18
ret void
}

LLVM IR (-O2):
define void @draw_bitmap(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 16
%7 = or i32 %6, %4
%8 = shl i32 %1, 16
%9 = or i32 %8, %2
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 7, i8* %0, i32 %7, i32 %9)
ret void
}
int test_imm_C8uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8uint64_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, 200
%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_C8uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13107200
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int test_astruct(int);
int main() { return test_astruct(20); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_astruct(i32 20)
ret i32 %1
}
int gtdf2(double a, double b) { return a > b; }


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

x86 assembly (clang, -O2):
<gtdf2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @gtdf2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__47__IO__makeInput();
void Msp430Adc12ImplP__Port67__makeInput(void) {
  HplMsp430GeneralIOP__47__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port67__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__47__IO__makeInput()
ret void
}
void _opf_swapbyte(char *b1, char *b2) {
  char tmp = *b1;
  *b1 = *b2;
  *b2 = tmp;
}


x86 assembly (clang, -O0):
<_opf_swapbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_opf_swapbyte>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @_opf_swapbyte(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @_opf_swapbyte(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int c = 0;
  c++;
  ++c;
  printf("%d", c);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Type definitions */
typedef double uint16_t;

/* Variables and functions */
long uint16_to_batt(uint16_t value) {
  double d;
  if (value != 0)
    d = 1.223 * (1023.0 / value);
  else
    d = -0;
  return (long)(d * 1000);
}


x86 assembly (clang, -O0):
<uint16_to_batt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1126 <uint16_to_batt+0x26>
jp     1126 <uint16_to_batt+0x26>
jmp    1149 <uint16_to_batt+0x49>
movsd  0xeda(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1151 <uint16_to_batt+0x51>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_to_batt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    110c <uint16_to_batt+0xc>
jnp    112e <uint16_to_batt+0x2e>
movsd  0xeec(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xee8(%rip),%xmm1
mulsd  0xee8(%rip),%xmm1
cvttsd2si %xmm1,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @uint16_to_batt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp une double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = fdiv double 1.023000e+03, %7
%9 = fmul double 1.223000e+00, %8
store double %9, double* %3
br label %11
10: ; preds = %1
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %6
%12 = load double, double* %3
%13 = fmul double %12, 1.000000e+03
%14 = fptosi double %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @uint16_to_batt(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fdiv double 1.023000e+03, %0
%5 = fmul double %4, 1.223000e+00
%6 = fmul double %5, 1.000000e+03
%7 = fptosi double %6 to i64
br label %8
8: ; preds = %1, %3
%9 = phi i64 [ %7, %3 ], [ 0, %1 ]
ret i64 %9
}
label(s) char *s;
{ printf("label(%s)\n", s); }


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

x86 assembly (clang, -O2):
<label>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"label(%s)\0A\00"
define i32 @label(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
unsigned int cidr_to_mask(unsigned int cidrValue) {
  return -1 ^ ((1 << (32 - cidrValue)) - 1);
}


x86 assembly (clang, -O0):
<cidr_to_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cidr_to_mask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @cidr_to_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 32, %3
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
%7 = xor i32 -1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cidr_to_mask(i32 %0) {
%2 = sub i32 32, %0
%3 = shl nsw i32 -1, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *globescape_buffer(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strcpy(char *, char *);
char *globescape_inplace(char *string_to_escape) {
  char *buffer = globescape_buffer(string_to_escape, NULL);
  strcpy(string_to_escape, buffer);
  free(buffer);
  return string_to_escape;
}


x86 assembly (clang, -O0):
<globescape_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <globescape_buffer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<globescape_inplace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %esi,%esi
call   1050 <globescape_buffer@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @globescape_inplace(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @globescape_buffer(i8* %4, i32* null)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @globescape_inplace(i8* returned %0) {
%2 = tail call i8* @globescape_buffer(i8* %0, i32* null)
%3 = tail call i32 @strcpy(i8* %0, i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void od_copy_2x2_8_c(unsigned char *_dst, int _dstride,
                     const unsigned char *_src, int _sstride) {
  int y;
  for (y = 0; y < 2; y++) {
    memcpy(_dst, _src, 2);
    _dst += _dstride;
    _src += _sstride;
  }
}


x86 assembly (clang, -O0):
<od_copy_2x2_8_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jge    1179 <od_copy_2x2_8_c+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <od_copy_2x2_8_c+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_copy_2x2_8_c>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
movslq %ecx,%r12
mov    %rdx,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    %r15,%rbx
add    %r14,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @od_copy_2x2_8_c(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = sext i32 %3 to i64
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i32 2)
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = getelementptr inbounds i8, i8* %2, i64 %6
%10 = tail call i32 @memcpy(i8* %8, i8* %9, i32 2)
ret void
}
unsigned short _SwapTwoBytes(unsigned short w) {
  unsigned short tmp;
  tmp = (w & 0x00ff);
  tmp = ((w & 0xff00) >> 0x08) | (tmp << 0x08);
  return tmp;
}


x86 assembly (clang, -O0):
<_SwapTwoBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movzwl -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SwapTwoBytes>:
mov    %edi,%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @_SwapTwoBytes(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
double pre_RN();
double RN(double mean, double sd) { return (pre_RN() * sd + mean); }


x86 assembly (clang, -O0):
<RN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pre_RN@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RN>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pre_RN@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @RN(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @pre_RN()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @RN(double %0, double %1) {
%3 = tail call double (...) @pre_RN()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
long foo(long a, long b, long (*func)(long, long)) { return func(a, b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    *%rdx

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

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1, i64 (i64, i64)* nocapture %2) {
%4 = tail call i64 %2(i64 %0, i64 %1)
ret i64 %4
}
char *realpath(const char *restrict __name, char *restrict __resolved) {
  char *return_value___realpath_alias$2;
  return_value___realpath_alias$2 = __realpath_alias(__name, __resolved);
  return return_value___realpath_alias$2;
}


x86 assembly (clang, -O0):
<realpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <__realpath_alias@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @realpath(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__realpath_alias to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @realpath(i8* noalias %0, i8* noalias %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__realpath_alias to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ MultM(double **, double **, double **);
int /*<<< orphan*/ genZRotMatrix(double, double **);
void ViewRotZ(double theta, double m[3][3]) {
  double a[3][3];
  genZRotMatrix(theta, a);
  MultM(a, m, m);
}


x86 assembly (clang, -O0):
<ViewRotZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x60(%rbp),%rdi
call   1030 <genZRotMatrix@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <MultM@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ViewRotZ>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <genZRotMatrix@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <MultM@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ViewRotZ(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
%5 = alloca [3 x [3 x double]]
store double %0, double* %3
store [3 x double]* %1, [3 x double]** %4
%6 = load double, double* %3
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%8 = bitcast [3 x double]* %7 to double**
%9 = call i32 @genZRotMatrix(double %6, double** %8)
%10 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%11 = bitcast [3 x double]* %10 to double**
%12 = load [3 x double]*, [3 x double]** %4
%13 = bitcast [3 x double]* %12 to double**
%14 = load [3 x double]*, [3 x double]** %4
%15 = bitcast [3 x double]* %14 to double**
%16 = call i32 @MultM(double** %11, double** %13, double** %15)
ret void
}

LLVM IR (-O2):
define void @ViewRotZ(double %0, [3 x double]* %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = bitcast [3 x [3 x double]]* %3 to double**
%6 = call i32 @genZRotMatrix(double %0, double** %5)
%7 = bitcast [3 x double]* %1 to double**
%8 = call i32 @MultM(double** %5, double** %7, double** %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main(int argc, char **argv) {
  f();
  return 0;
}


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

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

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 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ merge(char *, int, int, int);
void mergeSort(char *str, int start, int end) {
  if (start < end) {
    int mid = (start + end) / 2;
    mergeSort(str, start, mid);
    mergeSort(str, mid + 1, end);
    merge(str, start, mid, end);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @mergeSort(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i8* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergeSort(i8* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i8* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i8* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i8* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
void XDoesSaveUnders() {}


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

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

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

LLVM IR (-O2):
define void @XDoesSaveUnders() {
ret void
}
void do_exit(long code) {}


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

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

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

LLVM IR (-O2):
define void @do_exit(i64 %0) {
ret void
}
unsigned int __attribute__((no, noclone)) foo(unsigned int x) {
  return x <= 0x7fffffff ? x : -x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7fffffff,-0x4(%rbp)
ja     111f <foo+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <foo+0x27>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 2147483647
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
ret i32 %2
}
char test_60_0(char *mem) { return __atomic_fetch_xor(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_60_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    0x4(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    1152 <test_60_0+0x52>
jmp    1127 <test_60_0+0x27>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_60_0>:
mov    0x4(%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
xor    $0x1,%cl
lock cmpxchg %cl,0x4(%rdi)
jne    1110 <test_60_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_60_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_60_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw xor i8* %2, i8 1 acq_rel
ret i8 %3
}
int MaximumOfInt(int I1, int I2) { return (I1 >= I2 ? I1 : I2); }


x86 assembly (clang, -O0):
<MaximumOfInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <MaximumOfInt+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MaximumOfInt+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaximumOfInt>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @MaximumOfInt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void usage() {}


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

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

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

LLVM IR (-O2):
define void @usage() {
ret void
}
int yyerror(char *msg) {}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @yyerror(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
void pthread_exit(int /*<<< orphan*/ *);
void ltfs_thread_exit(void) { return pthread_exit(NULL); }


x86 assembly (clang, -O0):
<ltfs_thread_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltfs_thread_exit>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @ltfs_thread_exit() {
tail call void @pthread_exit(i32* null)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void clean_stdin(void) {
  int c;
  do {
    c = getchar();
  } while (c != '\n' && c != EOF);
}


x86 assembly (clang, -O0):
<clean_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1143 <clean_stdin+0x33>
mov    -0x4(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <clean_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clean_stdin+0x20>
cmp    (%rbx),%eax
jne    1120 <clean_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clean_stdin() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %2, label %13
13: ; preds = %11
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clean_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
float const fabsfk(float);
__attribute__((visibility("default"))) const float xfabsf(float x) {
  return fabsfk(x);
}


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

x86 assembly (clang, -O2):
<xfabsf>:
jmp    1030 <fabsfk@plt>

LLVM IR (-O0):
define float @xfabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fabsfk(float %3)
ret float %4
}

LLVM IR (-O2):
define float @xfabsf(float %0) {
%2 = tail call float @fabsfk(float %0)
ret float %2
}
void dummyvideo_UpdateScreen(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int foo(__m128 x, __m128 y, __m128 z, int size) {
  int __attribute((aligned(16))) xxx;
  xxx = 2;
  bar(&xxx);
  return size;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x2,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebx
movl   $0x2,(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 returned %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 2, i32* %5
%7 = call i32 @bar(i32* %5)
ret i32 %3
}
void OSTaskStatHook(void) {}


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

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

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

LLVM IR (-O2):
define void @OSTaskStatHook() {
ret void
}
void my_task_cpu(int foo, float *bar) {}


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

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

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

LLVM IR (-O2):
define void @my_task_cpu(i32 %0, float* nocapture %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  float tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
float timer() {
  struct rusage r;
  getrusage(0, &r);
  return (float)(r.ru_utime.tv_sec + r.ru_utime.tv_usec / (float)1000000);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
cvtsi2ssq -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  0xeca(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1030 <getrusage@plt>
cvtsi2ssq 0x10(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
divss  0xecb(%rip),%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { float, i64 }
define float @timer() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to float
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%8 = load float, float* %7
%9 = fdiv float %8, 1.000000e+06
%10 = fadd float %9, %6
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int open(char *, int /*<<< orphan*/);
void redirectStdinToNull() {
  int fd = open("/dev/null", O_RDONLY);
  if (fd != -1) {
    dup2(fd, 1);
    close(fd);
  }
}


x86 assembly (clang, -O0):
<redirectStdinToNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     116f <redirectStdinToNull+0x3f>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirectStdinToNull>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1161 <redirectStdinToNull+0x31>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define void @redirectStdinToNull() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 @dup2(i32 %7, i32 1)
%9 = load i32, i32* %1
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define void @redirectStdinToNull() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @dup2(i32 %2, i32 1)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %4, %0
ret void
}
/* Variables and functions */
int ap_base64decode_binary(unsigned char *, char const *, int);
int ap_base64decode(char *bufplain, const char *bufcoded, int buflen) {
  int len;
  len = ap_base64decode_binary((unsigned char *)bufplain, bufcoded, buflen);
  bufplain[len] = '\0';
  return len;
}


x86 assembly (clang, -O0):
<ap_base64decode>:
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 <ap_base64decode_binary@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_base64decode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ap_base64decode_binary@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ap_base64decode(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @ap_base64decode_binary(i8* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @ap_base64decode(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ap_base64decode_binary(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i32 %4
}
int main() {
  int test_int;
  if (!(test_int + 256UL)) {
    goto ERROR;
  ERROR:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x8(%rbp),%rax
add    $0x100,%rax
cmp    $0x0,%rax
jne    1130 <main+0x30>
jmp    1124 <main+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1137 <main+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arch(void) { printf("ARCH1\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"ARCH1\00"
define void @arch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void loadsong(char *filename) {}


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

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

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

LLVM IR (-O2):
define void @loadsong(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zeroize(unsigned char *, int);
void zeroize_stack(void) {
  unsigned char m[2048];
  zeroize(m, sizeof m);
}


x86 assembly (clang, -O0):
<zeroize_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x800(%rbp),%rdi
mov    $0x800,%esi
call   1030 <zeroize@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroize_stack>:
sub    $0x808,%rsp
mov    %rsp,%rdi
mov    $0x800,%esi
call   1030 <zeroize@plt>
add    $0x808,%rsp
ret

LLVM IR (-O0):
define void @zeroize_stack() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @zeroize(i8* %2, i32 2048)
ret void
}

LLVM IR (-O2):
define void @zeroize_stack() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @zeroize(i8* %2, i32 2048)
ret void
}
/* Variables and functions */
int sprintf(char *, char *, unsigned long);
int lookup_symbol_name(unsigned long addr, char *symbol) {
  return sprintf(symbol, "%lx", addr);
}


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

x86 assembly (clang, -O2):
<lookup_symbol_name>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lx\00"
define i32 @lookup_symbol_name(i64 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %3
}
unsigned clip(int x, unsigned a) {
  if (x < 0)
    return 0;
  if ((unsigned)x > a)
    return a;
  return x;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <clip+0x20>
movl   $0x0,-0x4(%rbp)
jmp    113d <clip+0x3d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1137 <clip+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <clip+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
cmp    %esi,%edi
cmovbe %edi,%esi
xor    %eax,%eax
test   %edi,%edi
cmovns %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp ugt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int test_imm_ECint16_mem(short *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ECint16_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, 236
%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_ECint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 236
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}