xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int compare(const void *A, const void *B) {
  static int num;
  num++;
  int a = *(int *)A;
  int b = *(int *)B;
  printf("num = %d\n", num);
  return (a >= b) - (a <= b);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f06(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efd(%rip)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ee5(%rip),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %rbp
push   %rbx
push   %rax
mov    0x2f13(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0a(%rip)
mov    (%rdi),%ecx
lea    0xed5(%rip),%rdi
xor    %ebx,%ebx
xor    %ebp,%ebp
cmp    (%rsi),%ecx
setge  %bl
setle  %bpl
mov    %eax,%esi
call   1030 <printf@plt>
sub    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@compare.num = internal global i32 0
@.str = [10 x i8] c"num = %d\0A\00"
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @compare.num
%8 = add nsw i32 %7, 1
store i32 %8, i32* @compare.num
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
store i32 %14, i32* %6
%15 = load i32, i32* @compare.num
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp sge i32 %17, %18
%20 = zext i1 %19 to i32
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp sle i32 %21, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
@compare.num = internal unnamed_addr global i32 0
@.str = [10 x i8] c"num = %d\0A\00"
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* @compare.num
%4 = add nsw i32 %3, 1
store i32 %4, i32* @compare.num
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%10 = icmp sge i32 %6, %8
%11 = zext i1 %10 to i32
%12 = icmp sle i32 %6, %8
%13 = sext i1 %12 to i32
%14 = add nsw i32 %13, %11
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int _fseeko(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int fseeko(FILE *stream, off_t offset, int whence) {
  return _fseeko(stream, offset, whence);
}


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

x86 assembly (clang, -O2):
<fseeko>:
jmp    1030 <_fseeko@plt>

LLVM IR (-O0):
define i32 @fseeko(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_fseeko(i32* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fseeko(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_fseeko(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
int test_imm_ABuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xAB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ABuint64_midword_reg>:
test   $0xab0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ABuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 171
%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_ABuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11206656
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int foo(int, char *);
int main(void) { return foo(42, "Hello World"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
mov    $0x2a,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned int modAdd(int a, int b) {
  long c;
  unsigned int r;
  c = a + b;
  r = (unsigned int)(c % (4294967296));
  return r;
}


x86 assembly (clang, -O0):
<modAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x100000000,%rcx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @modAdd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = srem i64 %11, 4294967296
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @modAdd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int umask(int);
int UnixVfs_Umask(int new_mask) {
  int old_mask;
  old_mask = umask(new_mask);
  return old_mask;
}


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

x86 assembly (clang, -O2):
<UnixVfs_Umask>:
jmp    1030 <umask@plt>

LLVM IR (-O0):
define i32 @UnixVfs_Umask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @umask(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @UnixVfs_Umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}
__attribute__((no)) int C(int x, int y, int z) { return z; }


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

x86 assembly (clang, -O2):
<C>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @C(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* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @C(i32 %0, i32 %1, i32 returned %2) {
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double hb_energy_read_total_dummy(int64_t last_hb_time, int64_t curr_hb_time) {
  return 0.0;
}


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

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

LLVM IR (-O0):
define double @hb_energy_read_total_dummy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @hb_energy_read_total_dummy(i32 %0, i32 %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFormat() {
  wNotYet("Format");
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasFormat>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFormat>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Format\00"
define void @wBasFormat() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Format\00"
define void @wBasFormat() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @wPushNumber(i32 0)
ret void
}
__attribute__((no, noclone)) int bar(int b) { return b * b; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int wait(int *status) { svcPanic(); }


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

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

LLVM IR (-O0):
define i32 @wait(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 (...) @svcPanic()
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @wait(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Type definitions */
typedef int Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XDestroyWindow(int /*<<< orphan*/ *, int);
void destroy_window(int dpy, int win) {
  Display *display = (Display *)dpy;
  Window window = win;
  XDestroyWindow(display, window);
}


x86 assembly (clang, -O0):
<destroy_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <XDestroyWindow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_window>:
movslq %edi,%rdi
jmp    1030 <XDestroyWindow@plt>

LLVM IR (-O0):
define void @destroy_window(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32, i32* %4
store i32 %10, i32* %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = call i32 @XDestroyWindow(i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @destroy_window(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @XDestroyWindow(i32* %4, i32 %1)
ret void
}
unsigned fixup_freq(unsigned freq) {
  unsigned fixed_freq = freq;
  if (fixed_freq < 1000000)
    fixed_freq *= 1000;
  if (fixed_freq < 1000000)
    fixed_freq *= 1000;
  return fixed_freq;
}


x86 assembly (clang, -O0):
<fixup_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jae    1124 <fixup_freq+0x24>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jae    113b <fixup_freq+0x3b>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup_freq>:
imul   $0x3e8,%edi,%ecx
cmp    $0xf4240,%edi
cmovae %edi,%ecx
imul   $0x3e8,%ecx,%eax
cmp    $0xf4240,%ecx
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fixup_freq(i32 %0) {
%2 = icmp ult i32 %0, 1000000
%3 = mul i32 %0, 1000
%4 = select i1 %2, i32 %3, i32 %0
%5 = icmp ult i32 %4, 1000000
%6 = mul i32 %4, 1000
%7 = select i1 %5, i32 %6, i32 %4
ret i32 %7
}
int min(int arr[]) {
  int m;
  int i = 0;
  int len = (sizeof(arr) / sizeof(int));
  for (i = 0; i < len; i++) {
    if (m < arr[i])
      m = m;
    else
      m = arr[i];
    i++;
    arr++;
  }
  return m;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1179 <min+0x79>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1148 <min+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <min+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <min+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int min_test(long a, long b, long c) {
  int cmp1 = a < b;
  int cmp2 = a < c;
  return cmp1 & cmp2;
}


x86 assembly (clang, -O0):
<min_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_test>:
cmp    %rsi,%rdi
setl   %al
cmp    %rdx,%rdi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @min_test(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = icmp slt i64 %9, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %7
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp slt i64 %13, %14
%16 = zext i1 %15 to i32
store i32 %16, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = and i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @min_test(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp slt i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int fun135() { return 135; }


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

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

LLVM IR (-O0):
define i32 @fun135() {
ret i32 135
}

LLVM IR (-O2):
define i32 @fun135() {
ret i32 135
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ yuv420_argb32(int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ const *,
                                 int /*<<< orphan*/ const *,
                                 int /*<<< orphan*/ const *, int, int, int, int,
                                 int, int /*<<< orphan*/);
void mmxext_argb32(uint8_t *image, const uint8_t *py, const uint8_t *pu,
                   const uint8_t *pv, int width, int height, int rgb_stride,
                   int y_stride, int uv_stride) {
  yuv420_argb32(image, py, pu, pv, width, height, rgb_stride, y_stride,
                uv_stride, 0);
}


x86 assembly (clang, -O0):
<mmxext_argb32>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x48,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
xor    %ebx,%ebx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1030 <yuv420_argb32@plt>
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmxext_argb32>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
push   $0x0
push   %rax
push   %r11
push   %r10
call   1030 <yuv420_argb32@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @mmxext_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = load i32, i32* %17
%27 = load i32, i32* %18
%28 = call i32 @yuv420_argb32(i32* %19, i32* %20, i32* %21, i32* %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 0)
ret void
}

LLVM IR (-O2):
define void @mmxext_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @yuv420_argb32(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cli();
int /*<<< orphan*/ nop();
int /*<<< orphan*/ outb(int, int);
void disable_interrupts(void) {
  outb(0x21, 0xFF);
  nop();
  outb(0xA1, 0xFF);
  cli();
}


x86 assembly (clang, -O0):
<disable_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <nop@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1050 <cli@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_interrupts>:
push   %rax
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <nop@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cli@plt>

LLVM IR (-O0):
define void @disable_interrupts() {
%1 = call i32 @outb(i32 33, i32 255)
%2 = call i32 (...) @nop()
%3 = call i32 @outb(i32 161, i32 255)
%4 = call i32 (...) @cli()
ret void
}

LLVM IR (-O2):
define void @disable_interrupts() {
%1 = tail call i32 @outb(i32 33, i32 255)
%2 = tail call i32 (...) @nop()
%3 = tail call i32 @outb(i32 161, i32 255)
%4 = tail call i32 (...) @cli()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int priv_encdec_proxy(char *, int, unsigned char const *, unsigned char *,
                      int /*<<< orphan*/ *, int);
int priv_enc_proxy(int flen, const unsigned char *from, unsigned char *to,
                   RSA *rsa, int padding) {
  return priv_encdec_proxy("priv_enc", flen, from, to, rsa, padding);
}


x86 assembly (clang, -O0):
<priv_enc_proxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
lea    0xebb(%rip),%rdi
call   1030 <priv_encdec_proxy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_enc_proxy>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xedb(%rip),%rdi
jmp    1030 <priv_encdec_proxy@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"priv_enc\00"
define i32 @priv_enc_proxy(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @priv_encdec_proxy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"priv_enc\00"
define i32 @priv_enc_proxy(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = tail call i32 @priv_encdec_proxy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2, i32* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int /*<<< orphan*/ lksmith_postlock(void const *, int);
int lksmith_prelock(void const *, int /*<<< orphan*/);
int r_pthread_spin_trylock(int /*<<< orphan*/ *);
int pthread_spin_trylock(pthread_spinlock_t *lock) {
  int ret = lksmith_prelock((const void *)lock, 0);
  if (ret)
    return ret;
  ret = r_pthread_spin_trylock(lock);
  lksmith_postlock((const void *)lock, ret);
  return ret;
}


x86 assembly (clang, -O0):
<pthread_spin_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <lksmith_prelock@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115f <pthread_spin_trylock+0x2f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <pthread_spin_trylock+0x4d>
mov    -0x10(%rbp),%rdi
call   1050 <r_pthread_spin_trylock@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <lksmith_postlock@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_spin_trylock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <lksmith_prelock@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1157 <pthread_spin_trylock+0x27>
mov    %rbx,%rdi
call   1050 <r_pthread_spin_trylock@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <lksmith_postlock@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pthread_spin_trylock(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
%7 = call i32 @lksmith_prelock(i8* %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %20
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = call i32 @r_pthread_spin_trylock(i32* %13)
store i32 %14, i32* %4
%15 = load i32*, i32** %3
%16 = bitcast i32* %15 to i8*
%17 = load i32, i32* %4
%18 = call i32 @lksmith_postlock(i8* %16, i32 %17)
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @pthread_spin_trylock(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @lksmith_prelock(i8* %2, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @r_pthread_spin_trylock(i32* %0)
%7 = tail call i32 @lksmith_postlock(i8* %2, i32 %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ %3, %1 ]
ret i32 %9
}
int test_imm_0Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 12
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ar9003_mci_bt_gain_ctrl(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_mci_bt_gain_ctrl(%struct.ath_hw* nocapture %0) {
ret void
}
void yyerror(char const *c) {}


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

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

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

LLVM IR (-O2):
define void @yyerror(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct dht {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dhtDumpIndented(int /*<<< orphan*/, struct dht *,
                                   int /*<<< orphan*/ *);
void dhtDump(struct dht *ht, FILE *f) { dhtDumpIndented(0, ht, f); }


x86 assembly (clang, -O0):
<dhtDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <dhtDumpIndented@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhtDump>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <dhtDumpIndented@plt>

LLVM IR (-O0):
%struct.dht = type { i32 }
define void @dhtDump(%struct.dht* %0, i32* %1) {
%3 = alloca %struct.dht*
%4 = alloca i32*
store %struct.dht* %0, %struct.dht** %3
store i32* %1, i32** %4
%5 = load %struct.dht*, %struct.dht** %3
%6 = load i32*, i32** %4
%7 = call i32 @dhtDumpIndented(i32 0, %struct.dht* %5, i32* %6)
ret void
}

LLVM IR (-O2):
%struct.dht = type { i32 }
define void @dhtDump(%struct.dht* %0, i32* %1) {
%3 = tail call i32 @dhtDumpIndented(i32 0, %struct.dht* %0, i32* %1)
ret void
}
int test2(int b) { return b * 2; }


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

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

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void analyze(char line[255]) {
  char *timestamp;
  char *dienst;
  char *server;
}


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

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

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

LLVM IR (-O2):
define void @analyze(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_single_push_targets(int, int);
void b_single_push_targets_test(void **state) {
  assert_int_equal(
      0x0000631408000000ul,
      b_single_push_targets(0x00E3140800000000ul, 0x0000631408000000ul));
}


x86 assembly (clang, -O0):
<b_single_push_targets_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x8000000,%esi
call   1040 <b_single_push_targets@plt>
mov    %eax,%esi
mov    $0x8000000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_single_push_targets_test>:
push   %rax
xor    %edi,%edi
mov    $0x8000000,%esi
call   1040 <b_single_push_targets@plt>
mov    $0x8000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_single_push_targets_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_single_push_targets(i32 0, i32 134217728)
%4 = call i32 @assert_int_equal(i32 134217728, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_single_push_targets_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_single_push_targets(i32 0, i32 134217728)
%3 = tail call i32 @assert_int_equal(i32 134217728, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double f1 = 5.e-1;
  double f2 = 5.00000e-1;
  if (f1 != f2) {
    {
      printf("Error %d\n", (int)1);
      exit(1);
    };
  }
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1164 <main+0x44>
jp     1164 <main+0x44>
jmp    1181 <main+0x61>
lea    0xe9d(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 5.000000e-01, double* %2
store double 5.000000e-01, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = fcmp une double %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void phdr_data_free(struct phdr_data *p) {}


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

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

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

LLVM IR (-O2):
%struct.phdr_data = type opaque
define void @phdr_data_free(%struct.phdr_data* nocapture %0) {
ret void
}
/* Variables and functions */
int reverse(int);
int reverse_diff(int n, int k) {
  int rev = reverse(n);
  int diff = rev - n;
  if (diff % k == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<reverse_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114e <reverse_diff+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <reverse_diff+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_diff>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <reverse@plt>
sub    %ebp,%eax
cltd
idiv   %ebx
xor    %eax,%eax
test   %edx,%edx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @reverse_diff(i32 %0, i32 %1) {
%3 = tail call i32 @reverse(i32 %0)
%4 = sub nsw i32 %3, %0
%5 = srem i32 %4, %1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int PAPI_cleanup_eventset(int);
void papif_cleanup_eventset_(int *EventSet, int *check) {
  *check = PAPI_cleanup_eventset(*EventSet);
}


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

x86 assembly (clang, -O2):
<papif_cleanup_eventset_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_cleanup_eventset@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_cleanup_eventset_(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* %5
%7 = call i32 @PAPI_cleanup_eventset(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_cleanup_eventset_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_cleanup_eventset(i32 %3)
store i32 %4, i32* %1
ret void
}
void f1(_Bool b) {
  switch (b)
    break;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
switch i32 %6, label %7 [
]
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f1(i1 zeroext %0) {
ret void
}
void security_bprm_free(struct linux_binprm *bprm) {}


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

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

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

LLVM IR (-O2):
%struct.linux_binprm = type opaque
define void @security_bprm_free(%struct.linux_binprm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shar() {
  printf("c = srcb&0x1;\n");
  printf("if (srcb&0x80) dst = (srcb>>1) | 0x80;\n");
  printf("else  dst = (srcb>>1) &~ 0x80;\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"c = srcb&0x1;\0A\00"
@.str.1 = [40 x i8] c"if (srcb&0x80) dst = (srcb>>1) | 0x80;\0A\00"
@.str.2 = [32 x i8] c"else dst = (srcb>>1) &~ 0x80;\0A\00"
define void @shar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"c = srcb&0x1;\00"
@str.3 = [39 x i8] c"if (srcb&0x80) dst = (srcb>>1) | 0x80;\00"
@str.4 = [31 x i8] c"else dst = (srcb>>1) &~ 0x80;\00"
define void @shar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ mode_t;

/* Variables and functions */
long strtol(char const *, char **, int);
int parsemode(const char *in, mode_t *out) {
  char *endptr;
  long int mode;
  mode = strtol(in, &endptr, 8);
  if (*endptr || mode < 0 || mode > 07777)
    return 1;
  *out = (mode_t)mode;
  return 0;
}


x86 assembly (clang, -O0):
<parsemode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115f <parsemode+0x4f>
cmpq   $0x0,-0x28(%rbp)
jl     115f <parsemode+0x4f>
cmpq   $0xfff,-0x28(%rbp)
jle    116b <parsemode+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    117d <parsemode+0x6d>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsemode>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %rax,%rcx
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
mov    $0x1,%eax
jne    114c <parsemode+0x3c>
test   %rcx,%rcx
js     114c <parsemode+0x3c>
cmp    $0xfff,%rcx
jg     114c <parsemode+0x3c>
mov    %rcx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parsemode(i8* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i64* %1, i64** %5
%8 = load i8*, i8** %4
%9 = call i64 @strtol(i8* %8, i8** %6, i32 8)
store i64 %9, i64* %7
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %2
%15 = load i64, i64* %7
%16 = icmp slt i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i64, i64* %7
%19 = icmp sgt i64 %18, 4095
br i1 %19, label %20, label %21
20: ; preds = %17, %14, %2
store i32 1, i32* %3
br label %24
21: ; preds = %17
%22 = load i64, i64* %7
%23 = load i64*, i64** %5
store i64 %22, i64* %23
store i32 0, i32* %3
br label %24
24: ; preds = %21, %20
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @parsemode(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 8)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp slt i64 %5, 0
%10 = select i1 %8, i1 true, i1 %9
%11 = icmp sgt i64 %5, 4095
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %14, label %13
13: ; preds = %2
store i64 %5, i64* %1
br label %14
14: ; preds = %2, %13
%15 = phi i32 [ 0, %13 ], [ 1, %2 ]
ret i32 %15
}
/* Variables and functions */
__attribute__((optimize("O0"))) __attribute__((weak)) void
__explicit_bzero_hook(void *buf, size_t len) {}


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

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

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

LLVM IR (-O2):
define weak void @__explicit_bzero_hook(i8* %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
void main(int i) {
  foo(1);
  bar(2);
  bar(3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x3,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @foo(i32 1)
%4 = call i32 @bar(i32 2)
%5 = call i32 @bar(i32 3)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @bar(i32 2)
%4 = tail call i32 @bar(i32 3)
ret void
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_CTRL2(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x14);
}


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

x86 assembly (clang, -O2):
<SPI_CTRL2>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x14,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_CTRL2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 20
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_CTRL2(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_show_bytes(int);
int main(int argc, char *argv[]) {
  int test_num = 328;
  test_show_bytes(test_num);
  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   $0x148,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <test_show_bytes@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x148,%edi
call   1030 <test_show_bytes@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 328, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @test_show_bytes(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_show_bytes(i32 328)
ret i32 0
}
void SIO1resume() {}


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

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

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

LLVM IR (-O2):
define void @SIO1resume() {
ret void
}