xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void term_save_cursor(void) { fprintf(stdout, "\033[s\033[?25l"); }


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"\1B[s\1B[?25l\00"
define void @term_save_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"\1B[s\1B[?25l\00"
define void @term_save_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void if_err_exit(int ret) {
  if (ret == -1) {
    printf(" memctl_ERROR: [%d] exit program ...\n", ret);
    exit(ret);
  }
}


x86 assembly (clang, -O0):
<if_err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    114c <if_err_exit+0x2c>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_err_exit>:
cmp    $0xffffffff,%edi
je     1126 <if_err_exit+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c" memctl_ERROR: [%d] exit program ...\0A\00"
define void @if_err_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c" memctl_ERROR: [%d] exit program ...\0A\00"
define void @if_err_exit(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 -1)
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
ret void
}
void tex_reset_color(void) {}


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

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

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

LLVM IR (-O2):
define void @tex_reset_color() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
int tabovf(char *string) {
  fatal("%s overflow", string);
  return 0;
}


x86 assembly (clang, -O0):
<tabovf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabovf>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s overflow\00"
define i32 @tabovf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s overflow\00"
define i32 @tabovf(i8* %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: hawk -i <id> -p <password> -H <host> -P <path> [-M <method>] "
         "[-O port] [-a <algorithm>] [-e <ext>] [-o <offset>] [-hv]\n");
}


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

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

LLVM IR (-O0):
@.str = [127 x i8] c"Usage: hawk -i <id> -p <password> -H <host> -P <path> [-M <method>] [-O port] [-a <algorithm>] [-e <ext>] [-o <offset>] [-hv]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [126 x i8] c"Usage: hawk -i <id> -p <password> -H <host> -P <path> [-M <method>] [-O port] [-a <algorithm>] [-e <ext>] [-o <offset>] [-hv]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cnt_deque_iterator {
  int dummy;
};
struct cnt_deque {
  int dummy;
};

/* Variables and functions */
struct cnt_deque_iterator *cnt_deque_iterator_both(struct cnt_deque const *,
                                                   int);
struct cnt_deque_iterator *cnt_deque_iterator_new(const struct cnt_deque *cnd) {
  return cnt_deque_iterator_both(cnd, 1);
}


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

x86 assembly (clang, -O2):
<cnt_deque_iterator_new>:
mov    $0x1,%esi
jmp    1030 <cnt_deque_iterator_both@plt>

LLVM IR (-O0):
%struct.cnt_deque_iterator = type { i32 }
%struct.cnt_deque = type { i32 }
define %struct.cnt_deque_iterator* @cnt_deque_iterator_new(%struct.cnt_deque* %0) {
%2 = alloca %struct.cnt_deque*
store %struct.cnt_deque* %0, %struct.cnt_deque** %2
%3 = load %struct.cnt_deque*, %struct.cnt_deque** %2
%4 = call %struct.cnt_deque_iterator* @cnt_deque_iterator_both(%struct.cnt_deque* %3, i32 1)
ret %struct.cnt_deque_iterator* %4
}

