xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
uint32_t real_rdrand32() {
  uint32_t r;
  int ok;
  asm volatile("1: .byte 0x0f,0xc7,0xf0\n\t"
               "jc 2f\n\t"
               "dec %0\n\t"
               "jnz 1b\n\t"
               "2:"
               : "=r"(ok), "=a"(r)
               : "0"(10));
  if (!ok) {
    assert(0);
    exit(32);
  }
  return r;
}


x86 assembly (clang, -O0):
<real_rdrand32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%ecx
rdrand %eax
jb     113e <real_rdrand32+0x1e>
dec    %ecx
jne    112d <real_rdrand32+0xd>
mov    %ecx,-0xc(%rbp)
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1160 <real_rdrand32+0x40>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x20,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_rdrand32>:
mov    $0xa,%ecx
rdrand %eax
jb     112e <real_rdrand32+0xe>
dec    %ecx
jne    1125 <real_rdrand32+0x5>
test   %ecx,%ecx
je     1133 <real_rdrand32+0x13>
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x20,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @real_rdrand32() {
%1 = alloca i8*
%2 = alloca i32
%3 = call { i32, i8* } asm sideeffect "1: .byte 0x0f,0xc7,0xf0\0A\09jc 2f\0A\09dec $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%4 = extractvalue { i32, i8* } %3, 0
%5 = extractvalue { i32, i8* } %3, 1
store i32 %4, i32* %2
store i8* %5, i8** %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = call i32 @assert(i32 0)
%10 = call i32 @exit(i32 32)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
define i8* @real_rdrand32() {
%1 = tail call { i32, i8* } asm sideeffect "1: .byte 0x0f,0xc7,0xf0\0A\09jc 2f\0A\09dec $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%2 = extractvalue { i32, i8* } %1, 0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @assert(i32 0)
%6 = tail call i32 @exit(i32 32)
unreachable
7: ; preds = %0
%8 = extractvalue { i32, i8* } %1, 1
ret i8* %8
}
double dabs(double val) {
  if (val < 0)
    return (-val);
  else
    return (val);
}


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <dabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <dabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ __set_BASEPRI(int /*<<< orphan*/);
void disable_irq() { __set_BASEPRI(0); }


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

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

LLVM IR (-O0):
define void @disable_irq() {
%1 = call i32 @__set_BASEPRI(i32 0)
ret void
}

LLVM IR (-O2):
define void @disable_irq() {
%1 = tail call i32 @__set_BASEPRI(i32 0)
ret void
}
int main(void) { return 1 - 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t xs64(uint64_t *x) {
  *x ^= *x >> 12;
  *x ^= *x << 25;
  *x ^= *x >> 27;
  return *x * 2685821657736338717LL;
}


x86 assembly (clang, -O0):
<xs64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0xc,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x19,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1b,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
movabs $0x2545f4914f6cdd1d,%rcx
f4 45 25
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xs64>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0xc,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0x19,%eax
xor    %ecx,%eax
mov    %eax,%ecx
sar    $0x1b,%ecx
xor    %eax,%ecx
mov    %ecx,(%rdi)
imul   $0x4f6cdd1d,%ecx,%eax
ret

LLVM IR (-O0):
define i32 @xs64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 12
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = xor i32 %7, %5
store i32 %8, i32* %6
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = shl i32 %10, 25
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = xor i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = ashr i32 %16, 27
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = xor i32 %19, %17
store i32 %20, i32* %18
%21 = load i32*, i32** %2
%22 = load i32, i32* %21
%23 = sext i32 %22 to i64
%24 = mul nsw i64 %23, 2685821657736338717
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @xs64(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 12
%4 = xor i32 %3, %2
%5 = shl i32 %4, 25
%6 = xor i32 %5, %4
%7 = ashr i32 %6, 27
%8 = xor i32 %7, %6
store i32 %8, i32* %0
%9 = mul i32 %8, 1332534557
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void finish_curses() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @finish_curses() {
%1 = tail call i32 (...) @endwin()
ret void
}
__attribute__((section(".after_vectors"))) void DebugMon_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<DebugMon_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DebugMon_Handler+0x9>
jmp    1109 <DebugMon_Handler+0x9>

x86 assembly (clang, -O2):
<DebugMon_Handler>:
jmp    1100 <DebugMon_Handler>

LLVM IR (-O0):
define void @DebugMon_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @DebugMon_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, size_t);
void hubo_rt_stack_prefault(size_t stack_size) {
  unsigned char dummy[stack_size];
  memset(dummy, 0, stack_size);
}


x86 assembly (clang, -O0):
<hubo_rt_stack_prefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubo_rt_stack_prefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rdx
mov    %rsp,%rdi
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @hubo_rt_stack_prefault(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %3
%7 = alloca i8, i64 %5
store i64 %5, i64* %4
%8 = load i64, i64* %2
%9 = call i32 @memset(i8* %7, i32 0, i64 %8)
%10 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @hubo_rt_stack_prefault(i64 %0) {
%2 = alloca i8, i64 %0
%3 = call i32 @memset(i8* %2, i32 0, i64 %0)
ret void
}
osfinit(void) {}


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

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

LLVM IR (-O0):
define i32 @osfinit() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @osfinit() {
ret i32 undef
}
void gvcmz_neterr(int *err) { ; }


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

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

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

LLVM IR (-O2):
define void @gvcmz_neterr(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int socket(int, int, int);
int Socket(int family, int type, int protocol) {
  int n;
  if ((n = socket(family, type, protocol)) < 0)
    err_sys("socket error");
  return n;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1157 <Socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"socket error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void myMax1(int *arr, int *max, int n) {}


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

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

LLVM IR (-O0):
define void @myMax1(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
ret void
}

LLVM IR (-O2):
define void @myMax1(i32* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}
int isDalvikMoveResult(int opcode) {
  return ((opcode >= (0xA)) && (opcode <= (0xD)));
}


x86 assembly (clang, -O0):
<isDalvikMoveResult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isDalvikMoveResult+0x20>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDalvikMoveResult>:
add    $0xfffffff6,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isDalvikMoveResult(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int isonum_731(char *);
int isonum_733(unsigned char *p) { return (isonum_731((char *)p)); }


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

x86 assembly (clang, -O2):
<isonum_733>:
jmp    1030 <isonum_731@plt>

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

LLVM IR (-O2):
define i32 @isonum_733(i8* %0) {
%2 = tail call i32 @isonum_731(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printLine(char ch, int size) {
  int i;
  for (i = 0; i < size; i++) {
    putchar(ch);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<printLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <printLine+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <printLine+0x18>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLine>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <printLine+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printLine+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printLine(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i8 signext 10)
ret void
}
void *memdup(void *a, int len) {
  char *r = malloc(len);
  memcpy(r, a, len);
  return r;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define noalias i8* @memdup(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @malloc(i64 %3)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %3, i1 false)
ret i8* %4
}
/* Variables and functions */
void *ec_malloc(size_t);
int /*<<< orphan*/ memcpy(void *, char const *, size_t);
void *ec_malloc_fill(size_t size, const char *data) {
  void *mem = ec_malloc(size);
  memcpy(mem, data, size);
  return mem;
}


x86 assembly (clang, -O0):
<ec_malloc_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ec_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_malloc_fill>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <ec_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ec_malloc_fill(i64 %0, i8* %1) {
%3 = tail call i8* @ec_malloc(i64 %0)
%4 = tail call i32 @memcpy(i8* %3, i8* %1, i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ parloop(int);
int main(void) {
  parloop(10000000);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x989680,%edi
call   1030 <parloop@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parloop(i32 10000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("LITTLE THINGS MUST DIE!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"LITTLE THINGS MUST DIE!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"LITTLE THINGS MUST DIE!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void beepStopWalking() {}


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

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

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

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

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int ab_open(char const *, int, int /*<<< orphan*/);
int ab_creat(const char *pathname, mode_t mode) {
  return ab_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<ab_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ab_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <ab_open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @ab_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @ab_open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @ab_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @ab_open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cblByteOrderSwap64(int /*<<< orphan*/);
uint64_t cblByteOrderSwap64HostToBig(uint64_t swap) {
  return cblByteOrderSwap64(swap);
}


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

x86 assembly (clang, -O2):
<cblByteOrderSwap64HostToBig>:
jmp    1030 <cblByteOrderSwap64@plt>

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap64HostToBig(i32 %0) {
%2 = tail call i32 @cblByteOrderSwap64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ rbkeyget(void *);
int /*<<< orphan*/ stdout;
int preparekey(void *key) {
  if (rbkeyget(key)) {
    fprintf(stdout, "no key file\n");
    return 0x80003201;
  }
  return 0;
}


x86 assembly (clang, -O0):
<preparekey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rbkeyget@plt>
cmp    $0x0,%rax
je     1160 <preparekey+0x40>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x80003201,-0x4(%rbp)
jmp    1167 <preparekey+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preparekey>:
push   %rax
call   1040 <rbkeyget@plt>
test   %rax,%rax
je     1147 <preparekey+0x27>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x80003201,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"no key file\0A\00"
define i32 @preparekey(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @rbkeyget(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 -2147470847, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"no key file\0A\00"
define i32 @preparekey(i8* %0) {
%2 = tail call i64 @rbkeyget(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -2147470847, %4 ], [ 0, %1 ]
ret i32 %8
}
void gtk_clipboard_wait_for_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_wait_for_targets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int main(void) {
  volatile int cond;
  if (cond) {
    f();
  } else {
    g();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <f@plt>
jmp    114e <main+0x2e>
mov    $0x0,%al
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmpl   $0x0,0x4(%rsp)
je     1131 <main+0x11>
xor    %eax,%eax
call   1030 <f@plt>
jmp    1138 <main+0x18>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load volatile i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @f()
br label %9
7: ; preds = %0
%8 = call i32 (...) @g()
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @f()
br label %9
7: ; preds = %0
%8 = tail call i32 (...) @g()
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void hide_scr() { printf("%c[?25l", 0x1B); }


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

x86 assembly (clang, -O2):
<hide_scr>:
lea    0xee9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%c[?25l\00"
define void @hide_scr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%c[?25l\00"
define void @hide_scr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
/* Variables and functions */
int isdigit(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct cpumask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_IPI_mask_bitmask(struct cpumask const *, int);
void send_IPI_mask(const struct cpumask *mask, int vector) {
  send_IPI_mask_bitmask(mask, vector);
}


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

x86 assembly (clang, -O2):
<send_IPI_mask>:
jmp    1030 <send_IPI_mask_bitmask@plt>

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

LLVM IR (-O2):
%struct.cpumask = type { i32 }
define void @send_IPI_mask(%struct.cpumask* %0, i32 %1) {
%3 = tail call i32 @send_IPI_mask_bitmask(%struct.cpumask* %0, i32 %1)
ret void
}
void break_at_me(int id, int i) {}


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

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

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

LLVM IR (-O2):
define void @break_at_me(i32 %0, i32 %1) {
ret void
}
unsigned int readTimer(void) {
  volatile unsigned int *timerData = (unsigned int *)((0x73000000) + 8);
  return (*timerData);
}


x86 assembly (clang, -O0):
<readTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73000008,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTimer>:
mov    0x73000008,%eax
ret

LLVM IR (-O0):
define i32 @readTimer() {
%1 = alloca i32*
store i32* inttoptr (i64 1929379848 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load volatile i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @readTimer() {
%1 = load volatile i32, i32* inttoptr (i64 1929379848 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test();
int main() {
  if (test() != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test@plt>
cmp    $0x1,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
cmp    $0x1,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_helloworld() { printf("hello,world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello,world\00"
define void @print_helloworld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ____rb_erase_color(struct rb_node *, struct rb_root *);
struct rb_node *__rb_erase(struct rb_node *, struct rb_root *);
void rb_erase(struct rb_node *node, struct rb_root *root) {
  struct rb_node *rebalance;
  rebalance = __rb_erase(node, root);
  if (rebalance)
    ____rb_erase_color(rebalance, root);
}


x86 assembly (clang, -O0):
<rb_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__rb_erase@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <rb_erase+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <____rb_erase_color@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_erase>:
push   %rbx
mov    %rsi,%rbx
call   1040 <__rb_erase@plt>
test   %rax,%rax
je     113a <rb_erase+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <____rb_erase_color@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @rb_erase(%struct.rb_node* %0, %struct.rb_root* %1) {
%3 = alloca %struct.rb_node*
%4 = alloca %struct.rb_root*
%5 = alloca %struct.rb_node*
store %struct.rb_node* %0, %struct.rb_node** %3
store %struct.rb_root* %1, %struct.rb_root** %4
%6 = load %struct.rb_node*, %struct.rb_node** %3
%7 = load %struct.rb_root*, %struct.rb_root** %4
%8 = call %struct.rb_node* @__rb_erase(%struct.rb_node* %6, %struct.rb_root* %7)
store %struct.rb_node* %8, %struct.rb_node** %5
%9 = load %struct.rb_node*, %struct.rb_node** %5
%10 = icmp ne %struct.rb_node* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.rb_node*, %struct.rb_node** %5
%13 = load %struct.rb_root*, %struct.rb_root** %4
%14 = call i32 @____rb_erase_color(%struct.rb_node* %12, %struct.rb_root* %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @rb_erase(%struct.rb_node* %0, %struct.rb_root* %1) {
%3 = tail call %struct.rb_node* @__rb_erase(%struct.rb_node* %0, %struct.rb_root* %1)
%4 = icmp eq %struct.rb_node* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @____rb_erase_color(%struct.rb_node* %3, %struct.rb_root* %1)
br label %7
7: ; preds = %5, %2
ret void
}
void Delay(int del) {
  int i;
  for (i = 0; i < 10000 * del; i++)
    ;
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x2710,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1133 <Delay+0x33>
jmp    1125 <Delay+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Delay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay(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* %3
%6 = load i32, i32* %2
%7 = mul nsw i32 10000, %6
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay(i32 %0) {
ret void
}
/* Variables and functions */
int toupper(int);
void test_toupper_symbolic2(int x) {
  if (x > 255) {
    int ret = toupper(x);
    (void)ret;
  }
}


x86 assembly (clang, -O0):
<test_toupper_symbolic2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1133 <test_toupper_symbolic2+0x23>
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_toupper_symbolic2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @toupper(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @test_toupper_symbolic2(i32 %0) {
ret void
}
/* Variables and functions */
int count();
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  printf("count=%d count=%d count=%d\n", count(), count(), count());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <count@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <count@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <count@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <count@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <count@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <count@plt>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"count=%d count=%d count=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @count()
%4 = tail call i32 (...) @count()
%5 = tail call i32 (...) @count()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printMessage();
int main(void) {
  printMessage();
  printMessage();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printMessage()
%2 = tail call i32 (...) @printMessage()
ret i32 0
}
void dosuart(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dosuart() {
ret void
}
void __attribute__((no)) foo(void) { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int problem006() {
  int sum = 0;
  int sum2 = 0;
  int i = 0;
  for (i = 1; i < 101; i++) {
    sum += i * i;
    sum2 += i;
  }
  printf("%d\n", (sum2 * sum2) - sum);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x65,-0xc(%rbp)
jge    1162 <problem006+0x52>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <problem006+0x24>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
sub    -0x4(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @problem006() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %3
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 101
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %1
%12 = add nsw i32 %11, %10
store i32 %12, i32* %1
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
br label %16
16: ; preds = %7
%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 = load i32, i32* %2
%22 = mul nsw i32 %20, %21
%23 = load i32, i32* %1
%24 = sub nsw i32 %22, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @problem006() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Type definitions */
struct icmp {
  int icmp_type;
};

/* Variables and functions */
int get_icmp_type(struct icmp *self) { return self->icmp_type; }


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

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

LLVM IR (-O0):
%struct.icmp = type { i32 }
define i32 @get_icmp_type(%struct.icmp* %0) {
%2 = alloca %struct.icmp*
store %struct.icmp* %0, %struct.icmp** %2
%3 = load %struct.icmp*, %struct.icmp** %2
%4 = getelementptr inbounds %struct.icmp, %struct.icmp* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.icmp = type { i32 }
define i32 @get_icmp_type(%struct.icmp* nocapture %0) {
%2 = getelementptr inbounds %struct.icmp, %struct.icmp* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int __u8;
typedef int __u16;

/* Variables and functions */
__u8 hi8(__u16 n) { return (n >> 8); }


x86 assembly (clang, -O0):
<hi8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi8>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @hi8(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
/* Variables and functions */
void free(void *);
void myfree(void *ptr) { return free(ptr); }


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

x86 assembly (clang, -O2):
<myfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @myfree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int y[][2] = {1, 2, 3, 4};
  if (y[0][0] != 1 || y[0][1] != 2 || y[1][0] != 3 || y[1][1] != 4) {
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    115d <main+0x4d>
cmpl   $0x2,-0x1c(%rbp)
jne    115d <main+0x4d>
cmpl   $0x3,-0x18(%rbp)
jne    115d <main+0x4d>
cmpl   $0x4,-0x14(%rbp)
je     1164 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.y = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%3 = bitcast [2 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 1
br i1 %7, label %23, label %8
8: ; preds = %0
%9 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 2
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 3
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %18, %13, %8, %0
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void kmain(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <kmain+0x9>
jmp    1109 <kmain+0x9>

x86 assembly (clang, -O2):
<kmain>:
jmp    1100 <kmain>

LLVM IR (-O0):
define void @kmain() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @kmain() {
br label %1
1: ; preds = %0, %1
br label %1
}
void c1_v1(void) {}


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

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

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

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