xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(int);
void *radar11329382(unsigned bl) {
  void *ptr = malloc(16);
  ptr = ptr + (2 - bl);
  return ptr;
}


x86 assembly (clang, -O0):
<radar11329382>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
sub    -0x4(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radar11329382>:
push   %rbx
mov    %edi,%ebx
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    $0x2,%ecx
sub    %ebx,%ecx
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @radar11329382(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 16)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = sub i32 2, %6
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* %5, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @radar11329382(i32 %0) {
%2 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%3 = sub i32 2, %0
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* %2, i64 %4
ret i8* %5
}
void kasan_init(unsigned long membase, unsigned long memsize,
                unsigned long shadow_base) {}


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

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

LLVM IR (-O0):
define void @kasan_init(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @kasan_init(i64 %0, i64 %1, i64 %2) {
ret void
}
int indexOfLeftChild(int index) { return 2 * index + 1; }


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

x86 assembly (clang, -O2):
<indexOfLeftChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @indexOfLeftChild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int IndexKMP(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *str = "aaaaaaaaaaaaaab";
  char *pattern = "aaaaaaab";
  int index = IndexKMP(str, pattern);
  printf("%d\n", index);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <IndexKMP@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <IndexKMP@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"aaaaaaaaaaaaaab\00"
@.str.1 = [9 x i8] c"aaaaaaab\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @IndexKMP(i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"aaaaaaaaaaaaaab\00"
@.str.1 = [9 x i8] c"aaaaaaab\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @IndexKMP(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ idt_set_gate(unsigned int, int, int /*<<< orphan*/, void *);
void set_trap_gate(unsigned int n, void(*addr)) {
  idt_set_gate(n, 15, 0, addr);
}


x86 assembly (clang, -O0):
<set_trap_gate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <idt_set_gate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_trap_gate>:
mov    %rsi,%rcx
mov    $0xf,%esi
xor    %edx,%edx
jmp    1030 <idt_set_gate@plt>

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

LLVM IR (-O2):
define void @set_trap_gate(i32 %0, i8* %1) {
%3 = tail call i32 @idt_set_gate(i32 %0, i32 15, i32 0, i8* %1)
ret void
}
void get_modules() {}


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

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

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

LLVM IR (-O2):
define void @get_modules() {
ret void
}
void CCFD_SGS_free(void *A_ptr) {}


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

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

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

LLVM IR (-O2):
define void @CCFD_SGS_free(i8* nocapture %0) {
ret void
}
int lm_gl_is_enabled(struct lockspace *ls) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.lockspace = type opaque
define i32 @lm_gl_is_enabled(%struct.lockspace* nocapture readnone %0) {
ret i32 -1
}
long double _Complex __conjl(long double _Complex z) { return ~z; }


x86 assembly (clang, -O0):
<__conjl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fchs
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__conjl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fchs
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @__conjl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fneg x86_fp80 %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %4, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %10
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @__conjl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = fneg x86_fp80 %5
%7 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%8 = insertvalue { x86_fp80, x86_fp80 } %7, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %8
}
const char *viewrules() {
  char rules[] = " Dans Quizzy les regles ssont simples vous devez \nrepondre "
                 "aux questions pour gagner le plus de points";
  return rules;
}


x86 assembly (clang, -O0):
<viewrules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x67,%edx
call   1030 <memcpy@plt>
lea    -0x70(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewrules>:
lea    -0x68(%rsp),%rax
ret

LLVM IR (-O0):
@__const.viewrules.rules = [103 x i8] c" Dans Quizzy les regles ssont simples vous devez \0Arepondre aux questions pour gagner le plus de points\00"
define i8* @viewrules() {
%1 = alloca [103 x i8]
%2 = bitcast [103 x i8]* %1 to i8*
%3 = getelementptr inbounds [103 x i8], [103 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @viewrules() {
%1 = alloca [103 x i8]
%2 = getelementptr inbounds [103 x i8], [103 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ allocator_default();
int /*<<< orphan*/ allocator_free(int /*<<< orphan*/, int /*<<< orphan*/);
void _ensure_allocator_default_free_copes_with_null_address(void) {
  allocator_free(0, allocator_default());
}


x86 assembly (clang, -O0):
<_ensure_allocator_default_free_copes_with_null_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <allocator_default@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <allocator_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_default_free_copes_with_null_address>:
push   %rax
xor    %eax,%eax
call   1040 <allocator_default@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <allocator_free@plt>

LLVM IR (-O0):
define void @_ensure_allocator_default_free_copes_with_null_address() {
%1 = call i32 (...) @allocator_default()
%2 = call i32 @allocator_free(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_default_free_copes_with_null_address() {
%1 = tail call i32 (...) @allocator_default()
%2 = tail call i32 @allocator_free(i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int dumpString(char *s, FILE *stream) {
  if (fputs(s, stream) == EOF) {
    perror("Error in dumpString\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dumpString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fputs@plt>
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jne    1165 <dumpString+0x45>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <dumpString+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpString>:
push   %rax
call   1030 <fputs@plt>
mov    %rax,%rcx
mov    0x2eb8(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
je     1139 <dumpString+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [21 x i8] c"Error in dumpString\0A\00"
define i32 @dumpString(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = load i32*, i32** %5
%8 = call i64 @fputs(i8* %6, i32* %7)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [21 x i8] c"Error in dumpString\0A\00"
define i32 @dumpString(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fputs(i8* %0, i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
struct net_struct {
  int dummy;
};
struct _inet_impl {
  int dummy;
};

/* Variables and functions */
struct _inet_impl *_conv_inet_impl(struct net_struct *);
long net_session_count(struct net_struct *net) {
  struct _inet_impl *inet;
  if (!net)
    goto error_ret;
  inet = _conv_inet_impl(net);
  return 0;
error_ret:
  return -1;
}


x86 assembly (clang, -O0):
<net_session_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <net_session_count+0x1c>
jmp    1146 <net_session_count+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <_conv_inet_impl@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
jmp    114e <net_session_count+0x3e>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_session_count>:
test   %rdi,%rdi
je     1122 <net_session_count+0x12>
push   %rax
call   1030 <_conv_inet_impl@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.net_struct = type { i32 }
%struct._inet_impl = type { i32 }
define i64 @net_session_count(%struct.net_struct* %0) {
%2 = alloca i64
%3 = alloca %struct.net_struct*
%4 = alloca %struct._inet_impl*
store %struct.net_struct* %0, %struct.net_struct** %3
%5 = load %struct.net_struct*, %struct.net_struct** %3
%6 = icmp ne %struct.net_struct* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %11
8: ; preds = %1
%9 = load %struct.net_struct*, %struct.net_struct** %3
%10 = call %struct._inet_impl* @_conv_inet_impl(%struct.net_struct* %9)
store %struct._inet_impl* %10, %struct._inet_impl** %4
store i64 0, i64* %2
br label %12
11: ; preds = %7
store i64 -1, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.net_struct = type { i32 }
%struct._inet_impl = type { i32 }
define i64 @net_session_count(%struct.net_struct* %0) {
%2 = icmp eq %struct.net_struct* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call %struct._inet_impl* @_conv_inet_impl(%struct.net_struct* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ 0, %3 ], [ -1, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ti;
struct cdrom_ti {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct cdrom_ti ti;
  (void)ti;
  return sizeof(ti);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void TMR3TimerSave(void) {}


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

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

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

LLVM IR (-O2):
define void @TMR3TimerSave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printopts() {
  fprintf(stderr, "usage: mkfs [options] device isize fsize\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"usage: mkfs [options] device isize fsize\0A\00"
define void @printopts() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"usage: mkfs [options] device isize fsize\0A\00"
define void @printopts() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int main() {
  char s[101];
  scanf("%s", s), s[5] = 0, printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movb   $0x0,-0x6b(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movb   $0x0,0x5(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 5
store i8 0, i8* %4
%5 = call i32 @puts(i8* %2)
ret i32 0
}
char *hash_plugin_detailed(void) {
  return ("o5logon - TNS O5logon session,salt\n"
          "------------------------\n"
          "Use this module to crack TNS login sessions\n"
          "Input should be in form: \'dbuser:AUTH_SESSKEY:AUTH_VFR_DATA\'\n"
          "JtR-compatible input format also accepted\n"
          "Software that uses that password hashing method:\n"
          "oracle 11g \n"
          "\nAuthor: Alex Stanev <alex@stanev.org>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [308 x i8] c"o5logon - TNS O5logon session,salt\0A------------------------\0AUse this module to crack TNS login sessions\0AInput should be in form: 'dbuser:AUTH_SESSKEY:AUTH_VFR_DATA'\0AJtR-compatible input format also accepted\0ASoftware that uses that password hashing method:\0Aoracle 11g \0A\0AAuthor: Alex Stanev <alex@stanev.org>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [308 x i8] c"o5logon - TNS O5logon session,salt\0A------------------------\0AUse this module to crack TNS login sessions\0AInput should be in form: 'dbuser:AUTH_SESSKEY:AUTH_VFR_DATA'\0AJtR-compatible input format also accepted\0ASoftware that uses that password hashing method:\0Aoracle 11g \0A\0AAuthor: Alex Stanev <alex@stanev.org>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0)
}
void printfINT(int number) {}


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

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

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

LLVM IR (-O2):
define void @printfINT(i32 %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("NL: %d\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [8 x i8] c"NL: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_north_west_corner();
int /*<<< orphan*/ do_south_east_corner();
double get_south_penetration();
void do_north_east_diag(void) {
  if (get_south_penetration() <= 0.5)
    do_south_east_corner();
  else
    do_north_west_corner();
}


x86 assembly (clang, -O0):
<do_north_east_diag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <get_south_penetration@plt>
movaps %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115c <do_north_east_diag+0x2c>
mov    $0x0,%al
call   1030 <do_south_east_corner@plt>
jmp    1163 <do_north_east_diag+0x33>
mov    $0x0,%al
call   1040 <do_north_west_corner@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_north_east_diag>:
push   %rax
xor    %eax,%eax
call   1050 <get_south_penetration@plt>
movsd  0xec0(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jae    114e <do_north_east_diag+0x1e>
pop    %rcx
jmp    1040 <do_north_west_corner@plt>
pop    %rcx
jmp    1030 <do_south_east_corner@plt>

LLVM IR (-O0):
define void @do_north_east_diag() {
%1 = call double (...) @get_south_penetration()
%2 = fcmp ole double %1, 5.000000e-01
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @do_south_east_corner()
br label %7
5: ; preds = %0
%6 = call i32 (...) @do_north_west_corner()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @do_north_east_diag() {
%1 = tail call double (...) @get_south_penetration()
%2 = fcmp ugt double %1, 5.000000e-01
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @do_south_east_corner()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @do_north_west_corner()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ serializeFrsky(int);
void serialize16(int16_t a) {
  uint8_t t;
  t = a;
  serializeFrsky(t);
  t = a >> 8 & 0xff;
  serializeFrsky(t);
}


x86 assembly (clang, -O0):
<serialize16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <serializeFrsky@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <serializeFrsky@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize16>:
push   %rbx
mov    %edi,%ebx
call   1030 <serializeFrsky@plt>
movzbl %bh,%edi
pop    %rbx
jmp    1030 <serializeFrsky@plt>

LLVM IR (-O0):
define void @serialize16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @serializeFrsky(i32 %5)
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @serializeFrsky(i32 %10)
ret void
}

LLVM IR (-O2):
define void @serialize16(i32 %0) {
%2 = tail call i32 @serializeFrsky(i32 %0)
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @serializeFrsky(i32 %4)
ret void
}
/* Variables and functions */
char *setlocale(int, char const *);
char *strdup(char const *);
char *setlocale_copy(int category, const char *locale) {
  const char *result = setlocale(category, locale);
  if (result == NULL)
    return NULL;
  return strdup(result);
}


x86 assembly (clang, -O0):
<setlocale_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <setlocale@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <setlocale_copy+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1164 <setlocale_copy+0x44>
mov    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale_copy>:
push   %rax
call   1030 <setlocale@plt>
test   %rax,%rax
je     1134 <setlocale_copy+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @setlocale_copy(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i8* @setlocale(i32 %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i8* @strdup(i8* %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %12
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @setlocale_copy(i32 %0, i8* %1) {
%3 = tail call i8* @setlocale(i32 %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @strdup(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
unsigned char BCD2HEX(unsigned char n) {
  unsigned char ourvalue = ((n >> 4) * 10 + (n & 0x0f));
  return ourvalue;
}


x86 assembly (clang, -O0):
<BCD2HEX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BCD2HEX>:
mov    %edi,%eax
shr    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @BCD2HEX(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 4
%7 = mul nsw i32 %6, 10
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = add nsw i32 %7, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @BCD2HEX(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = mul nuw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nuw i8 %3, %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ cov_arr_log(long double *, int, char *, char *);
int /*<<< orphan*/ cov_log(char *, char *, int, long double);
void cov_arr_spec_log(char *fn, long double delta, int count,
                      long double *lds) {
  cov_arr_log(lds, count, "ideal", fn);
  cov_log("delta", fn, 1, delta);
}


x86 assembly (clang, -O0):
<cov_arr_spec_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xeb5(%rip),%rdx
call   1030 <cov_arr_log@plt>
mov    -0x8(%rbp),%rsi
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xea3(%rip),%rdi
mov    $0x1,%edx
call   1040 <cov_log@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cov_arr_spec_log>:
push   %rbx
mov    %rdx,%rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rcx
call   1030 <cov_arr_log@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <cov_log@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ideal\00"
@.str.1 = [6 x i8] c"delta\00"
define void @cov_arr_spec_log(i8* %0, x86_fp80 %1, i32 %2, x86_fp80* %3) {
%5 = alloca i8*
%6 = alloca x86_fp80
%7 = alloca i32
%8 = alloca x86_fp80*
store i8* %0, i8** %5
store x86_fp80 %1, x86_fp80* %6
store i32 %2, i32* %7
store x86_fp80* %3, x86_fp80** %8
%9 = load x86_fp80*, x86_fp80** %8
%10 = load i32, i32* %7
%11 = load i8*, i8** %5
%12 = call i32 @cov_arr_log(x86_fp80* %9, i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @cov_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 1, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ideal\00"
@.str.1 = [6 x i8] c"delta\00"
define void @cov_arr_spec_log(i8* %0, x86_fp80 %1, i32 %2, x86_fp80* %3) {
%5 = tail call i32 @cov_arr_log(x86_fp80* %3, i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @cov_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 1, x86_fp80 %1)
ret void
}
/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ std_memcpy(void *, int *, int);
void pack_int(void **pp, int i) {
  i = htonl(i);
  std_memcpy(*pp, &i, sizeof(int));
  *pp += sizeof(int);
}


x86 assembly (clang, -O0):
<pack_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <std_memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <std_memcpy@plt>
addq   $0x4,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @pack_int(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = call i32 @std_memcpy(i8* %8, i32* %4, i32 4)
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr i8, i8* %11, i64 4
store i8* %12, i8** %10
ret void
}

LLVM IR (-O2):
define void @pack_int(i8** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = load i8*, i8** %0
%6 = call i32 @std_memcpy(i8* %5, i32* %3, i32 4)
%7 = load i8*, i8** %0
%8 = getelementptr i8, i8* %7, i64 4
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ llib_snb_to_ulong(char const *, unsigned long *, char **,
                                     int);
__attribute__((unused)) long int strtoul(const char *nptr, char **endptr,
                                         int base) {
  unsigned long int li;
  llib_snb_to_ulong(nptr, &li, endptr, base);
  return li;
}


x86 assembly (clang, -O0):
<strtoul>:
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),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x20(%rbp),%rsi
call   1030 <llib_snb_to_ulong@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rsp,%rsi
call   1030 <llib_snb_to_ulong@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @llib_snb_to_ulong(i8* %0, i64* %4, i8** %1, i32 %2)
%7 = load i64, i64* %4
ret i64 %7
}
/* Variables and functions */
int setuid(int);
int prot_uid(int uid) { return setuid(uid); }


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

x86 assembly (clang, -O2):
<prot_uid>:
jmp    1030 <setuid@plt>

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

LLVM IR (-O2):
define i32 @prot_uid(i32 %0) {
%2 = tail call i32 @setuid(i32 %0)
ret i32 %2
}
void test18_Atmega328p_reset__E() {}


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

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

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

LLVM IR (-O2):
define void @test18_Atmega328p_reset__E() {
ret void
}
float RSqrt(float number) {
  long i;
  float x2, y;
  const float threehalfs = 1.5f;
  x2 = number * 0.5f;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (threehalfs - (x2 * y * y));
  return y;
}


x86 assembly (clang, -O0):
<RSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe7b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @RSqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463007, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
ret float %25
}

LLVM IR (-O2):
define float @RSqrt(float %0) {
ret float poison
}
char *RB_XMLDB_Get_Default_Extension(void) { return ".xml"; }


x86 assembly (clang, -O0):
<RB_XMLDB_Get_Default_Extension>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c".xml\00"
define i8* @RB_XMLDB_Get_Default_Extension() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c".xml\00"
define i8* @RB_XMLDB_Get_Default_Extension() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
double MMHGtoINHG(double MMHG) {
  double INHG = 0.03937008 * MMHG;
  return INHG;
}


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

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

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

LLVM IR (-O2):
define double @MMHGtoINHG(double %0) {
%2 = fmul double %0, 0x3FA42850AC14F154
ret double %2
}
void ff_hevc_put_hevc_bi_pel_pixels48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels48_12_sse4() {
ret void
}
/* Variables and functions */
int snprintf(char *, int const, char *, char *, char *);
int handle_mode(char *channel, char *params, char *mesg, const int mesg_len) {
  return (*params)
             ? snprintf(mesg, mesg_len, "MODE %s %s\r\n", channel, params + 1)
             : 0;
}


x86 assembly (clang, -O0):
<handle_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <handle_mode+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
add    $0x1,%r8
lea    0xeaf(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x20(%rbp)
jmp    1168 <handle_mode+0x58>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <handle_mode+0x58>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_mode>:
cmpb   $0x0,(%rsi)
je     1136 <handle_mode+0x26>
mov    %rsi,%r8
mov    %rdi,%rax
add    $0x1,%r8
lea    0xeda(%rip),%r9
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %r9,%rdx
mov    %rax,%rcx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MODE %s %s\0D\0A\00"
define i32 @handle_mode(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = call i32 @snprintf(i8* %14, i32 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %18)
br label %21
20: ; preds = %4
br label %21
21: ; preds = %20, %13
%22 = phi i32 [ %19, %13 ], [ 0, %20 ]
ret i32 %22
}

LLVM IR (-O2):
@.str = [13 x i8] c"MODE %s %s\0D\0A\00"
define i32 @handle_mode(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %8)
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ %9, %7 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ hud_setup();
void hud_update(void) { hud_setup(); }


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

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

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

LLVM IR (-O2):
define void @hud_update() {
%1 = tail call i32 (...) @hud_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Use a book.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Use a book.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct lk_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __lk_list_del_entry(struct lk_list_head *);
int /*<<< orphan*/ lk_list_add_tail(struct lk_list_head *,
                                    struct lk_list_head *);
void lk_list_move_tail(struct lk_list_head *list, struct lk_list_head *head) {
  __lk_list_del_entry(list);
  lk_list_add_tail(list, head);
}


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

x86 assembly (clang, -O2):
<lk_list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__lk_list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <lk_list_add_tail@plt>

LLVM IR (-O0):
%struct.lk_list_head = type { i32 }
define void @lk_list_move_tail(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = alloca %struct.lk_list_head*
%4 = alloca %struct.lk_list_head*
store %struct.lk_list_head* %0, %struct.lk_list_head** %3
store %struct.lk_list_head* %1, %struct.lk_list_head** %4
%5 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%6 = call i32 @__lk_list_del_entry(%struct.lk_list_head* %5)
%7 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%8 = load %struct.lk_list_head*, %struct.lk_list_head** %4
%9 = call i32 @lk_list_add_tail(%struct.lk_list_head* %7, %struct.lk_list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.lk_list_head = type { i32 }
define void @lk_list_move_tail(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = tail call i32 @__lk_list_del_entry(%struct.lk_list_head* %0)
%4 = tail call i32 @lk_list_add_tail(%struct.lk_list_head* %0, %struct.lk_list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ random();
int main() {
  int i, count = 1000000;
  for (i = 0; i < count; i += 1) {
    printf("%d\n", (int)random());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf4240,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <main+0x4c>
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xf4240,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1040 <random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 1000000, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = call i64 (...) @random()
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @random()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 1000000
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CMasterSlaveAddrSet(uint32_t ui32Base, uint8_t ui8SlaveAddr,
                           bool bReceive) {
  ;
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000800))) =
      (ui8SlaveAddr << 1) | bReceive;
}


x86 assembly (clang, -O0):
<I2CMasterSlaveAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
or     -0xc(%rbp),%eax
movslq %eax,%rcx
mov    $0x40002800,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterSlaveAddrSet>:
add    %esi,%esi
or     %edx,%esi
movslq %esi,%rax
mov    %rax,0x40002800
40
ret

LLVM IR (-O0):
define void @I2CMasterSlaveAddrSet(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* %5
%8 = shl i32 %7, 1
%9 = load i32, i32* %6
%10 = or i32 %8, %9
%11 = sext i32 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 1073752064 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CMasterSlaveAddrSet(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 1
%5 = or i32 %4, %2
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1073752064 to i64*)
ret void
}