xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x2e() {
  Assert_real((isalnum(46) == 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_isalnum.c",
              235, ("isalnum should be 0 for ."));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x2e>:
push   %rax
mov    $0x2e,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xeb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for .\00"
define void @t_isalnum_0x2e() {
%1 = call i64 @isalnum(i32 46)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for .\00"
define void @t_isalnum_0x2e() {
%1 = tail call i64 @isalnum(i32 46)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/
test_invalid_proc_loadavg_should_produce_error_and_not_modify_result();
int /*<<< orphan*/ test_valid_proc_loadavg_should_produce_expected_result();
int main() {
  test_valid_proc_loadavg_should_produce_expected_result();
  test_invalid_proc_loadavg_should_produce_error_and_not_modify_result();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_valid_proc_loadavg_should_produce_expected_result@plt>
xor    %eax,%eax
call   1030 <test_invalid_proc_loadavg_should_produce_error_and_not_modify_result@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_valid_proc_loadavg_should_produce_expected_result()
%3 = call i32 (...) @test_invalid_proc_loadavg_should_produce_error_and_not_modify_result()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_valid_proc_loadavg_should_produce_expected_result()
%2 = tail call i32 (...) @test_invalid_proc_loadavg_should_produce_error_and_not_modify_result()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int set_str(void *dst, const char *src) {
  *(const char **)dst = src;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @set_str(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret i32 0
}
unsigned int foo4(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @foo4(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t mm_accel(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mm_accel() {
ret i32 0
}
int main(void) {
  char *ch;
  int cow = 1;
  while (gets(ch) != '\0') {
    printf("%d Input:%s\n", cow, *ch);
    cow++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
cmp    $0x0,%eax
je     1170 <main+0x50>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <gets@plt>
test   %eax,%eax
je     115c <main+0x3c>
mov    $0x1,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <gets@plt>
test   %eax,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d Input:%s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* undef)
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 1, %0 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4, i32 0)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* undef)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 0
}
extern int shmem_addr_accessible(void *addr, int pe) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @shmem_addr_accessible(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
char *listToStr(void *value) {
  (void)(value);
  return (char *)"[placeholder]";
}


x86 assembly (clang, -O0):
<listToStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<listToStr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"[placeholder]\00"
define i8* @listToStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"[placeholder]\00"
define i8* @listToStr(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ left();
void move_left() { left(); }


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

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

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

LLVM IR (-O2):
define void @move_left() {
%1 = tail call i32 (...) @left()
ret void
}
void g_ucs4_to_utf16() {}


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

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

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

LLVM IR (-O2):
define void @g_ucs4_to_utf16() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get16_le(void *p) { return *(uint8_t *)p | *((uint8_t *)p + 1) << 8; }


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

x86 assembly (clang, -O2):
<get16_le>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get16_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get16_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
int Align(int n, int align) {
  return (n % align) == 0 ? n : n + align - (n % align);
}


x86 assembly (clang, -O0):
<Align>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1125 <Align+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <Align+0x3d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Align>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Align(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = sub nsw i32 %14, %17
br label %19
19: ; preds = %11, %9
%20 = phi i32 [ %10, %9 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @Align(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int getpeername(int, struct sockaddr *, int *);
int Xgetpeername(int s, struct sockaddr *a, int *l) {
  int rl;
  int code;
  rl = *l;
  code = getpeername(s, a, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xgetpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <getpeername@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xgetpeername>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdx),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <getpeername@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @Xgetpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load %struct.sockaddr*, %struct.sockaddr** %5
%13 = call i32 @getpeername(i32 %11, %struct.sockaddr* %12, i32* %7)
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @Xgetpeername(i32 %0, %struct.sockaddr* %1, i32* nocapture %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = call i32 @getpeername(i32 %0, %struct.sockaddr* %1, i32* %4)
%8 = load i32, i32* %4
store i32 %8, i32* %2
ret i32 %7
}
void __down_write_trylock(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__down_write_trylock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__down_write_trylock>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__down_write_trylock = [21 x i8] c"__down_write_trylock\00"
define void @__down_write_trylock() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.__down_write_trylock, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__down_write_trylock = [21 x i8] c"__down_write_trylock\00"
define void @__down_write_trylock() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.__down_write_trylock, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a, b;
  scanf("%c", &a);
  b = 'z' - (a - 'a');
  printf("%c\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xeac(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void vent(void) {
  niceprint("A hot steam vent erupts beneath a random party member, who must "
            "succeed on a "
            "DC 12 Dexterity saving throw or take 2d6 fire damage.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [133 x i8] c"A hot steam vent erupts beneath a random party member, who must succeed on a DC 12 Dexterity saving throw or take 2d6 fire damage.\0A\0A\00"
define void @vent() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"A hot steam vent erupts beneath a random party member, who must succeed on a DC 12 Dexterity saving throw or take 2d6 fire damage.\0A\0A\00"
define void @vent() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}
void spoil(int a) {
  if (a) {
  };
}


x86 assembly (clang, -O0):
<spoil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <spoil+0x16>
jmp    1116 <spoil+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spoil(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @spoil(i32 %0) {
ret void
}
int func(int a, int *b) {
  int result = 0;
  int i;
  for (i = 0; i < a; i++) {
    result += (*b)--;
  }
  return result;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <func+0x46>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,(%rcx)
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <func+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
jle    1128 <func+0x28>
mov    (%rsi),%r8d
lea    -0x1(%r8),%eax
lea    -0x1(%rdi),%edx
imul   %edx,%eax
lea    -0x2(%rdi),%ecx
imul   %rdx,%rcx
shr    %rcx
add    %r8d,%eax
mov    %r8d,%edx
sub    %edi,%edx
sub    %ecx,%eax
mov    %edx,(%rsi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = add nsw i32 %0, -1
%8 = mul i32 %6, %7
%9 = zext i32 %7 to i33
%10 = add nsw i32 %0, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = sub i32 %5, %0
%16 = add i32 %5, %8
%17 = sub i32 %16, %14
store i32 %15, i32* %1
br label %18
18: ; preds = %4, %2
%19 = phi i32 [ %17, %4 ], [ 0, %2 ]
ret i32 %19
}
int find_common_substr(const char *str1, const char *str2) {
  int len;
  for (len = 0; str1[len] == str2[len] && str1[len] != '\0'; len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<find_common_substr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rdx
movsbl (%rax,%rdx,1),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jne    114d <find_common_substr+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115d <find_common_substr+0x5d>
jmp    1170 <find_common_substr+0x70>
jmp    1162 <find_common_substr+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <find_common_substr+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_common_substr>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
test   %dl,%dl
je     1124 <find_common_substr+0x24>
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <find_common_substr+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @find_common_substr(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %12, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %6, %8
%10 = icmp eq i8 %6, 0
%11 = or i1 %10, %9
%12 = add nuw i64 %4, 1
br i1 %11, label %13, label %3
13: ; preds = %3
%14 = trunc i64 %4 to i32
ret i32 %14
}
unsigned int ic_parse_perm_has_write(unsigned int permissions) {
  return 0 != (permissions & 0x02);
}


x86 assembly (clang, -O0):
<ic_parse_perm_has_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_parse_perm_has_write>:
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ic_parse_perm_has_write(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void log_write_syslog(int priority, const char *fmt, va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<log_write_syslog>:
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 <vsyslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_write_syslog>:
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
define void @log_write_syslog(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 @vsyslog(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @log_write_syslog(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @vsyslog(i32 %0, i8* %1, i32 %2)
ret void
}
long decode(long x, long y, long z) {
  long tmp = y - z;
  return (tmp * x) ^ (tmp << 63 >> 63);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x3f,%rcx
sar    $0x3f,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    %rsi,%rax
sub    %rdx,%rax
imul   %rax,%rdi
and    $0x1,%eax
neg    %rax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @decode(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = sub nsw i64 %8, %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = load i64, i64* %4
%13 = mul nsw i64 %11, %12
%14 = load i64, i64* %7
%15 = shl i64 %14, 63
%16 = ashr i64 %15, 63
%17 = xor i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @decode(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %1, %2
%5 = mul nsw i64 %4, %0
%6 = and i64 %4, 1
%7 = sub nsw i64 0, %6
%8 = xor i64 %5, %7
ret i64 %8
}
int hash(name)
register char *name;
{
  register int h = 0;
  while (*name)
    h += *name++;
  return (h % 199);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1139 <hash+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0xc7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movslq %ecx,%rax
imul   $0x5254e78f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc7,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = srem i32 %10, 199
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void _alarm(int sig) {
  puts("Timeout!");
  exit(1);
}


x86 assembly (clang, -O0):
<_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [9 x i8] c"Timeout!\00"
define void @_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"Timeout!\00"
define void @_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void free_int(int _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_int(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fs_univ_purge(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ main_time();
uint8_t fs_purge(uint32_t rootinode, uint8_t sesflags, uint32_t inode) {
  return fs_univ_purge(main_time(), rootinode, sesflags, inode);
}


x86 assembly (clang, -O0):
<fs_purge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <main_time@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <fs_univ_purge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_purge>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <main_time@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fs_univ_purge@plt>

LLVM IR (-O0):
define i32 @fs_purge(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 = call i32 (...) @main_time()
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fs_univ_purge(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fs_purge(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @main_time()
%5 = tail call i32 @fs_univ_purge(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
float random3(void) {
  static unsigned long long seed = 7564231ULL;
  static unsigned long long mult = 62089911ULL;
  static unsigned long long llong_max = 4294967295ULL;
  static float float_max = 4294967295.0f;
  seed *= mult;
  return (float)(seed % llong_max) / float_max;
}


x86 assembly (clang, -O0):
<random3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rcx
mov    0x2f0e(%rip),%rax
imul   %rcx,%rax
mov    %rax,0x2f03(%rip)
mov    0x2efc(%rip),%rax
mov    0x2f05(%rip),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
shr    %rcx
mov    %edx,%eax
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rdx,%xmm1
movss  %xmm1,-0x8(%rbp)
test   %rdx,%rdx
movss  %xmm0,-0x4(%rbp)
js     1169 <random3+0x69>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
divss  0x2ec2(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random3>:
imul   $0x3b36ab7,0x2f15(%rip),%rcx
b7 6a b3 03
movabs $0x8000000080000001,%rdx
mov    %rcx,%rax
mul    %rdx
shr    $0x1f,%rdx
mov    %rdx,%rax
shl    $0x20,%rax
sub    %rax,%rdx
add    %rcx,%rdx
cvtsi2ss %rdx,%xmm0
mov    %rcx,0x2ee8(%rip)
mulss  0xec0(%rip),%xmm0
ret

LLVM IR (-O0):
@random3.seed = internal global i64 7564231
@random3.mult = internal global i64 62089911
@random3.llong_max = internal global i64 4294967295
@random3.float_max = internal global float 0x41F0000000000000
define float @random3() {
%1 = load i64, i64* @random3.mult
%2 = load i64, i64* @random3.seed
%3 = mul i64 %2, %1
store i64 %3, i64* @random3.seed
%4 = load i64, i64* @random3.seed
%5 = load i64, i64* @random3.llong_max
%6 = urem i64 %4, %5
%7 = uitofp i64 %6 to float
%8 = load float, float* @random3.float_max
%9 = fdiv float %7, %8
ret float %9
}

LLVM IR (-O2):
@random3.seed = internal unnamed_addr global i64 7564231
define float @random3() {
%1 = load i64, i64* @random3.seed
%2 = mul i64 %1, 62089911
store i64 %2, i64* @random3.seed
%3 = urem i64 %2, 4294967295
%4 = uitofp i64 %3 to float
%5 = fmul float %4, 0x3DF0000000000000
ret float %5
}
int test_imm_55int8_reg(signed char val) {
  return ((val) & (-0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffab,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_55int8_reg(i8 signext %0) {
%2 = and i8 %0, -85
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void NMI_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @NMI_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int qwertysh_cls(char **args) { printf("\033[2J"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @qwertysh_cls(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @qwertysh_cls(i8** nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
long __ocl_min_long_long(long src1, long src2) {
  return (src1 < src2) ? src1 : src2;
}


x86 assembly (clang, -O0):
<__ocl_min_long_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <__ocl_min_long_long+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__ocl_min_long_long+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_min_long_long>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__ocl_min_long_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @__ocl_min_long_long(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void mb() { asm volatile("mfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @mb() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: eva2lzma <evafile> <lzmafile> [headerfile]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"usage: eva2lzma <evafile> <lzmafile> [headerfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"usage: eva2lzma <evafile> <lzmafile> [headerfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Looper();
int /*<<< orphan*/ OpenOurFiles();
int /*<<< orphan*/ ReadCFG();
int /*<<< orphan*/ ReadDATfile();
int /*<<< orphan*/ fix_dat();
int main() {
  ReadCFG();
  ReadDATfile();
  OpenOurFiles();
  Looper();
  fix_dat();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <ReadCFG@plt>
mov    $0x0,%al
call   1040 <ReadDATfile@plt>
mov    $0x0,%al
call   1050 <OpenOurFiles@plt>
mov    $0x0,%al
call   1070 <Looper@plt>
mov    $0x0,%al
call   1030 <fix_dat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <ReadCFG@plt>
xor    %eax,%eax
call   1040 <ReadDATfile@plt>
xor    %eax,%eax
call   1050 <OpenOurFiles@plt>
xor    %eax,%eax
call   1070 <Looper@plt>
xor    %eax,%eax
call   1030 <fix_dat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ReadCFG()
%3 = call i32 (...) @ReadDATfile()
%4 = call i32 (...) @OpenOurFiles()
%5 = call i32 (...) @Looper()
%6 = call i32 (...) @fix_dat()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ReadCFG()
%2 = tail call i32 (...) @ReadDATfile()
%3 = tail call i32 (...) @OpenOurFiles()
%4 = tail call i32 (...) @Looper()
%5 = tail call i32 (...) @fix_dat()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ yyparse();
main() { exit(yyparse()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
long long smod16(long long x) { return x % 16; }


x86 assembly (clang, -O0):
<smod16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x10,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smod16>:
mov    %rdi,%rax
lea    0xf(%rdi),%rcx
test   %rdi,%rdi
cmovns %rdi,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @smod16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 16
ret i64 %4
}

LLVM IR (-O2):
define i64 @smod16(i64 %0) {
%2 = srem i64 %0, 16
ret i64 %2
}
/* Variables and functions */
double genrand_int32();
double genrand_real1(void) { return genrand_int32() * (1.0 / 4294967295.0); }


x86 assembly (clang, -O0):
<genrand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real1() {
%1 = call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}

LLVM IR (-O2):
define double @genrand_real1() {
%1 = tail call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}
float gb_to_degrees(float radians) {
  return radians * 360.0f / 6.28318530717958647692528676655900576f;
}


x86 assembly (clang, -O0):
<gb_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_to_degrees>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @gb_to_degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 3.600000e+02
%5 = fdiv float %4, 0x401921FB60000000
ret float %5
}

LLVM IR (-O2):
define float @gb_to_degrees(float %0) {
%2 = fmul float %0, 3.600000e+02
%3 = fdiv float %2, 0x401921FB60000000
ret float %3
}
double multiply(double left, double right) { return left * right; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @multiply(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @multiply(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
int security_inode_readlink(struct dentry *dentry) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @security_inode_readlink(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvread_open(char *);
void fgmvread_open_(char *filnam) {
  int i;
  char charbuffer[200];
  i = 0;
  while (*(filnam + i) != ' ') {
    charbuffer[i] = *(filnam + i);
  }
  charbuffer[i] = '\0';
  gmvread_open(charbuffer);
}


x86 assembly (clang, -O0):
<fgmvread_open_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1156 <fgmvread_open_+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0xe0(%rbp,%rax,1)
jmp    1126 <fgmvread_open_+0x16>
movslq -0xc(%rbp),%rax
movb   $0x0,-0xe0(%rbp,%rax,1)
lea    -0xe0(%rbp),%rdi
call   1030 <gmvread_open@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvread_open_>:
sub    $0xc8,%rsp
movb   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <gmvread_open@plt>
add    $0xc8,%rsp
ret

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

LLVM IR (-O2):
define void @fgmvread_open_(i8* nocapture %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 @gmvread_open(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar_print_message(char const *);
void foo_print_message(const char *message) { bar_print_message(message); }


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

x86 assembly (clang, -O2):
<foo_print_message>:
jmp    1030 <bar_print_message@plt>

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

LLVM IR (-O2):
define void @foo_print_message(i8* %0) {
%2 = tail call i32 @bar_print_message(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_reset_palette(int /*<<< orphan*/);
void g2_reset_palette_(float *dev) { g2_reset_palette(dtoi(*dev)); }


x86 assembly (clang, -O0):
<g2_reset_palette_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
call   1030 <g2_reset_palette@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_reset_palette_>:
push   %rax
movss  (%rdi),%xmm0
call   1040 <dtoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <g2_reset_palette@plt>

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

LLVM IR (-O2):
define void @g2_reset_palette_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @dtoi(float %2)
%4 = tail call i32 @g2_reset_palette(i32 %3)
ret void
}