LLVM IR (-O2):
%struct.cnt_deque_iterator = type { i32 }
%struct.cnt_deque = type { i32 }
define %struct.cnt_deque_iterator* @cnt_deque_iterator_new(%struct.cnt_deque* %0) {
%2 = tail call %struct.cnt_deque_iterator* @cnt_deque_iterator_both(%struct.cnt_deque* %0, i32 1)
ret %struct.cnt_deque_iterator* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strdup(char *);
char *stringtosend() {
  char *tosend;
  tosend = (char *)malloc(sizeof(char) * 512);
  tosend = strdup("this is a test");
  return tosend;
}


x86 assembly (clang, -O0):
<stringtosend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x200,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringtosend>:
push   %rax
mov    $0x200,%edi
call   1030 <malloc@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"this is a test\00"
define i8* @stringtosend() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 512)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i8* @strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [15 x i8] c"this is a test\00"
define noalias i8* @stringtosend() {
%1 = tail call i64 @malloc(i32 512)
%2 = tail call dereferenceable_or_null(15) i8* @strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void atomicYield() { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @atomicYield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int f2(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  f1();
  c = f2(1, 2);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f2@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 @f2(i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void rop3_2_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_2_1_0>:
not    %dl
or     %sil,%dl
and    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_2_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, -1
%6 = or i8 %5, %1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int get_voluntary_ctxt_switches(int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
void wait_for_thread_to_wait_in_kernel(pthread_t tid,
                                       int context_switch_count) {
  while (get_voluntary_ctxt_switches(tid) <= context_switch_count) {
    usleep(10);
  }
}


x86 assembly (clang, -O0):
<wait_for_thread_to_wait_in_kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_voluntary_ctxt_switches@plt>
cmp    -0x8(%rbp),%eax
jg     114e <wait_for_thread_to_wait_in_kernel+0x2e>
mov    $0xa,%edi
call   1040 <usleep@plt>
jmp    112e <wait_for_thread_to_wait_in_kernel+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_thread_to_wait_in_kernel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
call   1030 <get_voluntary_ctxt_switches@plt>
cmp    %ebx,%eax
jg     1147 <wait_for_thread_to_wait_in_kernel+0x27>
mov    $0xa,%edi
call   1040 <usleep@plt>
mov    %ebp,%edi
jmp    1130 <wait_for_thread_to_wait_in_kernel+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @wait_for_thread_to_wait_in_kernel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %10, %2
%6 = load i32, i32* %3
%7 = call i32 @get_voluntary_ctxt_switches(i32 %6)
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = call i32 @usleep(i32 10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_for_thread_to_wait_in_kernel(i32 %0, i32 %1) {
%3 = tail call i32 @get_voluntary_ctxt_switches(i32 %0)
%4 = icmp sgt i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 @usleep(i32 10)
%7 = tail call i32 @get_voluntary_ctxt_switches(i32 %0)
%8 = icmp sgt i32 %7, %1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
ret void
}
unsigned long _dl_elf_hash(const char *name) {
  unsigned long hash = 0;
  unsigned long tmp;
  while (*name) {
    hash = (hash << 4) + *name++;
    if ((tmp = hash & 0xf0000000))
      hash ^= tmp >> 24;
    hash &= ~tmp;
  };
  return hash;
}


x86 assembly (clang, -O0):
<_dl_elf_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <_dl_elf_hash+0x80>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <_dl_elf_hash+0x6b>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_dl_elf_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_elf_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113e <_dl_elf_hash+0x3e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movsbq %cl,%rcx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_dl_elf_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_dl_elf_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %16, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
void makeBar(float vals, float labels) {}


x86 assembly (clang, -O0):
<makeBar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @makeBar(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret void
}

LLVM IR (-O2):
define void @makeBar(float %0, float %1) {
ret void
}
/* Variables and functions */
unsigned char *haval256_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_haval256(unsigned char *out, const unsigned char *in,
                                    size_t in_len) {
  return haval256_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_haval256>:
jmp    1030 <haval256_buffer@plt>

LLVM IR (-O0):
define i8* @hash_buffer_haval256(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 i8* @haval256_buffer(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @hash_buffer_haval256(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @haval256_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
char *mangle_deserialize(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
char *mangle_deserialize_str(char *a_sdata, char *a_output) {
  return mangle_deserialize(a_sdata, strlen(a_sdata), a_output);
}


x86 assembly (clang, -O0):
<mangle_deserialize_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <mangle_deserialize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mangle_deserialize_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mangle_deserialize@plt>

LLVM IR (-O0):
define i8* @mangle_deserialize_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @mangle_deserialize(i8* %5, i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @mangle_deserialize_str(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @mangle_deserialize(i8* %0, i32 %3, i8* %1)
ret i8* %4
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_15(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x1D, 0x12, 0x11, 0x0D, 0x1E, 0x19, 0x16, 0x1B, 0x18, 0x13, 0x07,
      0x17, 0x0C, 0x02, 0x00, 0x15, 0x0E, 0x08, 0x05, 0x01, 0x10, 0x06,
      0x04, 0x0F, 0x1F, 0x1A, 0x0B, 0x09, 0x0A, 0x14, 0x1C, 0x03,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_15>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_15.LUT = internal global [32 x i8] c"\1D\12\11\0D\1E\19\16\1B\18\13\07\17\0C\02\00\15\0E\08\05\01\10\06\04\0F\1F\1A\0B\09\0A\14\1C\03"
define i32 @yahoo_f01_15(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 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_15.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_15.LUT = internal global [32 x i8] c"\1D\12\11\0D\1E\19\16\1B\18\13\07\17\0C\02\00\15\0E\08\05\01\10\06\04\0F\1F\1A\0B\09\0A\14\1C\03"
define i32 @yahoo_f01_15(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_15.LUT, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "usage: %s mountpoint [options] \n"
          "Options:\n"
          "    -d      enable debug output\n"
          "    -s      disable multithreaded operation\n"
          "    -h      print help\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [141 x i8] c"usage: %s mountpoint [options] \0AOptions:\0A -d enable debug output\0A -s disable multithreaded operation\0A -h print help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [141 x i8] c"usage: %s mountpoint [options] \0AOptions:\0A -d enable debug output\0A -s disable multithreaded operation\0A -h print help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rol32(uint32_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (32 - rotation)));
}


x86 assembly (clang, -O0):
<rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol32>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void setpwent() {}


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

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

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

LLVM IR (-O2):
define void @setpwent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ triton_event_fire(int, int /*<<< orphan*/ *);
void config_reload_notify(int r) {
  if (!r)
    triton_event_fire(11, NULL);
}


x86 assembly (clang, -O0):
<config_reload_notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1133 <config_reload_notify+0x23>
mov    $0xb,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <triton_event_fire@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_reload_notify>:
test   %edi,%edi
je     1115 <config_reload_notify+0x5>
ret
mov    $0xb,%edi
xor    %esi,%esi
jmp    1030 <triton_event_fire@plt>

LLVM IR (-O0):
define void @config_reload_notify(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @triton_event_fire(i32 11, i32* null)
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @config_reload_notify(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @triton_event_fire(i32 11, i32* null)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t IRoundf(float x) { return (int32_t)(x >= 0.0f ? x + 0.5f : x - 0.5f); }


x86 assembly (clang, -O0):
<IRoundf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <IRoundf+0x31>
movss  0xede(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1147 <IRoundf+0x47>
movss  -0x4(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRoundf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @IRoundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fadd float %6, 5.000000e-01
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fsub float %9, 5.000000e-01
br label %11
11: ; preds = %8, %5
%12 = phi float [ %7, %5 ], [ %10, %8 ]
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @IRoundf(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 5.000000e-01, float -5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct iio_context *iio_create_network_context(const char *hostname) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<iio_create_network_context>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iio_create_network_context>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.iio_context* @iio_create_network_context(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.iio_context* null
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.iio_context* @iio_create_network_context(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.iio_context* null
}
int ispunct(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
ret i32 0
}
int PROC(void) {
  printf("running: %s\n", __FUNCTION__);
  glFoo();
  glBar();
  glBaz();
  return 0;
}


x86 assembly (clang, -O0):
<PROC>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <glFoo@plt>
mov    $0x0,%al
call   1050 <glBar@plt>
mov    $0x0,%al
call   1060 <glBaz@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PROC>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xebe(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <glFoo@plt>
xor    %eax,%eax
call   1050 <glBar@plt>
xor    %eax,%eax
call   1060 <glBaz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"running: %s\0A\00"
@__FUNCTION__.PROC = [5 x i8] c"PROC\00"
define i32 @PROC() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.PROC, i64 0, i64 0))
%2 = call i32 (...) @glFoo()
%3 = call i32 (...) @glBar()
%4 = call i32 (...) @glBaz()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"running: %s\0A\00"
@__FUNCTION__.PROC = [5 x i8] c"PROC\00"
define i32 @PROC() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.PROC, i64 0, i64 0))
%2 = tail call i32 (...) @glFoo()
%3 = tail call i32 (...) @glBar()
%4 = tail call i32 (...) @glBaz()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
struct stat *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stat(char *, struct stat *);
int main() {
  char *fd = "myfile.txt";
  struct stat *buf;
  buf = malloc(sizeof(struct stat));
  stat(fd, buf);
  int size = buf->st_size;
  printf("%d", size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <stat@plt>
mov    (%rbx),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [11 x i8] c"myfile.txt\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca %struct.stat*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = call %struct.stat* @malloc(i32 4)
store %struct.stat* %5, %struct.stat** %3
%6 = load i8*, i8** %2
%7 = load %struct.stat*, %struct.stat** %3
%8 = call i32 @stat(i8* %6, %struct.stat* %7)
%9 = load %struct.stat*, %struct.stat** %3
%10 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [11 x i8] c"myfile.txt\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call %struct.stat* @malloc(i32 4)
%2 = tail call i32 @stat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%3 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void DelayMs(volatile unsigned int t) {
  unsigned int i, n;
  for (n = 0; n < t; n++) {
    for (i = 0; i < 800; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<DelayMs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jae    1156 <DelayMs+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0x320,-0x8(%rbp)
jae    1143 <DelayMs+0x43>
jmp    1135 <DelayMs+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <DelayMs+0x23>
jmp    1148 <DelayMs+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <DelayMs+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DelayMs>:
mov    %edi,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     1119 <DelayMs+0x19>
xor    %eax,%eax
nopl   (%rax)
add    $0x1,%eax
cmp    -0x4(%rsp),%eax
jb     1110 <DelayMs+0x10>
ret

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

LLVM IR (-O2):
define void @DelayMs(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ 0, %1 ]
%7 = add nuw i32 %6, 1
%8 = load volatile i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int strlen(char *);
char *strstr(char *, char *);
int indexOf(char *s, char *sub, int start, int end) {
  char *result = strstr(s, sub);
  int position = result - s;
  int substringLength = strlen(s) - position;
  return position;
}


x86 assembly (clang, -O0):
<indexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strstr@plt>
mov    %rax,%rbx
sub    %r14d,%ebx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @indexOf(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i8* @strstr(i8* %12, i8* %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
%16 = load i8*, i8** %5
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %10
%21 = load i8*, i8** %5
%22 = call i32 @strlen(i8* %21)
%23 = load i32, i32* %10
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %11
%25 = load i32, i32* %10
ret i32 %25
}

LLVM IR (-O2):
define i32 @indexOf(i8* %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 @strlen(i8* %0)
ret i32 %9
}
_Complex long double test_csqrtl(_Complex long double x) {
  return __builtin_csqrtl(x);
}


x86 assembly (clang, -O0):
<test_csqrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <csqrtl@plt>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csqrtl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fxch   %st(1)
fstpt  0x20(%rsp)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <csqrtl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @test_csqrtl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call { x86_fp80, x86_fp80 } @csqrtl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @test_csqrtl({ x86_fp80, x86_fp80 }* nocapture 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, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = tail call { x86_fp80, x86_fp80 } @csqrtl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
ret { x86_fp80, x86_fp80 } %9
}
void *mem_create(char *bytes, unsigned long len) {
  void *tmp = (void *)malloc(len + sizeof(unsigned long));
  ((unsigned long *)tmp)[0] = len;
  memcpy((char *)tmp + sizeof(unsigned long), (void *)bytes, len);
  return ((char *)tmp + sizeof(unsigned long));
}


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

x86 assembly (clang, -O2):
<mem_create>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rbx,(%rax)
lea    0x8(%rax),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @mem_create(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 8
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i64*
%12 = getelementptr inbounds i64, i64* %11, i64 0
store i64 %9, i64* %12
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 8
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 8
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @mem_create(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, 8
%4 = tail call i8* @malloc(i64 %3)
%5 = bitcast i8* %4 to i64*
store i64 %1, i64* %5
%6 = getelementptr inbounds i8, i8* %4, i64 8
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %1, i1 false)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ simplificar(int, int);
void div(int n1, int d1, int n2, int d2) {
  int n = n1 * d2;
  int d = n2 * d1;
  printf("%d/%d = ", n, d);
  simplificar(n, d);
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <simplificar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
imul   %ecx,%ebp
imul   %edx,%ebx
lea    0xecc(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <simplificar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d/%d = \00"
define void @div(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = call i32 @simplificar(i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d/%d = \00"
define void @div(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = mul nsw i32 %2, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @simplificar(i32 %5, i32 %6)
ret void
}
void lf4(void) {}


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

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

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

LLVM IR (-O2):
define void @lf4() {
ret void
}
void testfunc_01(volatile const short *ap, volatile short *bp) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
<testfunc_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x12(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_01>:
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0x12(%rsi)
movzwl 0x32(%rdi),%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_01(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 15
%7 = load volatile i16, i16* %6
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i64 0
store volatile i16 %7, i16* %9
%10 = load i16*, i16** %3
%11 = getelementptr inbounds i16, i16* %10, i64 5
%12 = load volatile i16, i16* %11
%13 = load i16*, i16** %4
%14 = getelementptr inbounds i16, i16* %13, i64 2
store volatile i16 %12, i16* %14
%15 = load i16*, i16** %3
%16 = getelementptr inbounds i16, i16* %15, i64 7
%17 = load volatile i16, i16* %16
%18 = load i16*, i16** %4
%19 = getelementptr inbounds i16, i16* %18, i64 9
store volatile i16 %17, i16* %19
%20 = load i16*, i16** %3
%21 = getelementptr inbounds i16, i16* %20, i64 25
%22 = load volatile i16, i16* %21
%23 = load i16*, i16** %4
%24 = getelementptr inbounds i16, i16* %23, i64 0
store volatile i16 %22, i16* %24
ret void
}

LLVM IR (-O2):
define void @testfunc_01(i16* %0, i16* %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 15
%4 = load volatile i16, i16* %3
store volatile i16 %4, i16* %1
%5 = getelementptr inbounds i16, i16* %0, i64 5
%6 = load volatile i16, i16* %5
%7 = getelementptr inbounds i16, i16* %1, i64 2
store volatile i16 %6, i16* %7
%8 = getelementptr inbounds i16, i16* %0, i64 7
%9 = load volatile i16, i16* %8
%10 = getelementptr inbounds i16, i16* %1, i64 9
store volatile i16 %9, i16* %10
%11 = getelementptr inbounds i16, i16* %0, i64 25
%12 = load volatile i16, i16* %11
store volatile i16 %12, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void floats_mat44_identity(float out[16]) {
  memset(out, 0, 16 * sizeof(float));
  out[0] = 1;
  out[5] = 1;
  out[10] = 1;
  out[15] = 1;
}


x86 assembly (clang, -O0):
<floats_mat44_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movss  0xec8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xeb8(%rip),%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0xea7(%rip),%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movss  0xe96(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat44_identity>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x3f800000,(%rbx)
movl   $0x3f800000,0x14(%rbx)
movl   $0x3f800000,0x28(%rbx)
movl   $0x3f800000,0x3c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @floats_mat44_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 64)
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
store float 1.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 5
store float 1.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 10
store float 1.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 15
store float 1.000000e+00, float* %12
ret void
}

LLVM IR (-O2):
define void @floats_mat44_identity(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
store float 1.000000e+00, float* %0
%3 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %5
ret void
}