xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t llistxattr(const char *path, char *list, size_t size) {
  return syscall(195, path, list, size);
}


x86 assembly (clang, -O0):
<llistxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xc3,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llistxattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc3,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @llistxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 195, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int bar();
int old_foo() { return 10 + bar(); }


x86 assembly (clang, -O0):
<old_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<old_foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @old_foo() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 10, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @old_foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 10
ret i32 %2
}
/* Variables and functions */
int gettid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *thread_func(void *arg) {
  printf("thread started, pid = %d\n", gettid());
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1151 <thread_func+0x21>

x86 assembly (clang, -O2):
<thread_func>:
push   %rax
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1150 <thread_func+0x20>

LLVM IR (-O0):
@.str = [26 x i8] c"thread started, pid = %d\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @gettid()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %1, %5
%6 = call i32 @sleep(i32 1)
br label %5
}

LLVM IR (-O2):
@.str = [26 x i8] c"thread started, pid = %d\0A\00"
define noalias i8* @thread_func(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @gettid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %4
4: ; preds = %1, %4
%5 = tail call i32 @sleep(i32 1)
br label %4
}
int carmen_base_direct_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @carmen_base_direct_reset() {
ret i32 0
}
int xtensa_neg_uimm8x4(v)
int v;
{ return (v & 3) == 0 && (v >= -1024 && v <= -4); }


x86 assembly (clang, -O0):
<xtensa_neg_uimm8x4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    113d <xtensa_neg_uimm8x4+0x3d>
xor    %eax,%eax
cmpl   $0xfffffc00,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1137 <xtensa_neg_uimm8x4+0x37>
cmpl   $0xfffffffc,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_neg_uimm8x4>:
test   $0x3,%dil
sete   %al
add    $0x400,%edi
cmp    $0x3fd,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @xtensa_neg_uimm8x4(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = add i32 %0, 1024
%5 = icmp ult i32 %4, 1021
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef char *uint32_t;
typedef char *int32_t;

/* Variables and functions */
int32_t get_extended_leaf() {
  uint32_t ext_leaf_max = 0;
  asm("mov $0x80000000, %%eax;"
      "cpuid;"
      : "=a"(ext_leaf_max)
      :
      : "%ebx", "%ecx", "%edx");
  return ext_leaf_max;
}


x86 assembly (clang, -O0):
<get_extended_leaf>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movq   $0x0,-0x10(%rbp)
mov    $0x80000000,%eax
cpuid
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_extended_leaf>:
push   %rbx
mov    $0x80000000,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_extended_leaf() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* asm "mov $$0x80000000, %eax;cpuid;", "={ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_extended_leaf() {
%1 = tail call i8* asm "mov $$0x80000000, %eax;cpuid;", "={ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void pointer_array_free(void **pointerArray) {
  size_t count = 0;
  while (pointerArray[count] != NULL) {
    free(pointerArray[count]);
    count++;
  }
  free(pointerArray);
}


