xunge/DecIR huggingface dataset:
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  int nl;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%.d\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <main+0x40>
cmpl   $0xa,-0x8(%rbp)
jne    115b <main+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <main+0xf>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%.d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp ne i32 %1, %2
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ undef, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int foo(int);
int obj6func2(int a) { return foo(a) + 46; }


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

x86 assembly (clang, -O2):
<obj6func2>:
push   %rax
call   1030 <foo@plt>
add    $0x2e,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obj6func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = add nsw i32 %4, 46
ret i32 %5
}

LLVM IR (-O2):
define i32 @obj6func2(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %2, 46
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t mmio_reg_read(uintptr_t ptr) { return *((volatile uint32_t *)ptr); }


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

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

LLVM IR (-O0):
define i32 @mmio_reg_read(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @mmio_reg_read(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_pair(int fd[2]) {
  close(fd[0]);
  close(fd[1]);
}


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

x86 assembly (clang, -O2):
<close_pair>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @close_pair(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
define void @close_pair(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("yc with libyrmcds "
         "1.3.0"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"yc with libyrmcds 1.3.0\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"yc with libyrmcds 1.3.0\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int startswith(const char *string, const char *pattern) {
  return strncmp(string, pattern, strlen(pattern)) == 0;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startswith(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float cosf(float);
float sinf(float);
void PolarToRect(float mag, float phase, float *outReal, float *outImag) {
  *outReal = mag * cosf(phase);
  *outImag = mag * sinf(phase);
}


x86 assembly (clang, -O0):
<PolarToRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolarToRect>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1040 <cosf@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
call   1030 <sinf@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PolarToRect(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = call float @cosf(float %10)
%12 = fmul float %9, %11
%13 = load float*, float** %7
store float %12, float* %13
%14 = load float, float* %5
%15 = load float, float* %6
%16 = call float @sinf(float %15)
%17 = fmul float %14, %16
%18 = load float*, float** %8
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @PolarToRect(float %0, float %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = tail call float @cosf(float %1)
%6 = fmul float %5, %0
store float %6, float* %2
%7 = tail call float @sinf(float %1)
%8 = fmul float %7, %0
store float %8, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cunlink(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
dexit() {
  int i;
  cunlink("ratjunk");
  cunlink("f.tmp1");
  exit(0);
}


x86 assembly (clang, -O0):
<dexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <cunlink@plt>
lea    0xecd(%rip),%rdi
call   1030 <cunlink@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dexit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <cunlink@plt>
lea    0xed4(%rip),%rdi
call   1030 <cunlink@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ratjunk\00"
@.str.1 = [7 x i8] c"f.tmp1\00"
define i32 @dexit() {
%1 = alloca i32
%2 = call i32 @cunlink(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @cunlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"ratjunk\00"
@.str.1 = [7 x i8] c"f.tmp1\00"
define i32 @dexit() {
%1 = tail call i32 @cunlink(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cunlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
double getReynolds(const double *prim, double w, const double *x, double dx) {
  return 0;
}


x86 assembly (clang, -O0):
<getReynolds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getReynolds>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @getReynolds(double* %0, double %1, double* %2, double %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double*
%8 = alloca double
store double* %0, double** %5
store double %1, double* %6
store double* %2, double** %7
store double %3, double* %8
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @getReynolds(double* nocapture readnone %0, double %1, double* nocapture readnone %2, double %3) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x37() {
  Assert_real((isalnum(55)),
              "/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",
              280, ("isalnum should be 1 for 7"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x118,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x37>:
push   %rax
mov    $0x37,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x118,%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 1 for 7\00"
define void @t_isalnum_0x37() {
%1 = call i32 @isalnum(i32 55)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, 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 1 for 7\00"
define void @t_isalnum_0x37() {
%1 = tail call i32 @isalnum(i32 55)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint64_t fetch64(const char *p) {
  uint64_t result;
  memcpy(&result, p, sizeof(result));
  return (result);
}


x86 assembly (clang, -O0):
<fetch64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fetch64(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
__attribute__((always_)) size_t max_size_t(size_t a, size_t b) {
  return a > b ? a : b;
}


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

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

LLVM IR (-O0):
define i64 @max_size_t(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 ugt 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 @max_size_t(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
unsigned xrop3_147_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_147_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_147_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_147_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %5
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_147_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int dlna_get_video_profile_mpeg1(char *vcodec, char *acodec, char *profile,
                                 char *mimeType) {
  strcpy(mimeType, "video/mpeg");
  strcpy(profile, "MPEG1");
  return 0;
}


x86 assembly (clang, -O0):
<dlna_get_video_profile_mpeg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlna_get_video_profile_mpeg1>:
push   %rbx
mov    %rdx,%rbx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"video/mpeg\00"
@.str.1 = [6 x i8] c"MPEG1\00"
define i32 @dlna_get_video_profile_mpeg1(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"video/mpeg\00"
@.str.1 = [6 x i8] c"MPEG1\00"
define i32 @dlna_get_video_profile_mpeg1(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
kr_func1(a, b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @kr_func1(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @kr_func1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void X509_REVOKED_get_ext_count(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ hfuzz_trace_cmp2_internal(uintptr_t, int /*<<< orphan*/,
                                             int /*<<< orphan*/);
void hfuzz_trace_cmp2(uintptr_t pc, uint16_t Arg1, uint16_t Arg2) {
  hfuzz_trace_cmp2_internal(pc, Arg1, Arg2);
}


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

x86 assembly (clang, -O2):
<hfuzz_trace_cmp2>:
jmp    1030 <hfuzz_trace_cmp2_internal@plt>

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

LLVM IR (-O2):
define void @hfuzz_trace_cmp2(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hfuzz_trace_cmp2_internal(i64 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ mkdir(char *, int);
int prepare_temp_dir(char *dir_name) {
  if (mkdir(dir_name, 0777) != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<prepare_temp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     1140 <prepare_temp_dir+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <prepare_temp_dir+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_temp_dir>:
push   %rax
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @prepare_temp_dir(i8* nocapture %0) {
%2 = tail call i64 @mkdir(i8* %0, i32 511)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint64_t;

/* Variables and functions */
unsigned long EINVAL;
uint64_t level2mask(int level) {
  uint64_t mask = -EINVAL;
  if (level == 1)
    mask = (((1UL << (12 - 3)) - 1) << (12 + (12 - 3) * 2));
  else if (level == 2)
    mask = (((1UL << (12 - 3)) - 1) << (12 + (12 - 3) * 1));
  else if (level == 3)
    mask = (((1UL << (12 - 3)) - 1) << (12 + (12 - 3) * 0));
  return mask;
}


x86 assembly (clang, -O0):
<level2mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1134 <level2mask+0x34>
movabs $0x7fc0000000,%rax
mov    %rax,-0x10(%rbp)
jmp    1167 <level2mask+0x67>
cmpl   $0x2,-0x4(%rbp)
jne    114b <level2mask+0x4b>
movq   $0x3fe00000,-0x10(%rbp)
3f
jmp    1162 <level2mask+0x62>
cmpl   $0x3,-0x4(%rbp)
jne    115d <level2mask+0x5d>
movq   $0x1ff000,-0x10(%rbp)
jmp    1162 <level2mask+0x62>
jmp    1167 <level2mask+0x67>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<level2mask>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
jae    1117 <level2mask+0x17>
movslq %edi,%rax
lea    0xeee(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
mov    0x2ec2(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
ret

LLVM IR (-O0):
@EINVAL = global i64 0
define i64 @level2mask(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i64, i64* @EINVAL
%5 = sub i64 0, %4
store i64 %5, i64* %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 548682072064, i64* %3
br label %19
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
store i64 1071644672, i64* %3
br label %18
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
store i64 2093056, i64* %3
br label %17
17: ; preds = %16, %13
br label %18
18: ; preds = %17, %12
br label %19
19: ; preds = %18, %8
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
@EINVAL = global i64 0
@switch.table.level2mask = [3 x i64] [i64 548682072064, i64 1071644672, i64 2093056]
define i64 @level2mask(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i64, i64* @EINVAL
%6 = sub i64 0, %5
br label %11
7: ; preds = %1
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* @switch.table.level2mask, i64 0, i64 %8
%10 = load i64, i64* %9
br label %11
11: ; preds = %7, %4
%12 = phi i64 [ %6, %4 ], [ %10, %7 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ bank_simulation();
void main() { bank_simulation(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @bank_simulation()
ret void
}
/* Variables and functions */
char *loggerStrDup(char const *);
char *loggerStrNDup(char const *, int);
char *strrchr(char const *, char);
char *loggerGetFilePathWithoutExt(const char *absPath_) {
  const char *extpos = strrchr(absPath_, '.');
  if (extpos) {
    return loggerStrNDup(absPath_, extpos - absPath_);
  }
  return loggerStrDup(absPath_);
}


x86 assembly (clang, -O0):
<loggerGetFilePathWithoutExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <loggerGetFilePathWithoutExt+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1050 <loggerStrNDup@plt>
mov    %rax,-0x8(%rbp)
jmp    1185 <loggerGetFilePathWithoutExt+0x55>
mov    -0x10(%rbp),%rdi
call   1030 <loggerStrDup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loggerGetFilePathWithoutExt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1150 <loggerGetFilePathWithoutExt+0x20>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <loggerStrNDup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <loggerStrDup@plt>

LLVM IR (-O0):
define i8* @loggerGetFilePathWithoutExt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = call i8* @loggerStrNDup(i8* %10, i32 %16)
store i8* %17, i8** %2
br label %21
18: ; preds = %1
%19 = load i8*, i8** %3
%20 = call i8* @loggerStrDup(i8* %19)
store i8* %20, i8** %2
br label %21
21: ; preds = %18, %9
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @loggerGetFilePathWithoutExt(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @loggerStrNDup(i8* %0, i32 %8)
br label %12
10: ; preds = %1
%11 = tail call i8* @loggerStrDup(i8* %0)
br label %12
12: ; preds = %10, %4
%13 = phi i8* [ %9, %4 ], [ %11, %10 ]
ret i8* %13
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *sem_get_error();
int /*<<< orphan*/ stderr;
int sem_fatal_error(void) {
  fprintf(stderr, "FATAL: %s", sem_get_error());
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<sem_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <sem_get_error@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_fatal_error>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <sem_get_error@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"FATAL: %s\00"
@EXIT_FAILURE = global i32 0
define i32 @sem_fatal_error() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @sem_get_error()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"FATAL: %s\00"
@EXIT_FAILURE = global i32 0
define i32 @sem_fatal_error() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @sem_get_error()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void cbt(int pn) { brc(pn, 'Z'); }


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

x86 assembly (clang, -O2):
<cbt>:
mov    $0x5a,%esi
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define void @cbt(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 90)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int get_byte(FILE *f) {
  int c = fgetc(f);
  return c == EOF ? 0 : c;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    1144 <get_byte+0x34>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <get_byte+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rax
call   1030 <fgetc@plt>
mov    0x2ecb(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @get_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
%5 = select i1 %4, i32 0, i32 %2
ret i32 %5
}
double INtoFT(double IN) { return IN / 12; }


x86 assembly (clang, -O0):
<INtoFT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<INtoFT>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @INtoFT(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.200000e+01
ret double %4
}

LLVM IR (-O2):
define double @INtoFT(double %0) {
%2 = fdiv double %0, 1.200000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ e_brk();
void e_brk_accu() { e_brk(); }


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

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

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

LLVM IR (-O2):
define void @e_brk_accu() {
%1 = tail call i32 (...) @e_brk()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ia_bit8(int /*<<< orphan*/ const, int);
bool ia_bitv(const uint8_t *bytes, int i) {
  return ia_bit8(bytes[i / 8], i % 8);
}


x86 assembly (clang, -O0):
<ia_bitv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <ia_bit8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_bitv>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rdi,%rcx,4),%edi
and    $0xfffffff8,%eax
sub    %eax,%esi
jmp    1030 <ia_bit8@plt>

LLVM IR (-O0):
define i32 @ia_bitv(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = call i32 @ia_bit8(i32 %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ia_bitv(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 8
%8 = tail call i32 @ia_bit8(i32 %6, i32 %7)
ret i32 %8
}
int test_031(int a, int b, int c, int d) { return a + b + ((d >> 31) & 1) + c; }


x86 assembly (clang, -O0):
<test_031>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_031>:
lea    (%rdi,%rsi,1),%eax
shr    $0x1f,%ecx
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_031(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* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %8
%13 = ashr i32 %12, 31
%14 = and i32 %13, 1
%15 = add nsw i32 %11, %14
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_031(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = lshr i32 %3, 31
%7 = add i32 %5, %2
%8 = add i32 %7, %6
ret i32 %8
}
int test_imm_11int8_reg(signed char val) {
  return ((val) & (-0x11 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_11int8_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, -17
%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_11int8_reg(i8 signext %0) {
%2 = and i8 %0, -17
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void fileClose(void *h) {
  FILE *f = (FILE *)h;
  fclose(f);
}


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

x86 assembly (clang, -O2):
<fileClose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @fileClose(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("done\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *memmove(void *, void const *, int);
void *memmove_ABC(const void *A, const void *B, void *C) {
  return memmove(C, A, ((char *)B) - ((char *)A));
}


x86 assembly (clang, -O0):
<memmove_ABC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_ABC>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
sub    %esi,%edx
mov    %rax,%rdi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i8* @memmove_ABC(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
%15 = call i8* @memmove(i8* %7, i8* %8, i32 %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @memmove_ABC(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = tail call i8* @memmove(i8* %2, i8* %0, i32 %7)
ret i8* %8
}
int aml_write_rtc_mem_reg(unsigned char reg_id, unsigned int data) { return 0; }


x86 assembly (clang, -O0):
<aml_write_rtc_mem_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @aml_write_rtc_mem_reg(i8 zeroext %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef size_t uint32_t;

/* Variables and functions */
bool is_constant_fill(const uint8_t *buf, const uint32_t length,
                      const uint8_t fill_byte) {
  const uint8_t *limit = &buf[length];
  while (buf < limit) {
    if (*buf++ != fill_byte) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<is_constant_fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    115e <is_constant_fill+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
je     1159 <is_constant_fill+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_constant_fill+0x65>
jmp    1123 <is_constant_fill+0x23>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_constant_fill>:
lea    (%rdi,%rsi,8),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %rax,%rdi
jae    1124 <is_constant_fill+0x24>
lea    0x8(%rdi),%rcx
cmp    %rdx,(%rdi)
mov    %rcx,%rdi
je     1110 <is_constant_fill+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @g_child_watch_source_new() {
ret void
}
void fakeClDisplayMessage(char *message) {}


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

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

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

LLVM IR (-O2):
define void @fakeClDisplayMessage(i8* nocapture %0) {
ret void
}
void GenInitFinalize(void) {}


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

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

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

LLVM IR (-O2):
define void @GenInitFinalize() {
ret void
}
unsigned hashit(char *str, unsigned tsz) {
  unsigned long hash = 5381;
  int c;
  char *tstr = str;
  while ((c = *tstr++))
    hash = ((hash << 5) + hash) + c;
  return hash % tsz;
}


x86 assembly (clang, -O0):
<hashit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1155 <hashit+0x55>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <hashit+0x1b>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashit>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <hashit+0x2e>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashit+0x10>
jmp    1133 <hashit+0x33>
mov    $0x1505,%eax
mov    %esi,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1147 <hashit+0x47>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashit(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i64 %8, 33
%11 = sext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
%17 = zext i32 %1 to i64
%18 = urem i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}