xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ wait_vsync();
void delay() {
  int i;
  for (i = 0; i < 50 / 3; i++)
    wait_vsync();
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    113e <delay+0x2e>
mov    $0x0,%al
call   1030 <wait_vsync@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <delay+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rax
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
call   1030 <wait_vsync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <wait_vsync@plt>

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @wait_vsync()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 (...) @wait_vsync()
%2 = tail call i32 (...) @wait_vsync()
%3 = tail call i32 (...) @wait_vsync()
%4 = tail call i32 (...) @wait_vsync()
%5 = tail call i32 (...) @wait_vsync()
%6 = tail call i32 (...) @wait_vsync()
%7 = tail call i32 (...) @wait_vsync()
%8 = tail call i32 (...) @wait_vsync()
%9 = tail call i32 (...) @wait_vsync()
%10 = tail call i32 (...) @wait_vsync()
%11 = tail call i32 (...) @wait_vsync()
%12 = tail call i32 (...) @wait_vsync()
%13 = tail call i32 (...) @wait_vsync()
%14 = tail call i32 (...) @wait_vsync()
%15 = tail call i32 (...) @wait_vsync()
%16 = tail call i32 (...) @wait_vsync()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alter(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char animal[] = "cat";
  printf("Turn the %s ", animal);
  alter(animal);
  printf("into a %s\n", animal);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <alter@plt>
lea    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x746163,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <alter@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.animal = [4 x i8] c"cat\00"
@.str = [13 x i8] c"Turn the %s \00"
@.str.1 = [11 x i8] c"into a %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @alter(i8* %6)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Turn the %s \00"
@.str.1 = [11 x i8] c"into a %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 7627107, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @alter(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void main(void) {
  int x;
  int y;
  if (x + y > 5 - x) {
    x = y - 1;
  } else {
    y = x + 1;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x5,%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    1128 <main+0x28>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <main+0x31>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daughter_say();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wife_say();
int main() {
  printf("These are my girls/n");
  daughter_say();
  wife_say();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <daughter_say@plt>
xor    %eax,%eax
call   1050 <wife_say@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"These are my girls/n\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @daughter_say()
%4 = call i32 (...) @wife_say()
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"These are my girls/n\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @daughter_say()
%3 = tail call i32 (...) @wife_say()
ret i32 0
}
unsigned _lcd_contrast_func(unsigned contrast) { return ((contrast)*12 + 76); }


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

x86 assembly (clang, -O2):
<_lcd_contrast_func>:
lea    (%rdi,%rdi,2),%eax
lea    0x4c(,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @_lcd_contrast_func(i32 %0) {
%2 = mul i32 %0, 12
%3 = add i32 %2, 76
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DecrementCursor();
int /*<<< orphan*/ Delay(int, long *);
void BackSpinCursor(short decrementIndex) {
  long dummyLong;
  short i;
  for (i = 0; i < decrementIndex; i++) {
    DecrementCursor();
    Delay(1, &dummyLong);
  }
}


x86 assembly (clang, -O0):
<BackSpinCursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x12(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    116b <BackSpinCursor+0x4b>
mov    $0x0,%al
call   1040 <DecrementCursor@plt>
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
call   1030 <Delay@plt>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1135 <BackSpinCursor+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackSpinCursor>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %bx,%bx
jle    114a <BackSpinCursor+0x2a>
mov    %rsp,%r14
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <DecrementCursor@plt>
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <Delay@plt>
add    $0xffff,%bx
jne    1130 <BackSpinCursor+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @BackSpinCursor(i16 signext %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = icmp sgt i16 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i16 [ %9, %5 ], [ 0, %1 ]
%7 = call i32 (...) @DecrementCursor()
%8 = call i32 @Delay(i32 1, i64* %2)
%9 = add nuw nsw i16 %6, 1
%10 = icmp eq i16 %9, %0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_hv64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv64_8_sse4() {
ret void
}
int test_imm_06uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x06 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_06uint64_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, 6
%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_06uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 393216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void shiftLeft(char *src, int index, int amount) {
  if (amount == 0)
    return;
  for (int i = 0;; i++) {
    src[i - amount] = src[i];
    if (src[i] == '\0')
      break;
  }
}


x86 assembly (clang, -O0):
<shiftLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    111d <shiftLeft+0x1d>
jmp    116c <shiftLeft+0x6c>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1159 <shiftLeft+0x59>
jmp    116c <shiftLeft+0x6c>
jmp    115e <shiftLeft+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <shiftLeft+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftLeft>:
test   %edx,%edx
je     111f <shiftLeft+0x1f>
movslq %edx,%rax
neg    %rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <shiftLeft+0x10>
ret

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

LLVM IR (-O2):
define void @shiftLeft(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %15, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sub nsw i64 %8, %6
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %10, i8* %12
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
%15 = add nuw i64 %8, 1
br i1 %14, label %16, label %7
16: ; preds = %7, %3
ret void
}
void SPI_InitPortStructs(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_InitPortStructs() {
ret void
}
int test_imm_57uint8_mem(unsigned char *val) {
  return ((*val) & (-0x57 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_57uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -87
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int bar(long double x) {
  union {
    struct {
      char a[8];
      unsigned int b : 7;
    } c;
    long double d;
  } u;
  u.d = x;
  return u.c.b;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    -0x18(%rbp),%al
and    $0x7f,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movzwl 0x10(%rsp),%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80 }
%struct.anon = type { [8 x i8], i8, [3 x i8] }
define i32 @bar(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = bitcast %union.anon* %3 to x86_fp80*
store x86_fp80 %4, x86_fp80* %5
%6 = bitcast %union.anon* %3 to %struct.anon*
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
%8 = load i8, i8* %7
%9 = and i8 %8, 127
%10 = zext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = lshr i80 %2, 64
%4 = trunc i80 %3 to i32
%5 = and i32 %4, 127
ret i32 %5
}
void test5(int *a, int *b) {
  int i;
  for (i = 0; i < 100000; ++i) {
    *b += a[i];
    a[i] = *b;
  }
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x186a0,-0x14(%rbp)
jge    1152 <test5+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test5+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi),%ecx
add    -0x4(%rdi,%rax,4),%ecx
mov    %ecx,(%rsi)
mov    %ecx,-0x4(%rdi,%rax,4)
mov    (%rsi),%ecx
add    (%rdi,%rax,4),%ecx
mov    %ecx,(%rsi)
mov    %ecx,(%rdi,%rax,4)
add    $0x2,%rax
cmp    $0x186a1,%rax
jne    1110 <test5+0x10>
ret

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

LLVM IR (-O2):
define void @test5(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %14, %3 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
store i32 %8, i32* %5
%9 = or i64 %4, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %11
store i32 %13, i32* %1
store i32 %13, i32* %10
%14 = add nuw nsw i64 %4, 2
%15 = icmp eq i64 %14, 100000
br i1 %15, label %16, label %3
16: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void screen_beep(void) {
  char c = '\007';
  write(1, &c, 1);
}


x86 assembly (clang, -O0):
<screen_beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x7,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_beep>:
push   %rax
movb   $0x7,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @screen_beep() {
%1 = alloca i8
store i8 7, i8* %1
%2 = call i32 @write(i32 1, i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @screen_beep() {
%1 = alloca i8
store i8 7, i8* %1
%2 = call i32 @write(i32 1, i8* %1, i32 1)
ret void
}
int is_little() {
  int little = 1;
  return (*(unsigned char *)&little);
}


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

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

LLVM IR (-O0):
define i32 @is_little() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_little() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void out_hook(char *line, void *data) {
  fprintf(stdout, "%s", line);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<out_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_hook>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @out_hook(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @out_hook(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ noraw();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void killed(int signo) {
  (printf("\x1b[H\x1b[J"), fflush(stdout));
  fprintf(stderr, "hltest: killed by signal %i\r\n", signo);
  noraw();
  exit(0);
}


x86 assembly (clang, -O0):
<killed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe7f(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <noraw@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<killed>:
push   %rbx
mov    %edi,%ebx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <noraw@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.1 = [30 x i8] c"hltest: killed by signal %i\0D\0A\00"
define void @killed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @noraw()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.1 = [30 x i8] c"hltest: killed by signal %i\0D\0A\00"
define void @killed(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @noraw()
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g_print(char *, char const *, double, double);
void show_timing(double result, const char *name) {
  g_print("Timer %15s: %0.6f (%0.2f 1/s)\n", name, result,
          result > 0.000001 ? 1.0 / result : 0.0);
}


x86 assembly (clang, -O0):
<show_timing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1161 <show_timing+0x51>
movsd  0xeb6(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    116e <show_timing+0x5e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    116e <show_timing+0x5e>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
movsd  -0x28(%rbp),%xmm1
lea    0xe8d(%rip),%rdi
call   1030 <g_print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_timing>:
mov    %rdi,%rsi
xorpd  %xmm1,%xmm1
ucomisd 0xee1(%rip),%xmm0
jbe    112d <show_timing+0x1d>
movsd  0xedf(%rip),%xmm1
divsd  %xmm0,%xmm1
lea    0xedc(%rip),%rdi
jmp    1030 <g_print@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Timer %15s: %0.6f (%0.2f 1/s)\0A\00"
define void @show_timing(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fcmp ogt double %7, 0x3EB0C6F7A0B5ED8D
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %3
%11 = fdiv double 1.000000e+00, %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %9
%14 = phi double [ %11, %9 ], [ 0.000000e+00, %12 ]
%15 = call i32 @g_print(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5, double %6, double %14)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Timer %15s: %0.6f (%0.2f 1/s)\0A\00"
define void @show_timing(double %0, i8* %1) {
%3 = fcmp ogt double %0, 0x3EB0C6F7A0B5ED8D
%4 = fdiv double 1.000000e+00, %0
%5 = select i1 %3, double %4, double 0.000000e+00
%6 = tail call i32 @g_print(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, double %0, double %5)
ret void
}
/* Variables and functions */
long atol(char const *);
__attribute__((__weak__, __always___)) long
softboundmpx_atol(const char *nptr) {
  return atol(nptr);
}


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

x86 assembly (clang, -O2):
<softboundmpx_atol>:
jmp    1030 <atol@plt>

LLVM IR (-O0):
define weak i64 @softboundmpx_atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atol(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define weak i64 @softboundmpx_atol(i8* %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
char mytoupper(char c) {
  c -= 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<mytoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytoupper>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @mytoupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @mytoupper(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Variables and functions */
bool isValidMacAddrStr(char *str) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @isValidMacAddrStr(i8* nocapture readnone %0) {
ret i32 1
}
unsigned int f(unsigned int a, unsigned int b, unsigned int c) {
  a += (unsigned short)b * (unsigned short)c;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
mov    -0xc(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %si,%ecx
movzwl %dx,%eax
imul   %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(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* %5
%8 = trunc i32 %7 to i16
%9 = zext i16 %8 to i32
%10 = load i32, i32* %6
%11 = trunc i32 %10 to i16
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %4
%15 = add i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 65535
%5 = and i32 %2, 65535
%6 = mul nuw nsw i32 %5, %4
%7 = add i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ftruncate(int fd, off_t length) {
  printf("TODO: ftruncate() not yet implemented!\n");
  return -1;
}


x86 assembly (clang, -O0):
<ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"TODO: ftruncate() not yet implemented!\0A\00"
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [39 x i8] c"TODO: ftruncate() not yet implemented!\00"
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ lua_pushnumber(double);
void io_clock(void) { lua_pushnumber(((double)clock()) / CLOCKS_PER_SEC); }


x86 assembly (clang, -O0):
<io_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb1(%rip),%rax
divsd  (%rax),%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_clock>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @io_clock() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
%5 = call i32 @lua_pushnumber(double %4)
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @io_clock() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
%5 = tail call i32 @lua_pushnumber(double %4)
ret void
}
void memcpy_1(char *source, char *target) {
  char *src = source;
  char *tgt = target;
  while (*tgt++ = *src++)
    ;
}


x86 assembly (clang, -O0):
<memcpy_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <memcpy_1+0x4b>
jmp    111c <memcpy_1+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <memcpy_1+0x10>
ret

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

LLVM IR (-O2):
define void @memcpy_1(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
float *quat_zero(float *result) {
  result[0] = 0.0f;
  result[1] = 0.0f;
  result[2] = 0.0f;
  result[3] = 0.0f;
  return result;
}


x86 assembly (clang, -O0):
<quat_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_zero>:
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define float* @quat_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
%11 = load float*, float** %2
ret float* %11
}

LLVM IR (-O2):
define float* @quat_zero(float* returned writeonly %0) {
%2 = bitcast float* %0 to i8*
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fail(const char *why) {
  fprintf(stderr, "measure: fatal: %s\n", why);
  exit(111);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"measure: fatal: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 111)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"measure: fatal: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 111)
unreachable
}
int sum(int arr[], int n) { return 1337; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x539,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture readnone %0, i32 %1) {
ret i32 1337
}
int *init_array(int *array, int length) {
  int i;
  for (i = 0; i < length; i++) {
    *(array + i) = 0;
  }
  return array;
}


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

x86 assembly (clang, -O2):
<init_array>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    1128 <init_array+0x18>
mov    %esi,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @init_array(i32* returned writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32* %0
}
int MozTaggedMemoryIsSupported(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MozTaggedMemoryIsSupported() {
ret i32 0
}
void buffered_on_write(struct bufferevent *bev, void *arg) {}


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

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

LLVM IR (-O0):
%struct.bufferevent = type opaque
define void @buffered_on_write(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type opaque
define void @buffered_on_write(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int last_node;

/* Variables and functions */
int /*<<< orphan*/ sift_down_iterative(int *, int, int);
void heapify(int *A, int size) {
  int last_node;
  int parent;
  last_node = size - 1;
  parent = (((last_node)-1) / 2);
  while (parent >= 0) {
    sift_down_iterative(A, parent, size - 1);
    parent = parent - 1;
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1163 <heapify+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <sift_down_iterative@plt>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <heapify+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1141 <heapify+0x31>
mov    %rdi,%r14
lea    -0x1(%rsi),%ebp
mov    %esi,%eax
add    $0xfffffffe,%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%ebx
add    $0xfffffffe,%ebx
sar    %ebx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <sift_down_iterative@plt>
add    $0xffffffff,%ebx
jb     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heapify(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* %4
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = sdiv i32 %10, 2
store i32 %11, i32* %6
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %6
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32*, i32** %3
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = call i32 @sift_down_iterative(i32* %16, i32 %17, i32 %19)
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %6
br label %12
23: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = add nsw i32 %1, -2
%7 = sdiv i32 %6, 2
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ %11, %8 ], [ %7, %5 ]
%10 = tail call i32 @sift_down_iterative(i32* %0, i32 %9, i32 %3)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
ret void
}
/* Variables and functions */
char EOF;
char getchar();
void clear_stdin(void) {
  char c;
  while ((c = getchar()) != EOF && c != '\n') {
  }
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
mov    0x2ebc(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1149 <clear_stdin+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1159 <clear_stdin+0x49>
jmp    115e <clear_stdin+0x4e>
jmp    1118 <clear_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EOF = global i8 0
define void @clear_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp ne i8 %2, %3
%5 = icmp ne i8 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, unsigned char *, int);
void change_status(int fd, unsigned char status) {
  write(fd, &status, 1);
  usleep(10);
}


x86 assembly (clang, -O0):
<change_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_status>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @change_status(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* %4, i32 1)
%7 = call i32 @usleep(i32 10)
ret void
}

LLVM IR (-O2):
define void @change_status(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = tail call i32 @usleep(i32 10)
ret void
}
void gtk_selection_data_get_uris() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_get_uris() {
ret void
}
/* Variables and functions */
char *getmounted();
int /*<<< orphan*/ printf(char *, char *);
char *smprintf(char *, char *);
int main(int argc, char *argv[]) {
  char *mounted;
  mounted = getmounted();
  char *status = smprintf("%s", mounted);
  printf("%s\n", status);
  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)
mov    $0x0,%al
call   1050 <getmounted@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <smprintf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getmounted@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <smprintf@plt>
lea    0xeb5(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getmounted()
%4 = tail call i8* @smprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}