x86 assembly (clang, -O0):
<pointer_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1159 <pointer_array_free+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <pointer_array_free+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_array_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <pointer_array_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <pointer_array_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @pointer_array_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ 0, %1 ]
%7 = bitcast i8* %5 to i8**
%8 = tail call i32 @free(i8** %7)
%9 = add i64 %6, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *print(void *str) {
  char *tex = (char *)str;
  printf("%c\n", *tex);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
movsbl (%rdi),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i8* @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define noalias i8* @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
void usage(void) {
  write(2, "getty: invalid arguments\n", 25);
  sleep(5);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xec0(%rip),%rsi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x2,%edi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"getty: invalid arguments\0A\00"
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = call i32 @sleep(i32 5)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"getty: invalid arguments\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @sleep(i32 5)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double pow(double, double);
double compute_rank(int location) {
  double temp;
  temp = pow((double)(location + 1), (double)(-2. / 3.));
  return temp;
}


x86 assembly (clang, -O0):
<compute_rank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed3(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_rank>:
add    $0x1,%edi
cvtsi2sd %edi,%xmm0
movsd  0xee1(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @compute_rank(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = call double @pow(double %6, double 0xBFE5555555555555)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @compute_rank(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sitofp i32 %2 to double
%4 = tail call double @pow(double %3, double 0xBFE5555555555555)
ret double %4
}
void gtk_tree_row_reference_get_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_row_reference_get_path() {
ret void
}
void dqs_bdl_enable(void) {
  unsigned int tmp;
  tmp = (*(volatile unsigned int *)(0x20118000 + 0x70));
  tmp = tmp | (1 << 20);
  (*(volatile unsigned int *)(0x20118000 + 0x70) = (tmp));
  tmp = tmp & 0xFFEFFFFF;
  (*(volatile unsigned int *)(0x20118000 + 0x70) = (tmp));
}


x86 assembly (clang, -O0):
<dqs_bdl_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20118070,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x100000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x20118070,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xffefffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x20118070,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dqs_bdl_enable>:
mov    0x20118070,%eax
mov    %eax,%ecx
or     $0x100000,%ecx
mov    %ecx,0x20118070
and    $0xffefffff,%eax
mov    %eax,0x20118070
ret

LLVM IR (-O0):
define void @dqs_bdl_enable() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 538017904 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 1048576
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 538017904 to i32*)
%6 = load i32, i32* %1
%7 = and i32 %6, -1048577
store i32 %7, i32* %1
%8 = load i32, i32* %1
store volatile i32 %8, i32* inttoptr (i64 538017904 to i32*)
ret void
}

LLVM IR (-O2):
define void @dqs_bdl_enable() {
%1 = load volatile i32, i32* inttoptr (i64 538017904 to i32*)
%2 = or i32 %1, 1048576
store volatile i32 %2, i32* inttoptr (i64 538017904 to i32*)
%3 = and i32 %1, -1048577
store volatile i32 %3, i32* inttoptr (i64 538017904 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _dos_putc(char);
void _dos_puts(const char *p) {
  char c;
  while ((c = *p++) != 0)
    _dos_putc(c);
}


x86 assembly (clang, -O0):
<_dos_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <_dos_puts+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <_dos_putc@plt>
jmp    111c <_dos_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dos_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <_dos_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <_dos_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_dos_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @_dos_puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %3
%12 = call i32 @_dos_putc(i8 signext %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @_dos_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @_dos_putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
char *hash_plugin_detailed(void) {
  return ("ntlm - NTLM plugin\n"
          "------------------------\n"
          "Use this module to crack simple NTLM hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "PWDUMP hash format is also supported\n"
          "Known software that uses this password hashing method:\n"
          "Recent Microsoft Windows versions\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\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 = [312 x i8] c"ntlm - NTLM plugin\0A------------------------\0AUse this module to crack simple NTLM hashes\0AInput should be in form: 'user:hash' or just 'hash'\0APWDUMP hash format is also supported\0AKnown software that uses this password hashing method:\0ARecent Microsoft Windows versions\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([312 x i8], [312 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [312 x i8] c"ntlm - NTLM plugin\0A------------------------\0AUse this module to crack simple NTLM hashes\0AInput should be in form: 'user:hash' or just 'hash'\0APWDUMP hash format is also supported\0AKnown software that uses this password hashing method:\0ARecent Microsoft Windows versions\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([312 x i8], [312 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t PartitionErAlgorithmIIR(int /*<<< orphan*/, int *, int *, size_t, size_t,
                               int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(size_t);
size_t PartitionErAlgorithmII(int *val, size_t n, size_t k) {
  size_t count;
  int *sol = (int *)malloc(n * sizeof(int));
  count = PartitionErAlgorithmIIR(0, val, sol, n, k, 0, 0);
  free(sol);
  return (count);
}


x86 assembly (clang, -O0):
<PartitionErAlgorithmII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %r9d,%r9d
mov    %r9d,%edi
movl   $0x0,(%rsp)
call   1040 <PartitionErAlgorithmIIR@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PartitionErAlgorithmII>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x0(,%rsi,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %r9d,%r9d
call   1040 <PartitionErAlgorithmIIR@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @PartitionErAlgorithmII(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
%10 = mul i64 %9, 4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %8
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = call i64 @PartitionErAlgorithmIIR(i32 0, i32* %13, i32* %14, i64 %15, i64 %16, i32 0, i32 0)
store i64 %17, i64* %7
%18 = load i32*, i32** %8
%19 = call i32 @free(i32* %18)
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @PartitionErAlgorithmII(i32* %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i64 @PartitionErAlgorithmIIR(i32 0, i32* %0, i32* %6, i64 %1, i64 %2, i32 0, i32 0)
%8 = tail call i32 @free(i32* %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ getdiskid(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char hardseri[50];
  getdiskid(hardseri);
  printf("%s\n", hardseri);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getdiskid@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @getdiskid(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int cBytesCopyFromtolen(unsigned char *, unsigned char *, int);
int cBytesReplacefromtowithstartingAt(unsigned char *pTo, int start, int stop,
                                      unsigned char *pFrom, int repStart) {
  return cBytesCopyFromtolen(pFrom + repStart, pTo + start, (stop - start) + 1);
}


x86 assembly (clang, -O0):
<cBytesReplacefromtowithstartingAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <cBytesCopyFromtolen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cBytesReplacefromtowithstartingAt>:
movslq %r8d,%rax
add    %rcx,%rax
movslq %esi,%rcx
lea    (%rdi,%rcx,1),%rsi
sub    %ecx,%edx
add    $0x1,%edx
mov    %rax,%rdi
jmp    1030 <cBytesCopyFromtolen@plt>

LLVM IR (-O0):
define i32 @cBytesReplacefromtowithstartingAt(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %9
%12 = load i32, i32* %10
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = sub nsw i32 %19, %20
%22 = add nsw i32 %21, 1
%23 = call i32 @cBytesCopyFromtolen(i8* %14, i8* %18, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @cBytesReplacefromtowithstartingAt(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = sub i32 1, %1
%11 = add i32 %10, %2
%12 = tail call i32 @cBytesCopyFromtolen(i8* %7, i8* %9, i32 %11)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma2(int, int);
int main() {
  int a, b, c;
  printf("%d", soma2(10, 20));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <soma2@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @soma2(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int prepouet() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @prepouet() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, int /*<<< orphan*/, int);
void strncat_null_src(char *x) { strncat(x, 0, 4); }


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

x86 assembly (clang, -O2):
<strncat_null_src>:
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <strncat@plt>

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

LLVM IR (-O2):
define void @strncat_null_src(i8* %0) {
%2 = tail call i32 @strncat(i8* %0, i32 0, i32 4)
ret void
}
void set_bit(int nr, volatile void *addr) {
  int mask;
  volatile unsigned int *a = addr;
  unsigned long flags;
  a += nr >> 5;
  mask = 1 << (nr & 0x1f);
  local_irq_save(flags);
  *a |= mask;
  local_irq_restore(flags);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <local_irq_save@plt>
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1040 <local_irq_restore@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
movslq %eax,%rbx
mov    $0x1,%ebp
shl    %cl,%ebp
xor    %eax,%eax
call   1030 <local_irq_save@plt>
or     %ebp,(%r14,%rbx,4)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <local_irq_restore@plt>

LLVM IR (-O0):
define void @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = load i32*, i32** %6
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %6
%15 = load i32, i32* %3
%16 = and i32 %15, 31
%17 = shl i32 1, %16
store i32 %17, i32* %5
%18 = load i64, i64* %7
%19 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 %18)
%20 = load i32, i32* %5
%21 = load i32*, i32** %6
%22 = load volatile i32, i32* %21
%23 = or i32 %22, %20
store volatile i32 %23, i32* %21
%24 = load i64, i64* %7
%25 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 %24)
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 undef)
%10 = load volatile i32, i32* %6
%11 = or i32 %10, %8
store volatile i32 %11, i32* %6
%12 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int c1;
  int i;
  {
    hash(1);
    hash(0);
  };
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <hash@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @hash(i32 1)
%4 = call i32 @hash(i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 1)
%2 = tail call i32 @hash(i32 0)
ret void
}
void inc_zcache_flobj_found(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_flobj_found() {
ret void
}
int ath10k_spectral_start(struct ath10k *ar) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath10k = type opaque
define i32 @ath10k_spectral_start(%struct.ath10k* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ linux_netlink_stop_event_monitor();
void linux_stop_event_monitor(void) { linux_netlink_stop_event_monitor(); }


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

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

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

LLVM IR (-O2):
define void @linux_stop_event_monitor() {
%1 = tail call i32 (...) @linux_netlink_stop_event_monitor()
ret void
}
/* Variables and functions */
int rand();
int RandomNumber(int min, int max) {
  return min + (rand() % ((max - min) + 1));
}


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

x86 assembly (clang, -O2):
<RandomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandomNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RandomNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void lcdl_printText(const char *sText_p) {}


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

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

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

LLVM IR (-O2):
define void @lcdl_printText(i8* nocapture %0) {
ret void
}
int ld_blt_rc1(long double a1) { return (__builtin_isless(a1, 100)); }


x86 assembly (clang, -O0):
<ld_blt_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_blt_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_blt_rc1(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double __nv_cbrt(double);
double cbrt(double __a) { return __nv_cbrt(__a); }


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

x86 assembly (clang, -O2):
<cbrt>:
jmp    1030 <__nv_cbrt@plt>

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

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = tail call double @__nv_cbrt(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int flat_dev_close(int, int /*<<< orphan*/);
int flat_close(int abort, off_t written) {
  return flat_dev_close(abort, written);
}


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

x86 assembly (clang, -O2):
<flat_close>:
jmp    1030 <flat_dev_close@plt>

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

LLVM IR (-O2):
define i32 @flat_close(i32 %0, i32 %1) {
%3 = tail call i32 @flat_dev_close(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct mdhd_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mdhd_t *);
void mdhd_exit(struct mdhd_t *mdhd) { free(mdhd); }


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

x86 assembly (clang, -O2):
<mdhd_exit>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mdhd_t = type { i32 }
define void @mdhd_exit(%struct.mdhd_t* nocapture %0) {
%2 = tail call i32 @free(%struct.mdhd_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_clear(void) { printf("\033[2J"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @term_clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t aclamp(int);
int toupper(int);
int valch(int c, bool upper) {
  static const char chars[] = "abcdefghijklmnopqrstuvwxyz";
  int ret;
  if (c < 0 || c > 25)
    return 0;
  ret = chars[aclamp(c)];
  if (upper)
    ret = toupper(ret);
  return ret;
}


x86 assembly (clang, -O0):
<valch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1142 <valch+0x22>
cmpl   $0x19,-0x8(%rbp)
jle    114e <valch+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1182 <valch+0x62>
mov    -0x8(%rbp),%edi
call   1040 <aclamp@plt>
mov    %rax,%rcx
lea    0xea0(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117c <valch+0x5c>
mov    -0x10(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valch>:
xor    %eax,%eax
cmp    $0x19,%edi
ja     1146 <valch+0x26>
push   %rbx
mov    %esi,%ebx
call   1040 <aclamp@plt>
lea    0xeca(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
test   %ebx,%ebx
pop    %rbx
je     1146 <valch+0x26>
mov    %eax,%edi
jmp    1030 <toupper@plt>
ret

LLVM IR (-O0):
@valch.chars = internal constant [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define i32 @valch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 25
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store i32 0, i32* %3
br label %26
13: ; preds = %9
%14 = load i32, i32* %4
%15 = call i64 @aclamp(i32 %14)
%16 = getelementptr inbounds [27 x i8], [27 x i8]* @valch.chars, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %6
%23 = call i32 @toupper(i32 %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %21, %13
%25 = load i32, i32* %6
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %12
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@valch.chars = internal unnamed_addr constant [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define i32 @valch(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 25
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @aclamp(i32 %0)
%6 = getelementptr inbounds [27 x i8], [27 x i8]* @valch.chars, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %1, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %8)
br label %12
12: ; preds = %4, %10, %2
%13 = phi i32 [ 0, %2 ], [ %11, %10 ], [ %8, %4 ]
ret i32 %13
}
int test_imm_EBuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xEB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EBuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 235
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int frand();
int irand(int max_plus_1) {
  int i = (int)(frand() * max_plus_1);
  return i;
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <frand@plt>
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <frand@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @irand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @frand()
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @irand(i32 %0) {
%2 = tail call i32 (...) @frand()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *popen(char *, char *);
FILE *clipboard_xclip_open(char *mode) {
  char *cmd;
  if (mode[0] == 'r') {
    cmd = "xclip -selection clipboard -o";
  } else {
    cmd = "xclip -selection clipboard -i";
  }
  return popen(cmd, mode);
}


x86 assembly (clang, -O0):
<clipboard_xclip_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    113c <clipboard_xclip_open+0x2c>
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <clipboard_xclip_open+0x37>
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <popen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipboard_xclip_open>:
mov    %rdi,%rsi
cmpb   $0x72,(%rdi)
lea    0xee3(%rip),%rax
lea    0xefa(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <popen@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"xclip -selection clipboard -o\00"
@.str.1 = [30 x i8] c"xclip -selection clipboard -i\00"
define i32* @clipboard_xclip_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 114
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %3
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %11
11: ; preds = %10, %9
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32* @popen(i8* %12, i8* %13)
ret i32* %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"xclip -selection clipboard -o\00"
@.str.1 = [30 x i8] c"xclip -selection clipboard -i\00"
define noalias i32* @clipboard_xclip_open(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 114
%4 = select i1 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32* @popen(i8* %4, i8* %0)
ret i32* %5
}
int test_imm_1Fint8_mem(signed char *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 31
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ imprimeLinhas(int);
int /*<<< orphan*/ printf(char *);
main() {
  printf("para n = 10: \n");
  imprimeLinhas(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <imprimeLinhas@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"para n = 10: \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @imprimeLinhas(i32 10)
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"para n = 10: \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @imprimeLinhas(i32 10)
ret i32 0
}
void fn3(int n) {
  n = 3;
  int i;
}


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

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

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

LLVM IR (-O2):
define void @fn3(i32 %0) {
ret void
}
int getrightchild(int rootindex) { return (2 * rootindex) + 2; }


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

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

LLVM IR (-O0):
define i32 @getrightchild(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, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @getrightchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
__attribute__((format(printf, (1), (1 + 1)))) void BUG(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @BUG(i8* nocapture %0, ...) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ subwindow;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xbutton_subwindow(void *_p) {
  return (unsigned long)((XEvent *)_p)->xbutton.subwindow;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xbutton_subwindow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xbutton_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void hclib_initStats(int nw) {}


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

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

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

LLVM IR (-O2):
define void @hclib_initStats(i32 %0) {
ret void
}