xunge/DecIR huggingface dataset:
void rop3_77_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = *D ^ S;
  stk2 = stk2 | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_77_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_77_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
or     %dl,%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_77_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = or i8 %6, %4
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
char *aeApiName(void) { return "select"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @aeApiName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
int test_imm_02uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x02 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_02uint64_highword_reg>:
bt     $0x21,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_02uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 8589934592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int tobin(int);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", tobin(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <tobin@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @tobin(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
double f4_sum_pre_int_int_int(int v0, int v1, int v) {
  return (double)v0 + (double)v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_int>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to double
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_int(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fadd double %4, %5
%7 = sitofp i32 %2 to double
%8 = fadd double %6, %7
ret double %8
}
long long _timing_cpucycles() {
  unsigned long long result;
  __asm__ volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
                   : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<_timing_cpucycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_timing_cpucycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @_timing_cpucycles() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @_timing_cpucycles() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
scalar_t__ is_p1(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0;
  for (int i = 0; i < 1000; i++) {
    if (is_p1(i)) {
      sum += i;
    }
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1178 <main+0x58>
mov    -0xc(%rbp),%edi
call   1040 <is_p1@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x3e8,%ebp
je     1152 <main+0x32>
mov    %ebp,%edi
call   1040 <is_p1@plt>
mov    $0x0,%ecx
test   %rax,%rax
je     1130 <main+0x10>
mov    %ebp,%ecx
jmp    1130 <main+0x10>
lea    0xea7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = phi i32 [ 0, %0 ], [ %9, %3 ]
%6 = tail call i64 @is_p1(i32 %4)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 0, i32 %4
%9 = add nuw nsw i32 %8, %5
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 1000
br i1 %11, label %1, label %3
}
void load_gdtr(struct GDTR *gdtr) {
  __asm__ __volatile__("lgdt (%0)" : : "q"(gdtr));
}


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

x86 assembly (clang, -O2):
<load_gdtr>:
lgdt   (%rdi)
ret

LLVM IR (-O0):
%struct.GDTR = type opaque
define void @load_gdtr(%struct.GDTR* %0) {
%2 = alloca %struct.GDTR*
store %struct.GDTR* %0, %struct.GDTR** %2
%3 = load %struct.GDTR*, %struct.GDTR** %2
ret void
}

LLVM IR (-O2):
%struct.GDTR = type opaque
define void @load_gdtr(%struct.GDTR* %0) {
tail call void asm sideeffect "lgdt ($0)", "q,~{dirflag},~{fpsr},~{flags}"(%struct.GDTR* %0)
ret void
}
/* Type definitions */
struct out_dbg_lbl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ out_dbg_label_emitted(struct out_dbg_lbl *, char const **);
int out_dbg_label_shouldemit(struct out_dbg_lbl *lbl, const char **out_lbl) {
  return !out_dbg_label_emitted(lbl, out_lbl);
}


x86 assembly (clang, -O0):
<out_dbg_label_shouldemit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <out_dbg_label_emitted@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.out_dbg_lbl = type { i32 }
define i32 @out_dbg_label_shouldemit(%struct.out_dbg_lbl* %0, i8** %1) {
%3 = alloca %struct.out_dbg_lbl*
%4 = alloca i8**
store %struct.out_dbg_lbl* %0, %struct.out_dbg_lbl** %3
store i8** %1, i8*** %4
%5 = load %struct.out_dbg_lbl*, %struct.out_dbg_lbl** %3
%6 = load i8**, i8*** %4
%7 = call i32 @out_dbg_label_emitted(%struct.out_dbg_lbl* %5, i8** %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.out_dbg_lbl = type { i32 }
define i32 @out_dbg_label_shouldemit(%struct.out_dbg_lbl* %0, i8** %1) {
%3 = tail call i32 @out_dbg_label_emitted(%struct.out_dbg_lbl* %0, i8** %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int);
int /*<<< orphan*/ main2(int);
int main(void) {
  check_vect();
  main1(32 - 2);
  main2(32 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0x1e,%edi
call   1040 <main1@plt>
mov    $0x1f,%edi
call   1050 <main2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x1e,%edi
call   1040 <main1@plt>
mov    $0x1f,%edi
call   1050 <main2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 30)
%4 = call i32 @main2(i32 31)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 30)
%3 = tail call i32 @main2(i32 31)
ret i32 0
}
/* Variables and functions */
int findSingleElement(int *, int);
int /*<<< orphan*/ printf(char *, int);
void testFindSingleElement() {
  int size = 15;
  int elems[] = {1, 2, 1, 2, 3, 3, 4, 5, 5, 4, 6, 7, 6, 8, 7};
  printf("single element in array = %d\n", findSingleElement(elems, size));
}


x86 assembly (clang, -O0):
<testFindSingleElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0xf,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <findSingleElement@plt>
mov    %eax,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFindSingleElement>:
sub    $0x48,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xf,%esi
call   1040 <findSingleElement@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.testFindSingleElement.elems = [15 x i32] [i32 1, i32 2, i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 5, i32 4, i32 6, i32 7, i32 6, i32 8, i32 7]
@.str = [30 x i8] c"single element in array = %d\0A\00"
define void @testFindSingleElement() {
%1 = alloca i32
%2 = alloca [15 x i32]
store i32 15, i32* %1
%3 = bitcast [15 x i32]* %2 to i8*
%4 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %1
%6 = call i32 @findSingleElement(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.testFindSingleElement.elems = [15 x i32] [i32 1, i32 2, i32 1, i32 2, i32 3, i32 3, i32 4, i32 5, i32 5, i32 4, i32 6, i32 7, i32 6, i32 8, i32 7]
@.str = [30 x i8] c"single element in array = %d\0A\00"
define void @testFindSingleElement() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = call i32 @findSingleElement(i32* %3, i32 15)
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main(int);
void start() { main(1); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <main@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @start() {
%1 = call i32 @main(i32 1)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @main(i32 1)
ret void
}
int test_imm_C7int16_reg(short val) {
  return ((val) & (0xC7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xc7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C7int16_reg>:
test   $0xc7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C7int16_reg(i16 signext %0) {
%2 = and i16 %0, 199
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  short ssi = 126;
  unsigned short usi = 65280;
  int fail = !(ssi < usi);
  if (fail)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x7e,-0x6(%rbp)
movw   $0xff00,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1153 <main+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
store i32 0, i32* %1
store i16 126, i16* %2
store i16 -256, i16* %3
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int compare(unsigned char *buf, unsigned char *buf2) {
  if (buf[0] != buf2[0])
    return 0;
  if (buf[1] != buf2[1])
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     112e <compare+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <compare+0x59>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
je     1152 <compare+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <compare+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1113 <compare+0x13>
mov    0x1(%rdi),%cl
xor    %eax,%eax
cmp    0x1(%rsi),%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ switch_stack_to_other();
int /*<<< orphan*/ switch_stack_to_same();
int /*<<< orphan*/ tpcs_frame();
int main(void) {
  tpcs_frame();
  switch_stack_to_same();
  switch_stack_to_other();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tpcs_frame@plt>
mov    $0x0,%al
call   1040 <switch_stack_to_same@plt>
mov    $0x0,%al
call   1030 <switch_stack_to_other@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tpcs_frame()
%3 = call i32 (...) @switch_stack_to_same()
%4 = call i32 (...) @switch_stack_to_other()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tpcs_frame()
%2 = tail call i32 (...) @switch_stack_to_same()
%3 = tail call i32 (...) @switch_stack_to_other()
ret i32 0
}
int bitcount(unsigned num) {
  int bits;
  for (bits = 0; num != 0; num &= (num - 1))
    bits++;
  return bits;
}


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

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

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argv, char **argc) {
  bool var = false;
  printf("%s\n", var ? "true" : "false");
  var = true;
  printf("%s\n", var ? "true" : "false");
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xed2(%rip),%rsi
lea    0xec6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xea7(%rip),%rsi
lea    0xe9b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 1, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void unescape(char *str, char rem) {
  char *src, *dst;
  for (src = dst = str; *src != '\0'; src++) {
    *dst = *src;
    if (*dst != rem)
      dst++;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <unescape+0x6b>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1155 <unescape+0x55>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <unescape+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <unescape+0x1a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <unescape+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    %sil,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <unescape+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @unescape(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
store i8 %6, i8* %7
%9 = icmp ne i8 %6, %1
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ %0, %2 ], [ %11, %5 ]
store i8 0, i8* %16
ret void
}
void parabola_value(const double r, const double *p, double *f) {
  *f = (r * r) * p[0] + r * p[1] + p[2];
}


x86 assembly (clang, -O0):
<parabola_value>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<parabola_value>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x8(%rdi),%xmm0
mulsd  (%rdi),%xmm1
addsd  %xmm0,%xmm1
addsd  0x10(%rdi),%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @parabola_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double, double* %4
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %9, double %12, double %17)
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fadd double %18, %21
%23 = load double*, double** %6
store double %22, double* %23
ret void
}

LLVM IR (-O2):
define void @parabola_value(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = fmul double %0, %0
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %0
%9 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %8)
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fadd double %11, %9
store double %12, double* %2
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn98() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn98");
  return result;
}


x86 assembly (clang, -O0):
<fn98>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn98>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn98\00"
define i8* @fn98() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn98\00"
define i8* @fn98() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int json_object_array_sort2(struct json_object *obj, int column, int asc) {
  return 0;
}


x86 assembly (clang, -O0):
<json_object_array_sort2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.json_object = type opaque
define i32 @json_object_array_sort2(%struct.json_object* %0, i32 %1, i32 %2) {
%4 = alloca %struct.json_object*
%5 = alloca i32
%6 = alloca i32
store %struct.json_object* %0, %struct.json_object** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.json_object = type opaque
define i32 @json_object_array_sort2(%struct.json_object* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int fun934() { return 934; }


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

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

LLVM IR (-O0):
define i32 @fun934() {
ret i32 934
}

LLVM IR (-O2):
define i32 @fun934() {
ret i32 934
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int hash_intptr_equal(const void *int_one, const void *int_two) {
  assert(int_one);
  assert(int_two);
  return *((int *)int_one) == *((int *)int_two);
}


x86 assembly (clang, -O0):
<hash_intptr_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_intptr_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hash_intptr_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = icmp eq i32 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hash_intptr_equal(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void iommu_debug_domain_remove(struct iommu_domain *domain) {}


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

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

LLVM IR (-O0):
%struct.iommu_domain = type opaque
define void @iommu_debug_domain_remove(%struct.iommu_domain* %0) {
%2 = alloca %struct.iommu_domain*
store %struct.iommu_domain* %0, %struct.iommu_domain** %2
ret void
}

LLVM IR (-O2):
%struct.iommu_domain = type opaque
define void @iommu_debug_domain_remove(%struct.iommu_domain* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ldhl_sp_n();
void opcode_f8() { ldhl_sp_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_f8() {
%1 = tail call i32 (...) @ldhl_sp_n()
ret void
}
void map_normal() { (*(unsigned int *)(0x40074000)) = 2; }


x86 assembly (clang, -O0):
<map_normal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40074000,%eax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_normal>:
movl   $0x2,0x40074000
ret

LLVM IR (-O0):
define void @map_normal() {
store i32 2, i32* inttoptr (i64 1074216960 to i32*)
ret void
}

LLVM IR (-O2):
define void @map_normal() {
store i32 2, i32* inttoptr (i64 1074216960 to i32*)
ret void
}
void do_preload_rhtbl(int r) {}


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

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

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

LLVM IR (-O2):
define void @do_preload_rhtbl(i32 %0) {
ret void
}
void makeSet(int *S, int size) {
  int i;
  for (i = 0; i < size; i++)
    S[i] = -1;
}


x86 assembly (clang, -O0):
<makeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <makeSet+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <makeSet+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeSet>:
test   %esi,%esi
jle    1129 <makeSet+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @makeSet(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gettime(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("usage: %s <file_url> <file_localpath>\n", argv[0]);
    return 1;
  }
  gettime(argv[1], argv[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <gettime@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1137 <main+0x17>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <gettime@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"usage: %s <file_url> <file_localpath>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %21
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @gettime(i8* %16, i8* %19)
store i32 0, i32* %3
br label %21
21: ; preds = %13, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [39 x i8] c"usage: %s <file_url> <file_localpath>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @gettime(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
int test_imm_BBint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xBB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BBint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 187
%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_BBint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12255232
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ goUmode();
int do_umode() { goUmode(); }


x86 assembly (clang, -O0):
<do_umode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <goUmode@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_umode() {
%1 = alloca i32
%2 = call i32 (...) @goUmode()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @do_umode() {
%1 = tail call i32 (...) @goUmode()
ret i32 undef
}
int execute_sigsuspend() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sigsuspend() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void compareOvf(int x, int y) {
  int sum = x * x + y * y;
  if (sum < (1 << 22))
    printf("compare after overflow is TRUE\n");
  else
    printf("compare after overflow is FALSE\n");
}


x86 assembly (clang, -O0):
<compareOvf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x400000,-0xc(%rbp)
jge    114f <compareOvf+0x3f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <compareOvf+0x4b>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareOvf>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
cmp    $0x400000,%esi
lea    0xefb(%rip),%rax
lea    0xed4(%rip),%rdi
cmovb  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"compare after overflow is TRUE\0A\00"
@.str.1 = [33 x i8] c"compare after overflow is FALSE\0A\00"
define void @compareOvf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 4194304
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"compare after overflow is FALSE\00"
@str.2 = [31 x i8] c"compare after overflow is TRUE\00"
define void @compareOvf(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
%6 = icmp ult i32 %5, 4194304
%7 = select i1 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer1P__CompareA__stop();
void Atm128AlarmC__0__HplAtm128Compare__stop(void) {
  HplAtm128Timer1P__CompareA__stop();
}


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

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

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

LLVM IR (-O2):
define void @Atm128AlarmC__0__HplAtm128Compare__stop() {
%1 = tail call i32 (...) @HplAtm128Timer1P__CompareA__stop()
ret void
}
void output_q(long l) {
  *(long *)(0x100000208) = l;
  return;
}


x86 assembly (clang, -O0):
<output_q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movabs $0x100000208,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_q>:
movabs $0x100000208,%rax
mov    %rdi,(%rax)
ret

LLVM IR (-O0):
define void @output_q(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store i64 %3, i64* inttoptr (i64 4294967816 to i64*)
ret void
}

LLVM IR (-O2):
define void @output_q(i64 %0) {
store i64 %0, i64* inttoptr (i64 4294967816 to i64*)
ret void
}