xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int C = 3;
  printf("A = %d\n", C + C);
  printf("A = %d\n", 5 + 5);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"A = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void __attribute__((weak)) tim1_up_tim10_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<tim1_up_tim10_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim1_up_tim10_isr = [18 x i8] c"tim1_up_tim10_isr\00"
define weak void @tim1_up_tim10_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim1_up_tim10_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim1_up_tim10_isr = [18 x i8] c"tim1_up_tim10_isr\00"
define weak void @tim1_up_tim10_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim1_up_tim10_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xf8() {
  Assert_real((isodigit(248) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1245, ("isodigit should be 0 for 0xf8"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xf8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4dd,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4dd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf8\00"
define void @t_isodigit_0xf8() {
%1 = call i64 @isodigit(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf8\00"
define void @t_isodigit_0xf8() {
%1 = tail call i64 @isodigit(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool nrf51_errata_48(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_48() {
ret i32 0
}
long long uusz() { return 0x7fff7fffffff0000LL; }


x86 assembly (clang, -O0):
<uusz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff7fffffff0000,%rax
7f ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<uusz>:
movabs $0x7fff7fffffff0000,%rax
7f ff 7f
ret

LLVM IR (-O0):
define i64 @uusz() {
ret i64 9223231299366354944
}

LLVM IR (-O2):
define i64 @uusz() {
ret i64 9223231299366354944
}
void H444ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @H444ToABGR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void watchdog_reboot(void) { exit(-1); }


x86 assembly (clang, -O0):
<watchdog_reboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<watchdog_reboot>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @watchdog_reboot() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @watchdog_reboot() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
void cont_com() {}


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

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

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

LLVM IR (-O2):
define void @cont_com() {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(scalar_t__ volatile);
void SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(_SSIBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000014))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<SSIIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntDisable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    0x10(%rsp),%rax
not    %rax
mov    0x8(%rsp),%rcx
and    %rax,0x14(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = call i32 @_SSIBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 20
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = tail call i32 @_SSIBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 20
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}
void energest_init(void) {}


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

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

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

LLVM IR (-O2):
define void @energest_init() {
ret void
}
/* Variables and functions */
void putchar(char c) {
  unsigned int *base;
  if (c == '\n') {
    putchar('\r');
  }
  base = (unsigned int *)0xF0300000;
  while ((*(base + 2) & 1) == 0)
    ;
  *(base + 3) = c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <putchar+0x25>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xf0300000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1156 <putchar+0x46>
jmp    113e <putchar+0x2e>
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    $0xf0300008,%eax
cmp    $0xa,%dil
jne    1119 <putchar+0x19>
testb  $0x1,(%rax)
jne    1112 <putchar+0x12>
jmp    1110 <putchar+0x10>
movl   $0xd,0x4(%rax)
testb  $0x1,(%rax)
jne    1122 <putchar+0x22>
xchg   %ax,%ax
jmp    1120 <putchar+0x20>
movsbl %dil,%ecx
mov    %ecx,0x4(%rax)
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
store i32* inttoptr (i64 4029677568 to i32*), i32** %3
br label %9
9: ; preds = %15, %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
store i32 %18, i32* %20
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i32, i32* inttoptr (i64 4029677576 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3, %7
br label %7
8: ; preds = %3
store i32 13, i32* inttoptr (i64 4029677580 to i32*)
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* inttoptr (i64 4029677576 to i32*)
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %13
br label %13
14: ; preds = %9
%15 = sext i8 %0 to i32
store i32 %15, i32* inttoptr (i64 4029677580 to i32*)
ret void
}
int socket_accept_connection(struct socket *s, struct socket_address *sa) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.socket = type opaque
%struct.socket_address = type opaque
define i32 @socket_accept_connection(%struct.socket* %0, %struct.socket_address* %1) {
%3 = alloca %struct.socket*
%4 = alloca %struct.socket_address*
store %struct.socket* %0, %struct.socket** %3
store %struct.socket_address* %1, %struct.socket_address** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.socket = type opaque
%struct.socket_address = type opaque
define i32 @socket_accept_connection(%struct.socket* nocapture readnone %0, %struct.socket_address* nocapture readnone %1) {
ret i32 -1
}
int test45(int j) {
  int x = 1, y = x + 1;
  if (y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<test45>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     112c <test45+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <test45+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test45(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t pdu_phone_digits(uint8_t *in, uint8_t bytes) {
  uint8_t len = bytes << 1;
  if ((in[bytes - 1] & 0xF0) == 0xF0)
    len--;
  return len;
}


x86 assembly (clang, -O0):
<pdu_phone_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xf0,%eax
cmp    $0xf0,%eax
jne    113d <pdu_phone_digits+0x3d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_phone_digits>:
movslq %esi,%rcx
lea    (%rsi,%rsi,1),%eax
mov    -0x4(%rdi,%rcx,4),%ecx
not    %ecx
and    $0xf0,%ecx
cmp    $0x1,%ecx
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @pdu_phone_digits(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %7, 240
%9 = icmp eq i32 %8, 240
%10 = sext i1 %9 to i32
%11 = add nsw i32 %3, %10
ret i32 %11
}
/* Variables and functions */
int big_leaf(int);
int big_func(int arg) {
  int array[60];
  array[arg] = big_leaf(arg);
  return array[arg];
}


x86 assembly (clang, -O0):
<big_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <big_leaf@plt>
mov    %eax,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x100(%rbp,%rax,4)
movslq -0x4(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_func>:
jmp    1030 <big_leaf@plt>

LLVM IR (-O0):
define i32 @big_func(i32 %0) {
%2 = alloca i32
%3 = alloca [60 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @big_leaf(i32 %4)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [60 x i32], [60 x i32]* %3, i64 0, i64 %7
store i32 %5, i32* %8
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [60 x i32], [60 x i32]* %3, i64 0, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @big_func(i32 %0) {
%2 = tail call i32 @big_leaf(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testPlus() { printf("%d + %d = %d\n", 10, 4, 10 + 4); }


x86 assembly (clang, -O0):
<testPlus>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0xe,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPlus>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0xe,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @testPlus() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  puts("starting");
  setreuid(getuid(), getuid());
  system("/bin/sh");
  puts("ending");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1060 <setreuid@plt>
lea    0xe93(%rip),%rdi
call   1050 <system@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <setreuid@plt>
lea    0xe9c(%rip),%rdi
call   1050 <system@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"starting\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [7 x i8] c"ending\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @getuid()
%4 = call i32 @setreuid(i32 %2, i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"starting\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [7 x i8] c"ending\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getuid()
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @setreuid(i32 %2, i32 %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void decode_table_init() {}


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

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

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

LLVM IR (-O2):
define void @decode_table_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int);
void socket_close(int fd) {
  shutdown(fd, 2);
  close(fd);
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
define void @socket_close(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = tail call i32 @close(i32 %0)
ret void
}
void set(int *a) { *a = 8; }


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

x86 assembly (clang, -O2):
<set>:
movl   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @set(i32* nocapture writeonly %0) {
store i32 8, i32* %0
ret void
}
int stdimpl_strcmp(const char *s1, const char *s2) {
  char c1, c2;
  do {
    c1 = *s1++;
    c2 = *s2++;
  } while ((c1) && (c2) && (c1 == c2));
  return c1 - c2;
}


x86 assembly (clang, -O0):
<stdimpl_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x13(%rbp)
je     1168 <stdimpl_strcmp+0x68>
movsbl -0x12(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x13(%rbp)
je     1168 <stdimpl_strcmp+0x68>
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
test   $0x1,%al
jne    110c <stdimpl_strcmp+0xc>
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
test   %eax,%eax
je     1128 <stdimpl_strcmp+0x28>
test   %dl,%dl
je     1128 <stdimpl_strcmp+0x28>
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <stdimpl_strcmp+0x10>
movsbl %dl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @stdimpl_strcmp(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
br label %7
7: ; preds = %28, %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
store i8 %10, i8* %5
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
store i8 %13, i8* %6
br label %14
14: ; preds = %7
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8, i8* %6
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = load i8, i8* %6
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %24, %26
br label %28
28: ; preds = %22, %18, %14
%29 = phi i1 [ false, %18 ], [ false, %14 ], [ %27, %22 ]
br i1 %29, label %7, label %30
30: ; preds = %28
%31 = load i8, i8* %5
%32 = sext i8 %31 to i32
%33 = load i8, i8* %6
%34 = sext i8 %33 to i32
%35 = sub nsw i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @stdimpl_strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %11, %3 ]
%5 = phi i8* [ %0, %2 ], [ %12, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp ne i8 %6, 0
%9 = icmp ne i8 %7, 0
%10 = select i1 %8, i1 %9, i1 false
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = icmp eq i8 %6, %7
%14 = select i1 %10, i1 %13, i1 false
br i1 %14, label %3, label %15
15: ; preds = %3
%16 = sext i8 %7 to i32
%17 = sext i8 %6 to i32
%18 = sub nsw i32 %17, %16
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_usage(const char *progname) {
  printf("[Usage]\n"
         "  $ %s [options] FILE\n\n",
         progname);
  printf("[Options]\n"
         "  -a\n"
         "    apple apple apple\n"
         "  -b BANANA\n"
         "    banana banana banana\n"
         "  -c CAKE\n"
         "    cake cake cake\n"
         "  -h\n"
         "    Show help of this program\n"
         "  -v\n"
         "    Show version of this program\n");
}


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

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"[Usage]\0A $ %s [options] FILE\0A\0A\00"
@.str.1 = [177 x i8] c"[Options]\0A -a\0A apple apple apple\0A -b BANANA\0A banana banana banana\0A -c CAKE\0A cake cake cake\0A -h\0A Show help of this program\0A -v\0A Show version of this program\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"[Usage]\0A $ %s [options] FILE\0A\0A\00"
@str = [176 x i8] c"[Options]\0A -a\0A apple apple apple\0A -b BANANA\0A banana banana banana\0A -c CAKE\0A cake cake cake\0A -h\0A Show help of this program\0A -v\0A Show version of this program\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([176 x i8], [176 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int accept(int, struct sockaddr *, int *);
int create_server_socket(int server) {
  struct sockaddr_storage addr;
  socklen_t addrlen = sizeof(addr);
  int connected_socket = accept(server, (struct sockaddr *)&addr, &addrlen);
  ASSERT(connected_socket >= 0);
  return connected_socket;
}


x86 assembly (clang, -O0):
<create_server_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_server_socket>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <ASSERT@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @create_server_socket(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_storage
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @create_server_socket(i32 %0) {
%2 = alloca %struct.sockaddr_storage
%3 = alloca i32
%4 = bitcast %struct.sockaddr_storage* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_storage* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = xor i32 %7, -1
%9 = lshr i32 %8, 31
%10 = call i32 @ASSERT(i32 %9)
ret i32 %7
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
main() {
  if (EOF)
    printf("'EOF' is non-zero\n");
  else
    printf("'EOF' is zero\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
cmpq   $0x0,(%rax)
je     1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
cmpq   $0x0,(%rax)
lea    0xedd(%rip),%rax
lea    0xee4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [19 x i8] c"'EOF' is non-zero\0A\00"
@.str.1 = [15 x i8] c"'EOF' is zero\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EOF = global i64 0
@str = [14 x i8] c"'EOF' is zero\00"
@str.2 = [18 x i8] c"'EOF' is non-zero\00"
define i32 @main() {
%1 = load i64, i64* @EOF
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t uint_32_be(const uint8_t *const p) {
  return (((int)p[0] & 0xff) << 24) | (((int)p[1] & 0xff) << 16) |
         (((int)p[2] & 0xff) << 8) | (((int)p[3] & 0xff));
}


x86 assembly (clang, -O0):
<uint_32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_32_be>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
movzbl %cl,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
movzwl %ax,%edx
or     %ecx,%edx
movzbl 0x18(%rdi),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @uint_32_be(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 255
%8 = shl i32 %7, 24
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = and i32 %12, 255
%14 = shl i32 %13, 16
%15 = or i32 %8, %14
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = and i32 %19, 255
%21 = shl i32 %20, 8
%22 = or i32 %15, %21
%23 = load i64*, i64** %2
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = and i32 %26, 255
%28 = or i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @uint_32_be(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = and i32 %8, 16711680
%10 = or i32 %9, %4
%11 = getelementptr inbounds i64, i64* %0, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = and i32 %14, 65280
%16 = or i32 %10, %15
%17 = getelementptr inbounds i64, i64* %0, i64 3
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = and i32 %19, 255
%21 = or i32 %16, %20
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(float const, float const, float const,
                                float const);
void draw_clear(const float color[4]) {
  glClearColor(color[0], color[1], color[2], color[3]);
  glClear(GL_COLOR_BUFFER_BIT);
}


x86 assembly (clang, -O0):
<draw_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm3
call   1040 <glClearColor@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_clear>:
push   %rax
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
movss  0xc(%rdi),%xmm3
call   1040 <glClearColor@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glClear@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @draw_clear(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 3
%14 = load float, float* %13
%15 = call i32 @glClearColor(float %5, float %8, float %11, float %14)
%16 = load i32, i32* @GL_COLOR_BUFFER_BIT
%17 = call i32 @glClear(i32 %16)
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @draw_clear(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 3
%8 = load float, float* %7
%9 = tail call i32 @glClearColor(float %2, float %4, float %6, float %8)
%10 = load i32, i32* @GL_COLOR_BUFFER_BIT
%11 = tail call i32 @glClear(i32 %10)
ret void
}
unsigned int DRV_GET_U2DIAG_DEFVALUE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_U2DIAG_DEFVALUE() {
ret i32 0
}
void double_to_si(double x, int *p) { p[3] = x; }


x86 assembly (clang, -O0):
<double_to_si>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_si>:
cvttsd2si %xmm0,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @double_to_si(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
%5 = load double, double* %3
%6 = fptosi double %5 to i32
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 3
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @double_to_si(double %0, i32* nocapture writeonly %1) {
%3 = fptosi double %0 to i32
%4 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
void *OME_allocate(size_t, int /*<<< orphan*/, int /*<<< orphan*/);
void *OME_allocate_data(size_t size) { return OME_allocate(size, 0, 0); }


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

x86 assembly (clang, -O2):
<OME_allocate_data>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <OME_allocate@plt>

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

LLVM IR (-O2):
define i8* @OME_allocate_data(i64 %0) {
%2 = tail call i8* @OME_allocate(i64 %0, i32 0, i32 0)
ret i8* %2
}
void rotate_bit_left(unsigned char *str) {
  int count;
  for (count = 0; str[count]; count++) {
    str[count] = (((str[count]) << (1)) | ((str[count]) >> (8 - (1))));
  }
  return;
}


x86 assembly (clang, -O0):
<rotate_bit_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115c <rotate_bit_left+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <rotate_bit_left+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_bit_left>:
mov    (%rdi),%al
test   %al,%al
je     1120 <rotate_bit_left+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
rol    %al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <rotate_bit_left+0x10>
ret

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

LLVM IR (-O2):
define void @rotate_bit_left(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call i8 @llvm.fshl.i8(i8 %6, i8 %6, i8 1)
store i8 %8, i8* %7
%9 = add nuw nsw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
AR0IR1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0IR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1146 <AR0IR1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <AR0IR1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0IR1>:
movsd  (%rcx),%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

LLVM IR (-O0):
define i32 @AR0IR1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = getelementptr inbounds double, double* %14, i64 10000000
%16 = load double, double* %15
%17 = load double*, double** %13
%18 = load double, double* %17
%19 = fcmp ole double %16, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @AR0IR1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = load double, double* %5
%10 = fcmp ole double %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int GetBytesForAdpcmSamples(int samples) {
  int extraBytes = 0;
  int packets = samples / 14;
  int extraSamples = samples % 14;
  if (extraSamples != 0) {
    extraBytes = (extraSamples / 2) + (extraSamples % 2) + 1;
  }
  return 8 * packets + extraBytes;
}


x86 assembly (clang, -O0):
<GetBytesForAdpcmSamples>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1158 <GetBytesForAdpcmSamples+0x58>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBytesForAdpcmSamples>:
movslq %edi,%rdx
imul   $0xffffffff92492493,%rdx,%rax
shr    $0x20,%rax
add    %edx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
mov    %eax,%esi
shl    $0x4,%esi
mov    %eax,%ecx
sub    %esi,%ecx
add    %eax,%ecx
add    %edx,%ecx
je     114a <GetBytesForAdpcmSamples+0x4a>
mov    %ecx,%esi
shr    $0x7,%sil
add    %cl,%sil
mov    %esi,%edx
and    $0xfe,%dl
sub    %dl,%cl
sar    %sil
add    %cl,%sil
movsbl %sil,%ecx
add    $0x1,%ecx
lea    (%rcx,%rax,8),%eax
ret
xor    %ecx,%ecx
lea    (%rcx,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @GetBytesForAdpcmSamples(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 14
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 14
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 2
%15 = load i32, i32* %5
%16 = srem i32 %15, 2
%17 = add nsw i32 %14, %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %1
%20 = load i32, i32* %4
%21 = mul nsw i32 8, %20
%22 = load i32, i32* %3
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @GetBytesForAdpcmSamples(i32 %0) {
%2 = srem i32 %0, 14
%3 = sdiv i32 %0, 14
%4 = icmp eq i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = trunc i32 %2 to i8
%7 = sdiv i8 %6, 2
%8 = srem i8 %6, 2
%9 = add nsw i8 %7, %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %5, %1
%13 = phi i32 [ %11, %5 ], [ 0, %1 ]
%14 = shl nsw i32 %3, 3
%15 = add nsw i32 %13, %14
ret i32 %15
}
double SSL_DegreeToRadians(int angle) { return (angle * 3.14159265359) / 180; }


x86 assembly (clang, -O0):
<SSL_DegreeToRadians>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_DegreeToRadians>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SSL_DegreeToRadians(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x400921FB54442EEA
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
define double @SSL_DegreeToRadians(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x400921FB54442EEA
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rand();
uint8_t randint(uint8_t min, uint8_t max) { return (rand() % max) + min; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SameDegreeFactorization();
int /*<<< orphan*/ initFactorModularPoly(int);
void PerformSameDegreeFactorization(int prime) {
  initFactorModularPoly(prime);
  SameDegreeFactorization();
}


x86 assembly (clang, -O0):
<PerformSameDegreeFactorization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <initFactorModularPoly@plt>
mov    $0x0,%al
call   1030 <SameDegreeFactorization@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PerformSameDegreeFactorization>:
push   %rax
call   1040 <initFactorModularPoly@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SameDegreeFactorization@plt>

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

LLVM IR (-O2):
define void @PerformSameDegreeFactorization(i32 %0) {
%2 = tail call i32 @initFactorModularPoly(i32 %0)
%3 = tail call i32 (...) @SameDegreeFactorization()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MJCStatic_init();
int /*<<< orphan*/ Main_main();
int /*<<< orphan*/ initialize_heap(int);
int main() {
  initialize_heap(4000);
  MJCStatic_init();
  Main_main();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfa0,%edi
call   1050 <initialize_heap@plt>
xor    %eax,%eax
call   1030 <MJCStatic_init@plt>
xor    %eax,%eax
call   1040 <Main_main@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @initialize_heap(i32 4000)
%2 = tail call i32 (...) @MJCStatic_init()
%3 = tail call i32 (...) @Main_main()
ret i32 0
}