xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_mult_lazy(scalar_t__);
void loop_mult_lazy_linear(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_mult_lazy(range + i);
  }
}


x86 assembly (clang, -O0):
<loop_mult_lazy_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116d <loop_mult_lazy_linear+0x5d>
mov    -0x10(%rbp),%rdi
add    -0x20(%rbp),%rdi
call   1030 <ranged_random_mult_lazy@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <loop_mult_lazy_linear+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_mult_lazy_linear>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <loop_mult_lazy_linear+0x38>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rdi
call   1030 <ranged_random_mult_lazy@plt>
cltq
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <loop_mult_lazy_linear+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @loop_mult_lazy_linear(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
store i64 0, i64* %7
br label %8
8: ; preds = %20, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i64, i64* %5
%14 = load i64, i64* %7
%15 = add i64 %13, %14
%16 = call i32 @ranged_random_mult_lazy(i64 %15)
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %6
%19 = getelementptr inbounds i64, i64* %18, i32 1
store i64* %19, i64** %6
store i64 %17, i64* %18
br label %20
20: ; preds = %12
%21 = load i64, i64* %7
%22 = add i64 %21, 1
store i64 %22, i64* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @loop_mult_lazy_linear(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %13, %6 ], [ 0, %3 ]
%8 = phi i64* [ %12, %6 ], [ %2, %3 ]
%9 = add i64 %7, %1
%10 = tail call i32 @ranged_random_mult_lazy(i64 %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %8, i64 1
store i64 %11, i64* %8
%13 = add nuw i64 %7, 1
%14 = icmp eq i64 %13, %0
br i1 %14, label %5, label %6
}
void glGetSamplerParameteriv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetSamplerParameteriv() {
ret void
}
int iscntrl(int c) { return (c == 127 || (c >= 0 && c <= 31)); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x7f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1135 <iscntrl+0x35>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     112f <iscntrl+0x2f>
cmpl   $0x1f,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x7f,%edi
sete   %al
cmp    $0x20,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 127
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 31
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br label %13
13: ; preds = %11, %1
%14 = phi i1 [ true, %1 ], [ %12, %11 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp eq i32 %0, 127
%3 = icmp ult i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
double mhjd2mjd(mhjd, ra, dec, sys)
double mhjd;
double ra;
double dec;
int sys;
{
  double lt;
  double hjd;
  hjd = mjd2jd(mhjd);
  lt = suntl(hjd, ra, dec, sys);
  return (jd2mjd(hjd - lt));
}


x86 assembly (clang, -O0):
<mhjd2mjd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <mjd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x1c(%rbp),%edi
mov    $0x3,%al
call   1050 <suntl@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2mjd@plt>
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhjd2mjd>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    $0x1,%al
call   1040 <mjd2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    %ebx,%edi
mov    $0x3,%al
call   1050 <suntl@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <jd2mjd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @mhjd2mjd(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%11 = load double, double* %5
%12 = call i32 (double, ...) bitcast (i32 (...)* @mjd2jd to i32 (double, ...)*)(double %11)
%13 = sitofp i32 %12 to double
store double %13, double* %10
%14 = load double, double* %10
%15 = load double, double* %6
%16 = load double, double* %7
%17 = load i32, i32* %8
%18 = call i32 (double, double, double, i32, ...) bitcast (i32 (...)* @suntl to i32 (double, double, double, i32, ...)*)(double %14, double %15, double %16, i32 %17)
%19 = sitofp i32 %18 to double
store double %19, double* %9
%20 = load double, double* %10
%21 = load double, double* %9
%22 = fsub double %20, %21
%23 = call i32 (double, ...) bitcast (i32 (...)* @jd2mjd to i32 (double, ...)*)(double %22)
%24 = sitofp i32 %23 to double
ret double %24
}

LLVM IR (-O2):
define double @mhjd2mjd(double %0, double %1, double %2, i32 %3) {
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @mjd2jd to i32 (double, ...)*)(double %0)
%6 = sitofp i32 %5 to double
%7 = tail call i32 (double, double, double, i32, ...) bitcast (i32 (...)* @suntl to i32 (double, double, double, i32, ...)*)(double %6, double %1, double %2, i32 %3)
%8 = sitofp i32 %7 to double
%9 = fsub double %6, %8
%10 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2mjd to i32 (double, ...)*)(double %9)
%11 = sitofp i32 %10 to double
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ lrand48();
int /*<<< orphan*/ srand48(int);
void fill_random(int64_t *dst, const int size) {
  int i;
  srand48(123);
  for (i = 0; i < size; i++) {
    dst[i] = lrand48();
  }
}


x86 assembly (clang, -O0):
<fill_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x7b,%edi
call   1040 <srand48@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <fill_random+0x4e>
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <fill_random+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_random>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x7b,%edi
call   1040 <srand48@plt>
test   %ebp,%ebp
jle    1154 <fill_random+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lrand48@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <fill_random+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_random(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @srand48(i32 123)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call i32 (...) @lrand48()
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_ABRT(void) {
  kill(getpid(), SIGABRT);
  return 0;
}


x86 assembly (clang, -O0):
<gen_ABRT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ABRT>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void elf_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<elf_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @elf_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ signal(int, void (*)(int));
void signal_sub(int *number, void (*handler)(int), int *status) {
  intptr_t ret;
  if (status != NULL) {
    ret = (intptr_t)signal(*number, handler);
    *status = (int)ret;
  } else
    signal(*number, handler);
}


x86 assembly (clang, -O0):
<signal_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <signal_sub+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <signal@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1162 <signal_sub+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <signal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_sub>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <signal@plt>
test   %rbx,%rbx
je     1122 <signal_sub+0x12>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @signal_sub(i32* nocapture %0, void (i32)* %1, i32* writeonly %2) {
%4 = icmp eq i32* %2, null
%5 = load i32, i32* %0
%6 = tail call i64 @signal(i32 %5, void (i32)* %1)
br i1 %4, label %9, label %7
7: ; preds = %3
%8 = trunc i64 %6 to i32
store i32 %8, i32* %2
br label %9
9: ; preds = %3, %7
ret void
}
int compare_ints(const void *a, const void *b) {
  int temp = *((int *)a) - *((int *)b);
  if (temp > 0)
    return 1;
  else if (temp < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1131 <compare_ints+0x31>
movl   $0x1,-0x4(%rbp)
jmp    114e <compare_ints+0x4e>
cmpl   $0x0,-0x1c(%rbp)
jge    1147 <compare_ints+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <compare_ints+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    %eax,%ecx
sar    $0x1f,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = ashr i32 %7, 31
%9 = icmp slt i32 %7, 1
%10 = select i1 %9, i32 %8, i32 1
ret i32 %10
}
void add(int *a) { (*a)++; }


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

x86 assembly (clang, -O2):
<add>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @add(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
void message_print(struct message_class *message) {

  ;
  ;
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
%struct.message_class = type opaque
define void @message_print(%struct.message_class* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char *get_dec_inv(char const *, char *);
unsigned char *get_hex_inv(char const *, char *);
unsigned char *inv_gds(const char *inventory) {
  unsigned char *inv;
  inv = get_hex_inv(inventory, "GDS=");
  if (inv != NULL)
    return inv;
  return get_dec_inv(inventory, "GDS10=");
}


x86 assembly (clang, -O0):
<inv_gds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <get_hex_inv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <inv_gds+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <inv_gds+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <get_dec_inv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_gds>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <get_hex_inv@plt>
test   %rax,%rax
je     1137 <inv_gds+0x17>
pop    %rbx
ret
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_dec_inv@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"GDS=\00"
@.str.1 = [7 x i8] c"GDS10=\00"
define i8* @inv_gds(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @get_hex_inv(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i8* @get_dec_inv(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"GDS=\00"
@.str.1 = [7 x i8] c"GDS10=\00"
define i8* @inv_gds(i8* %0) {
%2 = tail call i8* @get_hex_inv(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @get_dec_inv(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
long fgetlong(FILE *file) {
  unsigned char b[4];
  fread(b, 1, 4, file);
  return ((unsigned long)b[3] << 24) | ((unsigned long)b[2] << 16) |
         ((unsigned long)b[1] << 8) | b[0];
}


x86 assembly (clang, -O0):
<fgetlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
movzbl -0x9(%rbp),%eax
shl    $0x18,%rax
movzbl -0xa(%rbp),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
movzbl -0xb(%rbp),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
movzbl -0xc(%rbp),%ecx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @fgetlong(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl i64 %9, 24
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = shl i64 %13, 16
%15 = or i64 %10, %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = shl i64 %18, 8
%20 = or i64 %15, %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = or i64 %20, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @fgetlong(i32* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 4, i32* %0)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 24
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %12, %8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 8
%18 = or i64 %13, %17
%19 = load i8, i8* %3
%20 = zext i8 %19 to i64
%21 = or i64 %18, %20
ret i64 %21
}
/* Variables and functions */
void exit(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @exit() {
br label %1
1: ; preds = %0, %1
br label %1
}
signed long long signedlonglong_ignoring_unsignedlongint(signed long long x,
                                                         unsigned long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglong_ignoring_unsignedlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_unsignedlongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_unsignedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
void xdrmem_destroy(XDR *xdrs) { (void)xdrs; }


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

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

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

LLVM IR (-O2):
define void @xdrmem_destroy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bishops(int, int);
int /*<<< orphan*/ test_isDiagonal();
int main(int argc, char **argv) {
  test_isDiagonal();
  return 0;
  bishops(2, 2);
  bishops(3, 3);
  bishops(3, 4);
  bishops(4, 4);
  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)
mov    $0x0,%al
call   1030 <test_isDiagonal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_isDiagonal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @test_isDiagonal()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_isDiagonal()
ret i32 0
}
int test_imm_4Aint16_mem(short *val) {
  return ((*val) & (0x4A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 74
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ S_IFCHR;
int /*<<< orphan*/ errno;
int __attribute__((weak)) _fstat(int fd, struct stat *ptr) {
  switch (fd) {
  case 0:
  case 1:
  case 2:
    ptr->st_mode = S_IFCHR;
    return 0;
  }
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
ja     1137 <_fstat+0x37>
jmp    111c <_fstat+0x1c>
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1150 <_fstat+0x50>
mov    0x2e92(%rip),%rax
mov    (%rax),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
cmp    $0x2,%edi
ja     1113 <_fstat+0x13>
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    0x2eb5(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i32, i32* %4
switch i32 %6, label %11 [
i32 0, label %7
i32 1, label %7
i32 2, label %7
]
7: ; preds = %2, %2, %2
%8 = load i32, i32* @S_IFCHR
%9 = load %struct.stat*, %struct.stat** %5
%10 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
store i32 %8, i32* %10
store i32 0, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* @EBADF
store i32 %12, i32* @errno
store i32 -1, i32* %3
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = icmp ult i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @S_IFCHR
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %5, i32* %6
br label %9
7: ; preds = %2
%8 = load i32, i32* @EBADF
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ -1, %7 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int INHGtoMB(double);
double INHGtoKPA(double INHG) {
  double KPA = INHGtoMB(INHG) / 10;
  return KPA;
}


x86 assembly (clang, -O0):
<INHGtoKPA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <INHGtoMB@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INHGtoKPA>:
push   %rax
call   1030 <INHGtoMB@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @INHGtoKPA(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @INHGtoMB(double %4)
%6 = sdiv i32 %5, 10
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @INHGtoKPA(double %0) {
%2 = tail call i32 @INHGtoMB(double %0)
%3 = sdiv i32 %2, 10
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isRemaniderZero(int num) {
  if (num % 9 == 0 || num % 11 == 0 || num % 13 == 0) {
    printf("1");
  } else {
    printf("0");
  }
}


x86 assembly (clang, -O0):
<isRemaniderZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1157 <isRemaniderZero+0x47>
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1157 <isRemaniderZero+0x47>
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1168 <isRemaniderZero+0x58>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <isRemaniderZero+0x64>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRemaniderZero>:
imul   $0x38e38e39,%edi,%eax
add    $0xe38e38e,%eax
cmp    $0x1c71c71d,%eax
setb   %al
imul   $0xba2e8ba3,%edi,%ecx
add    $0xba2e8ba,%ecx
cmp    $0x1745d175,%ecx
setb   %cl
or     %al,%cl
imul   $0xc4ec4ec5,%edi,%eax
add    $0x9d89d89,%eax
cmp    $0x13b13b13,%eax
setb   %al
or     %cl,%al
movzbl %al,%edi
or     $0x30,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @isRemaniderZero(i32 %0) {
%2 = srem i32 %0, 9
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 11
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = srem i32 %0, 13
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = select i1 %9, i32 49, i32 48
%11 = tail call i32 @putchar(i32 %10)
ret void
}
void rop3_180_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_180_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_180_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_180_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
int hash(char *s) {
  int i, total = 0;
  for (i = 0; s[i] != '\0'; i++)
    total += s[i];
  return total % 4000;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <hash+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash+0x16>
mov    -0x10(%rbp),%eax
mov    $0xfa0,%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   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x28,%rcx
add    %edx,%ecx
imul   $0xfa0,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %22, %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, 0
br i1 %12, label %13, label %25
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 = sext i8 %18 to i32
%20 = load i32, i32* %4
%21 = add nsw i32 %20, %19
store i32 %21, i32* %4
br label %22
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %5
25: ; preds = %5
%26 = load i32, i32* %4
%27 = srem i32 %26, 4000
ret i32 %27
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %9, 4000
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
bool AONBatMonNewTempMeasureReady(void) {
  bool bStatus;
  bStatus =
      (*((volatile unsigned long *)(0x40095000 + 0x00000034))) & 0x00000001
          ? true
          : false;
  if (bStatus) {
    (*((volatile unsigned long *)(0x40095000 + 0x00000034))) = 1;
  }
  return (bStatus);
}


x86 assembly (clang, -O0):
<AONBatMonNewTempMeasureReady>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40095034,%eax
mov    (%rax),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <AONBatMonNewTempMeasureReady+0x37>
mov    $0x40095034,%eax
movq   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONBatMonNewTempMeasureReady>:
mov    0x40095034,%rax
40
test   $0x1,%al
je     1118 <AONBatMonNewTempMeasureReady+0x18>
movq   $0x1,0x40095034
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @AONBatMonNewTempMeasureReady() {
%1 = load volatile i64, i64* inttoptr (i64 1074352180 to i64*)
%2 = and i64 %1, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store volatile i64 1, i64* inttoptr (i64 1074352180 to i64*)
br label %5
5: ; preds = %4, %0
%6 = xor i1 %3, true
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printUsage() {
  fprintf(
      stderr,
      "usage: crashreporter-servicehelper journalspy/endurance start/stop\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"usage: crashreporter-servicehelper journalspy/endurance start/stop\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"usage: crashreporter-servicehelper journalspy/endurance start/stop\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}
int DRV_CODEC_IOCTL(int devid, int cmd, int arg) { return 0; }


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

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

LLVM IR (-O0):
define i32 @DRV_CODEC_IOCTL(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
ret i32 0
}

LLVM IR (-O2):
define i32 @DRV_CODEC_IOCTL(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void print_current_time(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  printf("time: %lu %lu\n", (unsigned long)tv.tv_sec,
         (unsigned long)tv.tv_usec);
}


x86 assembly (clang, -O0):
<print_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_current_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [15 x i8] c"time: %lu %lu\0A\00"
define void @print_current_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [15 x i8] c"time: %lu %lu\0A\00"
define void @print_current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tosLog_error(char *, char *, char *);
int tosInt32_mod(int x, int y) {
  if (y == 0)
    tosLog_error("tosInt32", "mod", "Remainder by zero");
  return x % y;
}


x86 assembly (clang, -O0):
<tosInt32_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1142 <tosInt32_mod+0x32>
lea    0xed1(%rip),%rdi
lea    0xed3(%rip),%rsi
lea    0xed0(%rip),%rdx
call   1030 <tosLog_error@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosInt32_mod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %esi,%esi
jne    1135 <tosInt32_mod+0x25>
lea    0xede(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1030 <tosLog_error@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"tosInt32\00"
@.str.1 = [4 x i8] c"mod\00"
@.str.2 = [18 x i8] c"Remainder by zero\00"
define i32 @tosInt32_mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @tosLog_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"tosInt32\00"
@.str.1 = [4 x i8] c"mod\00"
@.str.2 = [18 x i8] c"Remainder by zero\00"
define i32 @tosInt32_mod(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @tosLog_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = srem i32 %0, %1
ret i32 %7
}
int incr(int i) { return i + 1; }


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

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

LLVM IR (-O0):
define i32 @incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ radcon(char *, int, int);
int main(void) {
  char str[20];
  radcon(str, 123, 16);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x7b,%esi
mov    $0x10,%edx
call   1040 <radcon@plt>
lea    -0x20(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7b,%esi
mov    $0x10,%edx
call   1040 <radcon@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @radcon(i8* %2, i32 123, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
void *mapints(void *data) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @mapints(i8* nocapture readnone %0) {
ret i8* null
}
int Calc_DivRoundUp(int input, int divider) {
  return (input + divider - 1) / divider;
}


x86 assembly (clang, -O0):
<Calc_DivRoundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_DivRoundUp>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @Calc_DivRoundUp(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
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @Calc_DivRoundUp(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LOG_LOCAL5;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void init_log(const char *identify_name) {
  openlog(identify_name, LOG_PID, LOG_LOCAL5);
}


x86 assembly (clang, -O0):
<init_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_log>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_LOCAL5 = global i32 0
define void @init_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_LOCAL5
%6 = call i32 @openlog(i8* %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_LOCAL5 = global i32 0
define void @init_log(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_LOCAL5
%4 = tail call i32 @openlog(i8* %0, i32 %2, i32 %3)
ret void
}