xunge/DecIR huggingface dataset:
void rop3_68_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = S & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_68_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,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %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_68_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_68_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
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = and i32 %32, %34
%36 = or i32 %29, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_68_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
}
/* Variables and functions */
int console_puts(int, char const *);
int puts(const char *s) { return console_puts((1 << 1), s); }


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

x86 assembly (clang, -O2):
<puts>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <console_puts@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @console_puts(i32 2, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exact_square();
int main() {
  exact_square();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @exact_square()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_kill;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int);
int kill(pid_t pid, int sig) { return syscall(SYS_kill, pid, sig); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_kill = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_kill
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_kill = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_kill
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
double get_scale_factor(const double *x, int dim) { return 1.0; }


x86 assembly (clang, -O0):
<get_scale_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  0xeed(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @get_scale_factor(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @get_scale_factor(double* nocapture readnone %0, i32 %1) {
ret double 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ assert_context_process();
int nondet_int();
int __put_user(int size, void *ptr) {
  int tmp;
  {
    assert_context_process();
    tmp = nondet_int();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<__put_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <assert_context_process@plt>
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__put_user(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 (...) @assert_context_process()
%7 = call i32 (...) @nondet_int()
store i32 %7, i32* %5
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
define i32 @__put_user(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @assert_context_process()
%4 = tail call i32 (...) @nondet_int()
ret i32 %4
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *file_ext(const char *path) {
  if ((path = strrchr(path, '.')) != NULL)
    ++path;
  return path;
}


x86 assembly (clang, -O0):
<file_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1144 <file_ext+0x34>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_ext>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @file_ext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 46)
store i8* %4, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @file_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int __wrap_vfprintf(FILE *stream, const char *format, va_list ap) {
  return dll_vfprintf(stream, format, ap);
}


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

x86 assembly (clang, -O2):
<__wrap_vfprintf>:
jmp    1030 <dll_vfprintf@plt>

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

LLVM IR (-O2):
define i32 @__wrap_vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @dll_vfprintf(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t getbits(uint32_t value, uint8_t position, uint8_t no_bits) {
  return (value >> (position + 1 - no_bits) & ~(~0 << no_bits));
}


x86 assembly (clang, -O0):
<getbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
sub    %edx,%esi
lea    0x1(%rsi),%ecx
sar    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sub i32 %4, %2
%6 = ashr i32 %0, %5
%7 = shl nsw i32 -1, %2
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}
void printQMat(double **qmat_obj, const unsigned n_states) {
  unsigned from_state, to_state;
  ;
  for (from_state = 0; from_state < n_states; ++from_state) {
    for (to_state = 0; to_state < n_states; ++to_state) {
      ;
    };
  }
}


x86 assembly (clang, -O0):
<printQMat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <printQMat+0x57>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1144 <printQMat+0x44>
jmp    1136 <printQMat+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1125 <printQMat+0x25>
jmp    1149 <printQMat+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <printQMat+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printQMat(double** nocapture %0, i32 %1) {
ret void
}
int rakam_sayisi(int x, int rakam) {
  int r = 0;
  while (x > 0) {
    if (x % 10 == rakam)
      r += 1;
    x /= 10;
  }
  return r;
}


x86 assembly (clang, -O0):
<rakam_sayisi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114b <rakam_sayisi+0x4b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jne    1138 <rakam_sayisi+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1111 <rakam_sayisi+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rakam_sayisi>:
xor    %eax,%eax
test   %edi,%edi
jle    1139 <rakam_sayisi+0x39>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%r9d
mov    %edi,%ecx
sub    %r9d,%ecx
xor    %r9d,%r9d
cmp    %esi,%ecx
sete   %r9b
add    %r9d,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <rakam_sayisi+0x10>
ret

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

LLVM IR (-O2):
define i32 @rakam_sayisi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = urem i32 %6, 10
%8 = icmp eq i32 %7, %1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = udiv i32 %6, 10
%12 = icmp ult i32 %6, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
int foo(a, b)
char a;
char b;
{}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%cl
mov    %sil,%al
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_second_greetings(void) {
  printf("Hello from UNPATCHED shared library\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Hello from UNPATCHED shared library\0A\00"
define void @print_second_greetings() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Hello from UNPATCHED shared library\00"
define void @print_second_greetings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
int dlclose(void *handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pure_f();
void pure_f2(void) { pure_f(); }


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

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

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

LLVM IR (-O2):
define void @pure_f2() {
%1 = tail call i32 (...) @pure_f()
ret void
}
void option_parse_value(char *it) {
  while (*it != '\0' && *it != '\n' && *it != ' ' && *it != '\t')
    it++;
  *it = '\0';
}


x86 assembly (clang, -O0):
<option_parse_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <option_parse_value+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1157 <option_parse_value+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <option_parse_value+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <option_parse_value+0x67>
jmp    1178 <option_parse_value+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <option_parse_value+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_parse_value>:
movabs $0x100000601,%rax
jmp    1114 <option_parse_value+0x14>
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1110 <option_parse_value+0x10>
bt     %rcx,%rax
jae    1110 <option_parse_value+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @option_parse_value(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
struct multiply_resource_id_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct multiply_resource_id_pool *);
int multiply_resource_id_pool_destroy(struct multiply_resource_id_pool *id) {
  free(id);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_id_pool_destroy(%struct.multiply_resource_id_pool* %0) {
%2 = alloca %struct.multiply_resource_id_pool*
store %struct.multiply_resource_id_pool* %0, %struct.multiply_resource_id_pool** %2
%3 = load %struct.multiply_resource_id_pool*, %struct.multiply_resource_id_pool** %2
%4 = call i32 @free(%struct.multiply_resource_id_pool* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_id_pool_destroy(%struct.multiply_resource_id_pool* nocapture %0) {
%2 = tail call i32 @free(%struct.multiply_resource_id_pool* %0)
ret i32 0
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_STANDBY;
void cec_msg_standby(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_STANDBY;
}


x86 assembly (clang, -O0):
<cec_msg_standby>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_standby>:
movl   $0x2,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_STANDBY = global i32 0
define void @cec_msg_standby(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_STANDBY
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_STANDBY = global i32 0
define void @cec_msg_standby(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_STANDBY
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
void swd_init(void) {}


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

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

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

LLVM IR (-O2):
define void @swd_init() {
ret void
}
void SensorSetMirrorFlip_FUJITSU(unsigned char val) {}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_FUJITSU>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SensorSetMirrorFlip_FUJITSU(i8 zeroext %0) {
ret void
}
void v4d(vec) double vec[4];
{
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4d>:
sub    $0x18,%rsp
movupd (%rdi),%xmm0
movupd 0x10(%rdi),%xmm1
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm0,%xmm0
unpcklpd %xmm1,%xmm0
movapd %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4d(double* %0) {
%2 = alloca double*
%3 = alloca [4 x float]
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fptrunc double %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 3
%21 = load double, double* %20
%22 = fptrunc double %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4d(double* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast double* %0 to <4 x double>*
%6 = load <4 x double>, <4 x double>* %5
%7 = fptrunc <4 x double> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %4, i32 4)
ret void
}
float scale_pitchbend_to_f(unsigned char data1, unsigned char data2) {
  return 0.000121153f * (float)(data1 * 128 + data2 - 8254);
}


x86 assembly (clang, -O0):
<scale_pitchbend_to_f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x7,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
sub    $0x203e,%eax
cvtsi2ss %eax,%xmm1
movss  0xed2(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_pitchbend_to_f>:
shl    $0x7,%edi
lea    (%rsi,%rdi,1),%eax
add    $0xffffdfc2,%eax
cvtsi2ss %eax,%xmm0
mulss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @scale_pitchbend_to_f(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 128
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = sub nsw i32 %10, 8254
%12 = sitofp i32 %11 to float
%13 = fmul float 0x3F1FC270C0000000, %12
ret float %13
}

LLVM IR (-O2):
define float @scale_pitchbend_to_f(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 7
%5 = zext i8 %1 to i32
%6 = add nuw nsw i32 %5, -8254
%7 = add nsw i32 %6, %4
%8 = sitofp i32 %7 to float
%9 = fmul float %8, 0x3F1FC270C0000000
ret float %9
}
double add1_double_double(double x) { return x + 1; }


x86 assembly (clang, -O0):
<add1_double_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @add1_double_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @add1_double_double(double %0) {
%2 = fadd double %0, 1.000000e+00
ret double %2
}
/* Variables and functions */
double pow(double, double);
double e_nt(double nt) {
  if (nt > 100)
    return 1.0;
  else {
    double a = pow(nt, -0.2232 + -0.006457 * nt);
    return 98.96 * a;
  }
}


x86 assembly (clang, -O0):
<e_nt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <e_nt+0x36>
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <e_nt+0x74>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb4(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_nt>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <e_nt+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
movsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xedf(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @e_nt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ogt double %5, 1.000000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double -6.457000e-03, double %10, double -2.232000e-01)
%12 = call double @pow(double %9, double %11)
store double %12, double* %4
%13 = load double, double* %4
%14 = fmul double 0x4058BD70A3D70A3D, %13
store double %14, double* %2
br label %15
15: ; preds = %8, %7
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @e_nt(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double -6.457000e-03, double -2.232000e-01)
%5 = tail call double @pow(double %0, double %4)
%6 = fmul double %5, 0x4058BD70A3D70A3D
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
float decode_est_velocity(char ev) { return (ev / 25.0); }


x86 assembly (clang, -O0):
<decode_est_velocity>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @decode_est_velocity(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 2.500000e+01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @decode_est_velocity(i8 signext %0) {
%2 = sitofp i8 %0 to double
%3 = fdiv double %2, 2.500000e+01
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
uint8_t mem_read8(uint8_t *mem, uint16_t addr) { return mem[addr]; }


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

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

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

LLVM IR (-O2):
define i32 @mem_read8(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = load i32, i32* %3
ret i32 %4
}
void test3() {}


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

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

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

LLVM IR (-O2):
define void @test3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  int j = 0;
  if (++i > 0 && ++j > 0) {
    printf("%d\n", i);
    printf("%d\n", j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116f <main+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    116f <main+0x5f>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
unsigned long long strtoull(char const *, char **, int);
unsigned long long strtoull_l(const char *restrict s, char **restrict p,
                              int base, locale_t loc) {
  return strtoull(s, p, base);
}


x86 assembly (clang, -O0):
<strtoull_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull_l>:
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i64 @strtoull_l(i8* noalias %0, i8** noalias %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = call i64 @strtoull(i8* %9, i8** %10, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @strtoull_l(i8* noalias %0, i8** noalias nocapture %1, i32 %2, i32 %3) {
%5 = tail call i64 @strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0, j = 0;
  if (i || (j = i + 10))
    printf("%d is the final value of j", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1149 <main+0x39>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <main+0x48>
mov    -0xc(%rbp),%esi
lea    0xead(%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
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%d is the final value of j\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 10
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6, %0
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"%d is the final value of j\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
unsigned int HashOpcode(const char *op) {
  unsigned int hash = 0;
  while (*op)
    hash = 2039545 * hash + *op++;
  return hash ^ (hash >> 14);
}


x86 assembly (clang, -O0):
<HashOpcode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <HashOpcode+0x3f>
imul   $0x1f1ef9,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <HashOpcode+0xf>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0xe,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashOpcode>:
mov    (%rdi),%al
test   %al,%al
je     1128 <HashOpcode+0x28>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
imul   $0x1f1ef9,%ecx,%edx
movsbl %al,%ecx
add    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <HashOpcode+0x10>
jmp    112a <HashOpcode+0x2a>
xor    %ecx,%ecx
mov    %ecx,%eax
shr    $0xe,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @HashOpcode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 2039545
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
%16 = lshr i32 %15, 14
%17 = xor i32 %16, %15
ret i32 %17
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
int check_for_ectopic(float Pe) {
  int rtn = 0;
  float rand_no;
  if (Pe == 0)
    return (0);
  rand_no = ((float)rand() / RAND_MAX);
  if (rand_no < Pe)
    rtn = 1;
  else
    rtn = 0;
  return (rtn);
}


x86 assembly (clang, -O0):
<check_for_ectopic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1147 <check_for_ectopic+0x37>
jp     1147 <check_for_ectopic+0x37>
movl   $0x0,-0x4(%rbp)
jmp    118f <check_for_ectopic+0x7f>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e8e(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1182 <check_for_ectopic+0x72>
movl   $0x1,-0xc(%rbp)
jmp    1189 <check_for_ectopic+0x79>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_ectopic>:
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111d <check_for_ectopic+0xd>
jp     111d <check_for_ectopic+0xd>
ret
push   %rax
xor    %eax,%eax
movss  %xmm0,0x4(%rsp)
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eae(%rip),%rax
divss  (%rax),%xmm0
xor    %eax,%eax
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
seta   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define i32 @check_for_ectopic(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store float %0, float* %3
store i32 0, i32* %4
%6 = load float, float* %3
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %21
9: ; preds = %1
%10 = call i64 (...) @rand()
%11 = sitofp i64 %10 to float
%12 = load float, float* @RAND_MAX
%13 = fdiv float %11, %12
store float %13, float* %5
%14 = load float, float* %5
%15 = load float, float* %3
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %9
store i32 1, i32* %4
br label %19
18: ; preds = %9
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %8
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define i32 @check_for_ectopic(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load float, float* @RAND_MAX
%7 = fdiv float %5, %6
%8 = fcmp olt float %7, %0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 0, %1 ]
ret i32 %11
}
__attribute__((no)) void func_8(void) {}


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

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

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

LLVM IR (-O2):
define void @func_8() {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? c - 0x20 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) { foo(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int8_t(int8_t const k1, int8_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int8_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 eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ read_kmem(unsigned int *, int, unsigned long);
unsigned int read_int(unsigned long addr) {
  unsigned int ret;
  read_kmem(&ret, sizeof(ret), addr);
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @read_int(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read_kmem(i32* %2, i32 4, i64 %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(double);
void print(double a) { debug(a); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <debug@plt>

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

LLVM IR (-O2):
define void @print(double %0) {
%2 = tail call i32 @debug(double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showException4WDump(int);
void _illegalinst_callback() {
  VDP_init();
  VDP_drawText("ILLEGAL INSTRUCTION !", 7, 3);
  showException4WDump(5);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_illegalinst_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0x7,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showException4WDump@plt>
jmp    115b <_illegalinst_callback+0x2b>

x86 assembly (clang, -O2):
<_illegalinst_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0x7,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showException4WDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_illegalinst_callback+0x30>

LLVM IR (-O0):
@.str = [22 x i8] c"ILLEGAL INSTRUCTION !\00"
define void @_illegalinst_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 7, i32 3)
%3 = call i32 @showException4WDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"ILLEGAL INSTRUCTION !\00"
define void @_illegalinst_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 7, i32 3)
%3 = tail call i32 @showException4WDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}