xunge/DecIR huggingface dataset:
int thread_start() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @thread_start() {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *USB_Alloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<USB_Alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @USB_Alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int COLS;
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int strlen(char *);
void center_header(char *message) {
  move(1, (COLS - strlen(message)) / 2);
  printw(message);
  refresh();
}


x86 assembly (clang, -O0):
<center_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    $0x1,%edi
call   1060 <move@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<center_header>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
call   1030 <strlen@plt>
sub    %eax,%ebp
mov    %ebp,%esi
shr    $0x1f,%esi
add    %ebp,%esi
sar    %esi
mov    $0x1,%edi
call   1060 <move@plt>
mov    %rbx,%rdi
call   1040 <printw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@COLS = global i32 0
define void @center_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @COLS
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %3, %5
%7 = sdiv i32 %6, 2
%8 = call i32 @move(i32 1, i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @printw(i8* %9)
%11 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@COLS = global i32 0
define void @center_header(i8* %0) {
%2 = load i32, i32* @COLS
%3 = tail call i32 @strlen(i8* %0)
%4 = sub nsw i32 %2, %3
%5 = sdiv i32 %4, 2
%6 = tail call i32 @move(i32 1, i32 %5)
%7 = tail call i32 @printw(i8* %0)
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *smartoncmd(const char *path, char *cmdresult) {
  sprintf(cmdresult, "disktool -s on %s 1>/dev/null 2>/dev/null", path);
  return cmdresult;
}


x86 assembly (clang, -O0):
<smartoncmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smartoncmd>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"disktool -s on %s 1>/dev/null 2>/dev/null\00"
define i8* @smartoncmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [42 x i8] c"disktool -s on %s 1>/dev/null 2>/dev/null\00"
define i8* @smartoncmd(i8* %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %1
}
void a64_translate_init(struct uc_struct *uc) {}


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

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

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

LLVM IR (-O2):
%struct.uc_struct = type opaque
define void @a64_translate_init(%struct.uc_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, int, int, int);
void main(void) { hanoi(3, 1, 3, 2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
jmp    1030 <hanoi@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @hanoi(i32 3, i32 1, i32 3, i32 2)
ret void
}
int bar(int x) { return x + 100; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 100
ret i32 %2
}
/* Variables and functions */
unsigned short atomic_decrement_val(unsigned short volatile *);
unsigned short atomic_dec_ushort_nv(volatile unsigned short *target) {
  return atomic_decrement_val(target) - 1;
}


x86 assembly (clang, -O0):
<atomic_dec_ushort_nv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atomic_decrement_val@plt>
movzwl %ax,%eax
sub    $0x1,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_dec_ushort_nv>:
push   %rax
call   1030 <atomic_decrement_val@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @atomic_dec_ushort_nv(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call zeroext i16 @atomic_decrement_val(i16* %3)
%5 = zext i16 %4 to i32
%6 = sub nsw i32 %5, 1
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @atomic_dec_ushort_nv(i16* %0) {
%2 = tail call zeroext i16 @atomic_decrement_val(i16* %0)
%3 = add i16 %2, -1
ret i16 %3
}
char nor_op(char a, char b) { return a == 0 && b == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<nor_op>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
jne    112f <nor_op+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nor_op>:
or     %dil,%sil
sete   %al
ret

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

LLVM IR (-O2):
define signext i8 @nor_op(i8 signext %0, i8 signext %1) {
%3 = or i8 %1, %0
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int t;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > y) {
    t = x;
    x = y;
    y = t;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1156 <main+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %2
store i32 %12, i32* %4
%13 = load i32, i32* %3
store i32 %13, i32* %2
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @shutdown() {
ret void
}
/* Variables and functions */
char *kmp_search(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[] = "abdefghijk";
  printf("%s\n", kmp_search(s, "def"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <kmp_search@plt>
mov    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6968676665646261,%rax
67 68 69
mov    %rax,0x8(%rsp)
movl   $0x6b6a69,0xf(%rsp)
lea    0xecd(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <kmp_search@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"abdefghijk\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"def\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = bitcast [11 x i8]* %1 to i8*
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = call i8* @kmp_search(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"abdefghijk\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"def\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i8* @kmp_search(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
struct group *getgrnam(char const *);
struct group *sys_getgrnam(const char *name) {
  return getgrnam(name);
}


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

x86 assembly (clang, -O2):
<sys_getgrnam>:
jmp    1030 <getgrnam@plt>

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

LLVM IR (-O2):
%struct.group = type { i32 }
define %struct.group* @sys_getgrnam(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
ret %struct.group* %2
}
/* Variables and functions */
int /*<<< orphan*/ client_sleep(int);
scalar_t__ comm_rank();
int /*<<< orphan*/ ibarrier_begin(int /*<<< orphan*/);
int /*<<< orphan*/ ibarrier_done();
int /*<<< orphan*/ mpi_world();
void lazy_barrier(void) {
  ibarrier_begin(mpi_world());
  while (!ibarrier_done())
    if (comm_rank() != 0)
      client_sleep(50);
}


x86 assembly (clang, -O0):
<lazy_barrier>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpi_world@plt>
mov    %eax,%edi
call   1070 <ibarrier_begin@plt>
mov    $0x0,%al
call   1060 <ibarrier_done@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117e <lazy_barrier+0x2e>
jmp    119e <lazy_barrier+0x4e>
mov    $0x0,%al
call   1040 <comm_rank@plt>
cmp    $0x0,%rax
je     1199 <lazy_barrier+0x49>
mov    $0x32,%edi
call   1050 <client_sleep@plt>
jmp    1162 <lazy_barrier+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lazy_barrier>:
push   %rax
xor    %eax,%eax
call   1030 <mpi_world@plt>
mov    %eax,%edi
call   1070 <ibarrier_begin@plt>
nop
xor    %eax,%eax
call   1060 <ibarrier_done@plt>
test   %eax,%eax
jne    1183 <lazy_barrier+0x33>
xor    %eax,%eax
call   1040 <comm_rank@plt>
test   %rax,%rax
je     1160 <lazy_barrier+0x10>
mov    $0x32,%edi
call   1050 <client_sleep@plt>
jmp    1160 <lazy_barrier+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @lazy_barrier() {
%1 = call i32 (...) @mpi_world()
%2 = call i32 @ibarrier_begin(i32 %1)
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @ibarrier_done()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = call i64 (...) @comm_rank()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @client_sleep(i32 50)
br label %12
12: ; preds = %10, %7
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lazy_barrier() {
%1 = tail call i32 (...) @mpi_world()
%2 = tail call i32 @ibarrier_begin(i32 %1)
%3 = tail call i32 (...) @ibarrier_done()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = tail call i64 (...) @comm_rank()
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @client_sleep(i32 50)
br label %10
10: ; preds = %8, %5
%11 = tail call i32 (...) @ibarrier_done()
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret void
}
void __attribute__((no)) HEX00_sequtilsInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_sequtilsInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ adjust_xy(short *, short *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  short x = 1, y = 1;
  adjust_xy(&x, &y);
  if (x != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movw   $0x1,-0x8(%rbp)
lea    -0x6(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <adjust_xy@plt>
movswl -0x6(%rbp),%eax
cmp    $0x1,%eax
je     116c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x1,0x4(%rsp)
movw   $0x1,0x6(%rsp)
lea    0x4(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1040 <adjust_xy@plt>
cmpw   $0x1,0x4(%rsp)
jne    115d <main+0x2d>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 1, i16* %2
store i16 1, i16* %3
%4 = call i32 @adjust_xy(i16* %2, i16* %3)
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = bitcast i16* %1 to i8*
store i16 1, i16* %1
%4 = bitcast i16* %2 to i8*
store i16 1, i16* %2
%5 = call i32 @adjust_xy(i16* %1, i16* %2)
%6 = load i16, i16* %1
%7 = icmp eq i16 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_high() {
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (2 << 9) | (2 << 5) | (2)));
  delay(100);
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (2 << 9) | (2 << 5) | (2)));
  delay(100);
  mbus_remote_register_write(0x7, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (1 << 13) | (2 << 9) | (2 << 5) | (6)));
  delay(100 * 10);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_high>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2442,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2442,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe446,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_high>:
push   %rax
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2442,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2442,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe446,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_high() {
%1 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 9282)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 9282)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 7, i32 21, i32 58438)
%6 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_high() {
%1 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 9282)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 9282)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 7, i32 21, i32 58438)
%6 = tail call i32 @delay(i32 1000)
ret void
}
/* Variables and functions */
size_t utf8_charcount(const char *str) {
  unsigned count = 0;
  while (*str++)
    if ((*str & 0xC0) != 0x80)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<utf8_charcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     114c <utf8_charcount+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1147 <utf8_charcount+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <utf8_charcount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_charcount>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     112d <utf8_charcount+0x2d>
add    $0x1,%rdi
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xc0,%dl
xor    %esi,%esi
cmp    $0x80,%dl
setne  %sil
add    %esi,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utf8_charcount+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @utf8_charcount(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = and i8 %8, -64
%10 = icmp ne i8 %9, -128
%11 = zext i1 %10 to i32
%12 = add i32 %6, %11
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = zext i32 %12 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
int ft_recursive_factorial(int nb) {
  if ((nb == 1) || (nb == 0))
    return (1);
  if ((nb < 0) || (nb > 12))
    return (0);
  else
    return (nb * ft_recursive_factorial(nb - 1));
}


x86 assembly (clang, -O0):
<ft_recursive_factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <ft_recursive_factorial+0x1f>
cmpl   $0x0,-0x8(%rbp)
jne    113b <ft_recursive_factorial+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1177 <ft_recursive_factorial+0x67>
cmpl   $0x0,-0x8(%rbp)
jl     114f <ft_recursive_factorial+0x3f>
cmpl   $0xc,-0x8(%rbp)
jle    115b <ft_recursive_factorial+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1177 <ft_recursive_factorial+0x67>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_recursive_factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_recursive_factorial>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     113e <ft_recursive_factorial+0x3e>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0xc,%edi
ja     1139 <ft_recursive_factorial+0x39>
imul   %ecx,%eax
lea    -0x1(%rcx),%edx
mov    %edx,%ecx
cmp    $0x1,%edx
ja     1120 <ft_recursive_factorial+0x20>
mov    $0x1,%ecx
jmp    113b <ft_recursive_factorial+0x3b>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_recursive_factorial(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 12
br label %5
5: ; preds = %3, %8
%6 = phi i32 [ %9, %8 ], [ %0, %3 ]
%7 = phi i32 [ %10, %8 ], [ 1, %3 ]
br i1 %4, label %12, label %8
8: ; preds = %5
%9 = add nsw i32 %6, -1
%10 = mul nsw i32 %6, %7
%11 = icmp ult i32 %9, 2
br i1 %11, label %12, label %5
12: ; preds = %5, %8
%13 = phi i32 [ %10, %8 ], [ %7, %5 ]
%14 = phi i32 [ 1, %8 ], [ 0, %5 ]
%15 = mul nuw nsw i32 %14, %13
br label %16
16: ; preds = %12, %1
%17 = phi i32 [ %15, %12 ], [ 1, %1 ]
ret i32 %17
}
int calculate_gcd(int a, int b) {
  int temp;
  if (b > a) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  while (b > 0) {
    temp = a;
    a = b;
    b = temp % b;
  }
  return a;
}


x86 assembly (clang, -O0):
<calculate_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1131 <calculate_gcd+0x31>
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <calculate_gcd+0x36>
cmpl   $0x0,-0x8(%rbp)
jle    115b <calculate_gcd+0x5b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    1136 <calculate_gcd+0x36>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_gcd>:
mov    %edi,%eax
cmp    %edi,%esi
mov    %esi,%edx
cmovg  %edi,%edx
cmovg  %esi,%eax
test   %edx,%edx
jle    111d <calculate_gcd+0x1d>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <calculate_gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calculate_gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = xor i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = xor i32 %17, %16
store i32 %18, i32* %3
br label %19
19: ; preds = %9, %2
br label %20
20: ; preds = %23, %19
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %3
store i32 %24, i32* %5
%25 = load i32, i32* %4
store i32 %25, i32* %3
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = srem i32 %26, %27
store i32 %28, i32* %4
br label %20
29: ; preds = %20
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @calculate_gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ %5, %2 ]
%9 = phi i32 [ %10, %7 ], [ %4, %2 ]
%10 = srem i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
%13 = phi i32 [ %5, %2 ], [ %9, %7 ]
ret i32 %13
}
void test_two(int x, int y) {
#pragma omp target teams distribute
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
unsigned int NoSoundDrv_MIDI_GetTick(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NoSoundDrv_MIDI_GetTick() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_socket(int fd) { close(fd); }


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

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

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

LLVM IR (-O2):
define void @close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i = 0;
  assert(i == 1);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_options(int, char **);
int main(int argc, char *argv[]) {
  gmx_options(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_options(i32 %0, i8** %1)
ret i32 0
}
int i4(int *base) { return base[00000000]; }


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

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

LLVM IR (-O0):
define i32 @i4(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @i4(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/);
void put(const char *s) {
  while (*s)
    putc(*s++);
}


x86 assembly (clang, -O0):
<put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <put+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <put+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int compare(const void *pa, const void *pb) {
  if (*(int *)pa < *(int *)pb)
    return -1;
  if (*(int *)pa > *(int *)pb)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <compare+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <compare+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int mk_blocks(int n, int threads) {
  return (n + (threads * 2 - 1)) / (threads * 2);
}


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

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

LLVM IR (-O0):
define i32 @mk_blocks(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 = mul nsw i32 %6, 2
%8 = sub nsw i32 %7, 1
%9 = add nsw i32 %5, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 2
%12 = sdiv i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mk_blocks(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = sdiv i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void colorGrn() { printf("%s", "\x1B[32m"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
define void @colorGrn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
define void @colorGrn() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int double_free() {
  volatile int *x = malloc(sizeof(int));
  *x = 12;
  free((int *)x);
  free((int *)x);
  return 1;
}


x86 assembly (clang, -O0):
<double_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_free>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0xc,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @double_free() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store volatile i32 12, i32* %3
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
%6 = load i32*, i32** %1
%7 = call i32 @free(i32* %6)
ret i32 1
}

LLVM IR (-O2):
define i32 @double_free() {
%1 = tail call i32* @malloc(i32 4)
store volatile i32 12, i32* %1
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret i32 1
}
eoln(c) { return (c < 0 || c == '\n' || c == '\r'); }


x86 assembly (clang, -O0):
<eoln>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112f <eoln+0x2f>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <eoln+0x2f>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoln>:
test   %edi,%edi
sets   %al
cmp    $0xa,%edi
sete   %cl
or     %al,%cl
cmp    $0xd,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @eoln(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = icmp eq i32 %0, 10
%4 = or i1 %2, %3
%5 = icmp eq i32 %0, 13
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
__attribute__((no, noclone)) unsigned __int128 t100_4add(signed char x) {
  signed char y = (0);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movsbq -0x12(%rbp),%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
add    %rcx,%rdx
mov    %r9,%rcx
adc    %rax,%rcx
mov    %r9,%r8
adc    %rax,%r8
adc    %rax,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    1181 <t100_4add+0x71>
jmp    1188 <t100_4add+0x78>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
movslq %edi,%rax
sar    $0x3f,%rax
je     1123 <t100_4add+0x13>
xor    %eax,%eax
call   1030 <bar@plt>
movsbq %bl,%rax
mov    %eax,%ecx
sar    $0x7,%cl
movsbq %cl,%rdx
pop    %rbx
ret

LLVM IR (-O0):
define { i64, i64 } @t100_4add(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i8
%5 = alloca i128
store i8 %0, i8* %3
store i8 0, i8* %4
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = sext i8 %6 to i129
%9 = sext i8 %7 to i129
%10 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %8, i129 %9)
%11 = extractvalue { i129, i1 } %10, 1
%12 = extractvalue { i129, i1 } %10, 0
%13 = trunc i129 %12 to i128
%14 = zext i128 %13 to i129
%15 = icmp ne i129 %12, %14
%16 = or i1 %11, %15
store i128 %13, i128* %5
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %1
%20 = load i128, i128* %5
store i128 %20, i128* %2
%21 = bitcast i128* %2 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t100_4add(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = sext i8 %0 to i128
%4 = zext i128 %3 to i129
%5 = icmp eq i129 %2, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @bar()
br label %8
8: ; preds = %6, %1
%9 = sext i8 %0 to i64
%10 = ashr i8 %0, 7
%11 = sext i8 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(double *Array, int Lo, int High) {
  int ArrayLength;
  ArrayLength = High - Lo + 1;
  free((char *)(Array + Lo - 1));
}


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = getelementptr inbounds double, double* %15, i64 -1
%17 = bitcast double* %16 to i8*
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = getelementptr inbounds double, double* %5, i64 -1
%7 = bitcast double* %6 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
}
int test_imm_4Cuint16_reg(unsigned short val) {
  return ((val) & (0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cuint16_reg>:
test   $0x4c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 76
%6 = icmp ne i32 %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_4Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 76
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct crypt_cipher {
  int dummy;
};

/* Variables and functions */
int ENOTSUP;
int crypt_cipher_init(struct crypt_cipher **ctx, const char *name,
                      const char *mode, const void *buffer, size_t length) {
  return -ENOTSUP;
}


x86 assembly (clang, -O0):
<crypt_cipher_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.crypt_cipher = type { i32 }
@ENOTSUP = global i32 0
define i32 @crypt_cipher_init(%struct.crypt_cipher** %0, i8* %1, i8* %2, i8* %3, i64 %4) {
%6 = alloca %struct.crypt_cipher**
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
store %struct.crypt_cipher** %0, %struct.crypt_cipher*** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @ENOTSUP
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
%struct.crypt_cipher = type { i32 }
@ENOTSUP = global i32 0
define i32 @crypt_cipher_init(%struct.crypt_cipher** nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i64 %4) {
%6 = load i32, i32* @ENOTSUP
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Type definitions */
struct ath9k_htc_priv {
  int dummy;
};

/* Variables and functions */
void ath9k_tx_cleanup(struct ath9k_htc_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.ath9k_htc_priv = type { i32 }
define void @ath9k_tx_cleanup(%struct.ath9k_htc_priv* nocapture %0) {
ret void
}
unsigned long MathNextMultiple8(unsigned long v) {
  unsigned long i = v % 8;
  return i == 0 ? v : v + 8 - i;
}


x86 assembly (clang, -O0):
<MathNextMultiple8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <MathNextMultiple8+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113c <MathNextMultiple8+0x3c>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MathNextMultiple8>:
lea    0x8(%rdi),%rax
and    $0xfffffffffffffff8,%rax
test   $0x7,%dil
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @MathNextMultiple8(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 8
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %15
10: ; preds = %1
%11 = load i64, i64* %2
%12 = add i64 %11, 8
%13 = load i64, i64* %3
%14 = sub i64 %12, %13
br label %15
15: ; preds = %10, %8
%16 = phi i64 [ %9, %8 ], [ %14, %10 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @MathNextMultiple8(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = add i64 %0, 8
%5 = and i64 %4, -8
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}