xunge/DecIR huggingface dataset:
void UpnpPresentationRequest(void *upnptoken, struct packetheader *packet) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
%struct.packetheader = type opaque
define void @UpnpPresentationRequest(i8* nocapture %0, %struct.packetheader* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int getpid();
int izm_daemon() {
  int ret = -1;
  switch (fork()) {
  case -1:
    return (ret);
  case 0:
    break;
  default:
    exit(0);
  }
  return (getpid());
}


x86 assembly (clang, -O0):
<izm_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x8(%rbp)
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1169 <izm_daemon+0x39>
jmp    1159 <izm_daemon+0x29>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     1174 <izm_daemon+0x44>
jmp    1179 <izm_daemon+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118a <izm_daemon+0x5a>
jmp    1180 <izm_daemon+0x50>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<izm_daemon>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     1149 <izm_daemon+0x19>
test   %eax,%eax
jne    114b <izm_daemon+0x1b>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getpid@plt>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @izm_daemon() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %2
%3 = call i32 (...) @fork()
switch i32 %3, label %7 [
i32 -1, label %4
i32 0, label %6
]
4: ; preds = %0
%5 = load i32, i32* %2
store i32 %5, i32* %1
br label %11
6: ; preds = %0
br label %9
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %6
%10 = call i32 (...) @getpid()
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @izm_daemon() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %2 [
i32 -1, label %6
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @exit(i32 0)
unreachable
4: ; preds = %0
%5 = tail call i32 (...) @getpid()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ %1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x4a() {
  Assert_real((isbdigit(74) == 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_isbdigit.c",
              375, ("isbdigit should be 0 for J"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x4a>:
push   %rax
mov    $0x4a,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x177,%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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for J\00"
define void @t_isbdigit_0x4a() {
%1 = call i64 @isbdigit(i32 74)
%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 375, i8* getelementptr inbounds ([27 x i8], [27 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for J\00"
define void @t_isbdigit_0x4a() {
%1 = tail call i64 @isbdigit(i32 74)
%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 375, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void powerOff() {}


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

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

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

LLVM IR (-O2):
define void @powerOff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
void getsSample1() {
  char str[100];
  gets(str);
  puts(str);
}


x86 assembly (clang, -O0):
<getsSample1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsSample1>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @getsSample1() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @getsSample1() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inb(int);
int /*<<< orphan*/ outb(int const, int);
int /*<<< orphan*/ wait_ec(int, int, int);
uint8_t read_ec(const uint32_t port) {
  uint8_t value;
  wait_ec(0x66, 1, 0);
  outb(0x80, 0x66);
  wait_ec(0x66, 1, 0);
  outb(port, 0x62);
  wait_ec(0x66, 0, 1);
  value = inb(0x62);
  return value;
}


x86 assembly (clang, -O0):
<read_ec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    $0x80,%edi
mov    $0x66,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    -0x4(%rbp),%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <wait_ec@plt>
mov    $0x62,%edi
call   1050 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ec>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    $0x80,%edi
mov    $0x66,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    %ebx,%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <wait_ec@plt>
mov    $0x62,%edi
pop    %rbx
jmp    1050 <inb@plt>

LLVM IR (-O0):
define i32 @read_ec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait_ec(i32 102, i32 1, i32 0)
%5 = call i32 @outb(i32 128, i32 102)
%6 = call i32 @wait_ec(i32 102, i32 1, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @outb(i32 %7, i32 98)
%9 = call i32 @wait_ec(i32 102, i32 0, i32 1)
%10 = call i32 @inb(i32 98)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @read_ec(i32 %0) {
%2 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
%3 = tail call i32 @outb(i32 128, i32 102)
%4 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
%5 = tail call i32 @outb(i32 %0, i32 98)
%6 = tail call i32 @wait_ec(i32 102, i32 0, i32 1)
%7 = tail call i32 @inb(i32 98)
ret i32 %7
}
/* Variables and functions */
size_t mfrag_svc_write(void *buf, size_t size, size_t n, void *fh) { return 0; }


x86 assembly (clang, -O0):
<mfrag_svc_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mfrag_svc_write(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @mfrag_svc_write(i8* nocapture readnone %0, i64 %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR50_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR50_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR50_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void gtk_toggle_action_get_draw_as_radio() {}


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

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

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

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

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_mul_sd(__m128d a, __m128d b) {
  a[0] *= b[0];
  return a;
}


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

x86 assembly (clang, -O2):
<_mm_mul_sd>:
mov    %rdi,%rax
mov    (%rdi),%ecx
imul   (%rsi),%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32* @_mm_mul_sd(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, %7
store i32 %11, i32* %9
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @_mm_mul_sd(i32* returned %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, %3
store i32 %5, i32* %0
ret i32* %0
}
int is_arg(char ***argv, int c) {
  if ((**argv)[0] == '-') {
    if ((**argv)[1] == c) {
      (*argv)++;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1157 <is_arg+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1152 <is_arg+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115e <is_arg+0x5e>
jmp    1157 <is_arg+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_arg>:
mov    (%rdi),%rcx
mov    (%rcx),%rdx
xor    %eax,%eax
cmpb   $0x2d,(%rdx)
jne    1121 <is_arg+0x21>
movsbl 0x1(%rdx),%edx
cmp    %esi,%edx
jne    1121 <is_arg+0x21>
add    $0x8,%rcx
mov    %rcx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_arg(i8*** nocapture %0, i32 %1) {
%3 = load i8**, i8*** %0
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 45
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = getelementptr inbounds i8*, i8** %3, i64 1
store i8** %13, i8*** %0
br label %14
14: ; preds = %2, %7, %12
%15 = phi i32 [ 1, %12 ], [ 0, %7 ], [ 0, %2 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ MurmurHash3_x64_128(char *, size_t, int,
                                       int /*<<< orphan*/ *);
size_t strlen(char *);
uint64_t hash_key(char *key, size_t len) {
  uint64_t hash[2];
  if (len == -1)
    len = strlen(key);
  MurmurHash3_x64_128(key, len, 718281828, hash);
  return hash[0];
}


x86 assembly (clang, -O0):
<hash_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1148 <hash_key+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rcx
mov    $0x2ad01c64,%edx
call   1040 <MurmurHash3_x64_128@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
cmp    $0xffffffffffffffff,%rsi
jne    1139 <hash_key+0x19>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2ad01c64,%edx
call   1040 <MurmurHash3_x64_128@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_key(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [2 x i32]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %4
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%15 = call i32 @MurmurHash3_x64_128(i8* %12, i64 %13, i32 718281828, i32* %14)
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @hash_key(i8* %0, i64 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = icmp eq i64 %1, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %2
%9 = phi i64 [ %7, %6 ], [ %1, %2 ]
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%11 = call i32 @MurmurHash3_x64_128(i8* %0, i64 %9, i32 718281828, i32* %10)
%12 = load i32, i32* %10
ret i32 %12
}
char uart_getc(void) {
  unsigned char lsr;
  char c;
  do {
    lsr = *((volatile unsigned char *)(0x90000000 + 5));
  } while ((lsr & 0x01) != 0x01);
  c = *((volatile unsigned char *)(0x90000000 + 0));
  return c;
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90000005,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1104 <uart_getc+0x4>
mov    $0x90000000,%eax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
mov    $0x90000000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testb  $0x1,0x5(%rax)
je     1110 <uart_getc+0x10>
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @uart_getc() {
%1 = alloca i8
%2 = alloca i8
br label %3
3: ; preds = %5, %0
%4 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
store i8 %4, i8* %1
br label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 1
br i1 %9, label %3, label %10
10: ; preds = %5
%11 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
store i8 %11, i8* %2
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
ret i8 %6
}
int getFileSizePerSecond(int sampleRate, int bitLength, int numberOfChannels) {
  return sampleRate * (bitLength / 8) * numberOfChannels;
}


x86 assembly (clang, -O0):
<getFileSizePerSecond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSizePerSecond>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
imul   %edx,%edi
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @getFileSizePerSecond(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %8, 8
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getFileSizePerSecond(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 8
%5 = mul nsw i32 %4, %0
%6 = mul nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int f310(int *);
int f311(int *p) { return f310(p); }


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

x86 assembly (clang, -O2):
<f311>:
jmp    1030 <f310@plt>

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

LLVM IR (-O2):
define i32 @f311(i32* %0) {
%2 = tail call i32 @f310(i32* %0)
ret i32 %2
}
unsigned short int f78(unsigned short int x, long int y) {
  return (x << y) + (x >> ((-y) & (8 * sizeof(unsigned short) - 1)));
}


x86 assembly (clang, -O0):
<f78>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f78>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f78(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = add nsw i32 %9, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f78(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = lshr i32 %3, %7
%9 = add nsw i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
void lcd_contrast(int level) {}


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

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

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

LLVM IR (-O2):
define void @lcd_contrast(i32 %0) {
ret void
}
int nfdi_mark(void *l) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @nfdi_mark(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ initArray();
int /*<<< orphan*/ readInteger();
void getIntegerArray(void) {
  initArray();
  readInteger();
}


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

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

LLVM IR (-O0):
define void @getIntegerArray() {
%1 = call i32 (...) @initArray()
%2 = call i32 (...) @readInteger()
ret void
}

LLVM IR (-O2):
define void @getIntegerArray() {
%1 = tail call i32 (...) @initArray()
%2 = tail call i32 (...) @readInteger()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ msg(int, char *, size_t);
void *xmalloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    msg(-3, "Failed to malloc %zi bytes\n", size);
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    -0x8(%rbp),%rdx
mov    $0xfffffffd,%edi
lea    0xe9c(%rip),%rsi
call   1050 <msg@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rsi
mov    $0xfffffffd,%edi
mov    %rbx,%rdx
call   1050 <msg@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to malloc %zi bytes\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @msg(i32 -3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to malloc %zi bytes\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @msg(i32 -3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
void mat_set(float *a, int i, int j, float value, int n) {
  a[i + n * j] = value;
}


x86 assembly (clang, -O0):
<mat_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%edx
imul   -0x10(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_set>:
imul   %ecx,%edx
add    %esi,%edx
movslq %edx,%rax
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @mat_set(float* %0, i32 %1, i32 %2, float %3, i32 %4) {
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca i32
store float* %0, float** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store float %3, float* %9
store i32 %4, i32* %10
%11 = load float, float* %9
%12 = load float*, float** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = mul nsw i32 %14, %15
%17 = add nsw i32 %13, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %12, i64 %18
store float %11, float* %19
ret void
}

LLVM IR (-O2):
define void @mat_set(float* nocapture writeonly %0, i32 %1, i32 %2, float %3, i32 %4) {
%6 = mul nsw i32 %4, %2
%7 = add nsw i32 %6, %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds float, float* %0, i64 %8
store float %3, float* %9
ret void
}
void DebugMemCheckInit(void) {}


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

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

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

LLVM IR (-O2):
define void @DebugMemCheckInit() {
ret void
}
/* Variables and functions */
void *strcpy(void *, void const *);
__attribute__((regparm(0))) void *(_win_strcpy)(void *to, const void *from) {
  return strcpy(to, from);
}


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

x86 assembly (clang, -O2):
<_win_strcpy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @_win_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @_win_strcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int *eratos(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  int *primeArray = eratos(255);
  for (i = 0; i < 256; i++)
    if (primeArray[i])
      printf("%d ", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff,%edi
call   1040 <eratos@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1185 <main+0x65>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1172 <main+0x52>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xff,%edi
call   1040 <eratos@plt>
mov    %rax,%r14
xor    %ebx,%ebx
lea    0xec5(%rip),%r15
jmp    114d <main+0x2d>
nopl   (%rax)
add    $0x1,%rbx
cmp    $0x100,%rbx
je     1160 <main+0x40>
cmpl   $0x0,(%r14,%rbx,4)
je     1140 <main+0x20>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32* @eratos(i32 255)
br label %2
2: ; preds = %0, %10
%3 = phi i64 [ 0, %0 ], [ %11, %10 ]
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = trunc i64 %3 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %2, %7
%11 = add nuw nsw i64 %3, 1
%12 = icmp eq i64 %11, 256
br i1 %12, label %13, label %2
13: ; preds = %10
ret i32 0
}
char *strchr(const char *s, char c) {
  while (*s != c) {
    if (*s == '\0') {
      return ((void *)0);
    }
    s++;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     114f <strchr+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strchr+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1157 <strchr+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strchr+0xe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %sil,%cl
je     1121 <strchr+0x21>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1122 <strchr+0x22>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ %0, %2 ], [ %10, %9 ], [ null, %5 ]
ret i8* %14
}
void genmult() {}


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

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

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

LLVM IR (-O2):
define void @genmult() {
ret void
}
int INHERENT_syscall() { return 1; }


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

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

LLVM IR (-O0):
define i32 @INHERENT_syscall() {
ret i32 1
}

LLVM IR (-O2):
define i32 @INHERENT_syscall() {
ret i32 1
}
void main() {
  int i;
  int *j;
  int k;
  i = 0;
  j = &i;
  k = 10;
  j = &k;
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @prepareInput() {
ret void
}
int _xdg_utf8_validate(const char *source) { return (!(0)); }


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

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

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

LLVM IR (-O2):
define i32 @_xdg_utf8_validate(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int get_feat_wc(int, int);
scalar_t__ is_door(int const);
scalar_t__ is_wall(int const);
int is_wall_or_door(int x, int y) {
  const int feat = get_feat_wc(x, y);
  return is_door(feat) || is_wall(feat);
}


x86 assembly (clang, -O0):
<is_wall_or_door>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <get_feat_wc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <is_door@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
jne    1178 <is_wall_or_door+0x48>
mov    -0xc(%rbp),%edi
call   1030 <is_wall@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wall_or_door>:
push   %rbx
call   1050 <get_feat_wc@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <is_door@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114e <is_wall_or_door+0x1e>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <is_wall@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_wall_or_door(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @get_feat_wc(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i64 @is_door(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i64 @is_wall(i32 %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %12, %2
%17 = phi i1 [ true, %2 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_wall_or_door(i32 %0, i32 %1) {
%3 = tail call i32 @get_feat_wc(i32 %0, i32 %1)
%4 = tail call i64 @is_door(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @is_wall(i32 %3)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 1, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
char *index(char *, char);
int /*<<< orphan*/ printf(char *, char *);
char *strstr(char *, char *);
int main(int argc, char **argv) {
  int i = 0;
  char *dest = "http://www.:google.com:80/";
  i = strstr(dest, "://") - dest + 3;
  char chTmp = ':';
  char *stAfter = index(dest + i, chTmp);
  printf("%s\n", stAfter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <strstr@plt>
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
add    $0x3,%rax
mov    %eax,-0x14(%rbp)
movb   $0x3a,-0x21(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
movsbl -0x21(%rbp),%esi
call   1040 <index@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
mov    $0x3a,%esi
call   1040 <index@plt>
lea    0xee2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"http://www.:google.com:80/\00"
@.str.1 = [4 x i8] c"://\00"
@.str.2 = [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 i32
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %7
%10 = load i8*, i8** %7
%11 = call i8* @strstr(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i8*, i8** %7
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = add nsw i64 %15, 3
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
store i8 58, i8* %8
%18 = load i8*, i8** %7
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %8
%23 = call i8* @index(i8* %21, i8 signext %22)
store i8* %23, i8** %9
%24 = load i8*, i8** %9
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"http://www.:google.com:80/\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @index(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 7), i8 signext 58)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
void genc_ule_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_ule_d() {
ret void
}
void event_rest(decorators, n, m, type) int n, m, type;
int decorators[10];
{ xevent_rest(n, m, 0); }


x86 assembly (clang, -O0):
<event_rest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <xevent_rest@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_rest>:
mov    %esi,%edi
mov    %edx,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <xevent_rest@plt>

LLVM IR (-O0):
define void @event_rest(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @xevent_rest to i32 (i32, i32, i32, ...)*)(i32 %9, i32 %10, i32 0)
ret void
}

LLVM IR (-O2):
define void @event_rest(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @xevent_rest to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int total = 0;
  for (int i = 0; i <= 1000; i += 3) {
    total += i;
  }
  for (int i = 0; i <= 1000; i += 5) {
    total += i;
  }
  printf("%d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3e8,-0x18(%rbp)
jg     1158 <main+0x48>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jg     1183 <main+0x73>
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <main+0x4f>
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 267333)
ret i32 0
}
/* Variables and functions */
int read(int, char *, int);
int tunio_read(int fd, char *buf, int len) { return read(fd, buf, len); }


x86 assembly (clang, -O0):
<tunio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tunio_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @tunio_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @tunio_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ UP3D_GetParameter(int);
float UP3D_GetJumpTime() { return ((float)UP3D_GetParameter(0x2B)) / 1000; }


x86 assembly (clang, -O0):
<UP3D_GetJumpTime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <UP3D_GetParameter@plt>
cvtsi2ss %rax,%xmm0
movss  0xed5(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetJumpTime>:
push   %rax
mov    $0x2b,%edi
call   1030 <UP3D_GetParameter@plt>
cvtsi2ss %rax,%xmm0
divss  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @UP3D_GetJumpTime() {
%1 = call i64 @UP3D_GetParameter(i32 43)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 1.000000e+03
ret float %3
}

LLVM IR (-O2):
define float @UP3D_GetJumpTime() {
%1 = tail call i64 @UP3D_GetParameter(i32 43)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 1.000000e+03
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cgi_show_footer(void) { printf("</body></html>\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"</body></html>\0A\00"
define void @cgi_show_footer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"</body></html>\00"
define void @cgi_show_footer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int calc_broadcast(unsigned int network, unsigned int netmask) {
  return network + (~netmask);
}


x86 assembly (clang, -O0):
<calc_broadcast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @calc_broadcast(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %6, -1
%8 = add i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @calc_broadcast(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
void Reserved_Handler26(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler26() {
br label %1
1: ; preds = %0, %1
br label %1
}
int foo(unsigned int x) {
  if ((x & -1879048192) != -1879048192)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x90000000,%eax
cmp    $0x90000000,%eax
je     1126 <foo+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <foo+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
not    %edi
xor    %eax,%eax
test   $0x90000000,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, -1879048192
%3 = icmp eq i32 %2, -1879048192
%4 = zext i1 %3 to i32
ret i32 %4
}