xunge/DecIR huggingface dataset:
int f(int a, int b, short c, int d, short e) {
  int i;
  for (i = 1; i <= 2; i++) {
    c -= 4;
    a = c;
    d = d + (b ? b : e);
  }
  return a + d;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jg     1177 <f+0x77>
movswl -0xa(%rbp),%eax
sub    $0x4,%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <f+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    115e <f+0x5e>
movswl -0x12(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <f+0x20>
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %esi,%esi
cmovne %esi,%r8d
add    $0xfffffff8,%edx
lea    (%rcx,%r8,2),%ecx
movswl %dx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i16 signext %2, i32 %3, i16 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i16
%9 = alloca i32
%10 = alloca i16
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i16 %2, i16* %8
store i32 %3, i32* %9
store i16 %4, i16* %10
store i32 1, i32* %11
br label %12
12: ; preds = %33, %5
%13 = load i32, i32* %11
%14 = icmp sle i32 %13, 2
br i1 %14, label %15, label %36
15: ; preds = %12
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = sub nsw i32 %17, 4
%19 = trunc i32 %18 to i16
store i16 %19, i16* %8
%20 = load i16, i16* %8
%21 = sext i16 %20 to i32
store i32 %21, i32* %6
%22 = load i32, i32* %9
%23 = load i32, i32* %7
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %15
%26 = load i32, i32* %7
br label %30
27: ; preds = %15
%28 = load i16, i16* %10
%29 = sext i16 %28 to i32
br label %30
30: ; preds = %27, %25
%31 = phi i32 [ %26, %25 ], [ %29, %27 ]
%32 = add nsw i32 %22, %31
store i32 %32, i32* %9
br label %33
33: ; preds = %30
%34 = load i32, i32* %11
%35 = add nsw i32 %34, 1
store i32 %35, i32* %11
br label %12
36: ; preds = %12
%37 = load i32, i32* %6
%38 = load i32, i32* %9
%39 = add nsw i32 %37, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i16 signext %2, i32 %3, i16 signext %4) {
%6 = icmp eq i32 %1, 0
%7 = sext i16 %4 to i32
%8 = select i1 %6, i32 %7, i32 %1
%9 = shl i32 %8, 1
%10 = add i16 %2, -8
%11 = add i32 %9, %3
%12 = sext i16 %10 to i32
%13 = add nsw i32 %11, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ breakpt();
int /*<<< orphan*/ sleep(int);
void go_child() {
  breakpt();
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<go_child>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <breakpt@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112b <go_child+0xb>

x86 assembly (clang, -O2):
<go_child>:
push   %rax
xor    %eax,%eax
call   1030 <breakpt@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <go_child+0x10>

LLVM IR (-O0):
define void @go_child() {
%1 = call i32 (...) @breakpt()
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define void @go_child() {
%1 = tail call i32 (...) @breakpt()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("*****************ODHGIES:*****************\n");
  printf("EPILEXTE: \n-eite paixth me vash to id tou\n-eite 0 gia exodo\n-eite "
         "otidhpote allo gia provolh neas kartelas.\n");
  printf("*****************ODHGIES:*****************\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
lea    0xf54(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"*****************ODHGIES:*****************\0A\00"
@.str.1 = [109 x i8] c"EPILEXTE: \0A-eite paixth me vash to id tou\0A-eite 0 gia exodo\0A-eite otidhpote allo gia provolh neas kartelas.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.2 = [108 x i8] c"EPILEXTE: \0A-eite paixth me vash to id tou\0A-eite 0 gia exodo\0A-eite otidhpote allo gia provolh neas kartelas.\00"
@str.3 = [43 x i8] c"*****************ODHGIES:*****************\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct region {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct region *);
void region_uninit(struct region *self) {
  assert(self);
  return;
}


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

x86 assembly (clang, -O2):
<region_uninit>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
%struct.region = type { i32 }
define void @region_uninit(%struct.region* %0) {
%2 = tail call i32 @assert(%struct.region* %0)
ret void
}
double user_func_0() { return 10.0; }


x86 assembly (clang, -O0):
<user_func_0>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @user_func_0() {
ret double 1.000000e+01
}

LLVM IR (-O2):
define double @user_func_0() {
ret double 1.000000e+01
}
/* Variables and functions */
int read(int, unsigned char *, unsigned int);
int leggiStream(int pfd, unsigned char *stream, unsigned int dim) {
  return (read(pfd, stream, dim) != -1);
}


x86 assembly (clang, -O0):
<leggiStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leggiStream>:
push   %rax
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @leggiStream(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
%11 = icmp ne i32 %10, -1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @leggiStream(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ MsgBox25(char const *, char const *);
void msgbox(const char *s, const char *title) { MsgBox25(s, title); }


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

x86 assembly (clang, -O2):
<msgbox>:
jmp    1030 <MsgBox25@plt>

LLVM IR (-O0):
define void @msgbox(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** %4
%7 = call i32 @MsgBox25(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @msgbox(i8* %0, i8* %1) {
%3 = tail call i32 @MsgBox25(i8* %0, i8* %1)
ret void
}
int pthread_mutex_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ direct();
int /*<<< orphan*/ indirect();
void caller() {
  direct();
  indirect();
}


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

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

LLVM IR (-O0):
define void @caller() {
%1 = call i32 (...) @direct()
%2 = call i32 (...) @indirect()
ret void
}

LLVM IR (-O2):
define void @caller() {
%1 = tail call i32 (...) @direct()
%2 = tail call i32 (...) @indirect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strstr(char *, char const *);
char *find_tag(char *desc, const char *tag, int *state) {
  char *p;
  p = strstr(desc, tag);
  if (p) {
    p += strlen(tag);
    *state = 0;
  }
  return p;
}


x86 assembly (clang, -O0):
<find_tag>:
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
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <find_tag+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_tag>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1040 <strstr@plt>
test   %rax,%rax
je     114e <find_tag+0x2e>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
movl   $0x0,(%r14)
jmp    1150 <find_tag+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @find_tag(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %1)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i32 0, i32* %2
br label %10
10: ; preds = %6, %3
%11 = phi i8* [ %9, %6 ], [ null, %3 ]
ret i8* %11
}
void uddummy() { ; }


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

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

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

LLVM IR (-O2):
define void @uddummy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_ptr;

/* Variables and functions */
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void gmp_add(mpz_ptr out, mpz_ptr in, mpz_ptr order) {
  mpz_add(out, out, in);
  if (mpz_cmp(out, order) >= 0) {
    mpz_sub(out, out, order);
  }
}


x86 assembly (clang, -O0):
<gmp_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <mpz_add@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mpz_cmp@plt>
cmp    $0x0,%rax
jl     1172 <gmp_add+0x42>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <mpz_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_add>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%edx
mov    %edi,%ebp
mov    %edi,%esi
call   1040 <mpz_add@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <mpz_cmp@plt>
test   %rax,%rax
js     115f <gmp_add+0x2f>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mpz_sub@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gmp_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @mpz_add(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = call i64 @mpz_cmp(i32 %11, i32 %12)
%14 = icmp sge i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = call i32 @mpz_sub(i32 %16, i32 %17, i32 %18)
br label %20
20: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
define void @gmp_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_add(i32 %0, i32 %0, i32 %1)
%5 = tail call i64 @mpz_cmp(i32 %0, i32 %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @mpz_sub(i32 %0, i32 %0, i32 %2)
br label %9
9: ; preds = %7, %3
ret void
}
int sum(int num) {
  static int total = 0;
  total = total + num;
  return total;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
add    -0x4(%rbp),%eax
mov    %eax,0x2f0e(%rip)
mov    0x2f08(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    %edi,%eax
add    0x2f1c(%rip),%eax
mov    %eax,0x2f16(%rip)
ret

LLVM IR (-O0):
@sum.total = internal global i32 0
define i32 @sum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @sum.total
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
store i32 %5, i32* @sum.total
%6 = load i32, i32* @sum.total
ret i32 %6
}

LLVM IR (-O2):
@sum.total = internal unnamed_addr global i32 0
define i32 @sum(i32 %0) {
%2 = load i32, i32* @sum.total
%3 = add nsw i32 %2, %0
store i32 %3, i32* @sum.total
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
pid_t fork() {
  printf(">>> fork()\n");
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c">>> fork()\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
@str = [11 x i8] c">>> fork()\00"
define i32 @fork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int nthreads, tid;
#pragma omp parallel
  {
    tid = omp_get_thread_num();
    printf("Hello World from thread = %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number of threads = %d\n", nthreads);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1182 <main+0x52>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @omp_get_thread_num()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = call i32 (...) @omp_get_num_threads()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (...) @omp_get_num_threads()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %2
ret i32 0
}
void xfrm_aalg_get_byname(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<xfrm_aalg_get_byname>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm_aalg_get_byname>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.xfrm_aalg_get_byname = [21 x i8] c"xfrm_aalg_get_byname\00"
define void @xfrm_aalg_get_byname() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.xfrm_aalg_get_byname, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.xfrm_aalg_get_byname = [21 x i8] c"xfrm_aalg_get_byname\00"
define void @xfrm_aalg_get_byname() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.xfrm_aalg_get_byname, i64 0, i64 0))
ret void
}
void XCreateFontCursor() {}


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

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

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

LLVM IR (-O2):
define void @XCreateFontCursor() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
char *memcpy(void *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s) + 1;
  void *new = malloc(len);
  if (new == NULL) {
    return NULL;
  }
  return memcpy(new, s, len);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
store i8* null, i8** %2
br label %20
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i8* @memcpy(i8* %16, i8* %17, i64 %18)
store i8* %19, i8** %2
br label %20
20: ; preds = %15, %14
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %4, i1 false)
br label %8
8: ; preds = %1, %7
ret i8* %5
}
unsigned short int
unsignedshortint_ignoring_signedlonglongint(unsigned short int x,
                                            signed long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_signedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshortint_ignoring_signedlonglongint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_signedlonglongint(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_signedlonglongint(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlLDOSleepGet(void) {
  return ((*((volatile unsigned long *)(0x400FE1B4))));
}


x86 assembly (clang, -O0):
<SysCtlLDOSleepGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe1b4,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDOSleepGet>:
mov    0x400fe1b4,%rax
40
ret

LLVM IR (-O0):
define i64 @SysCtlLDOSleepGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782644 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysCtlLDOSleepGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782644 to i64*)
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t stream_tell(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stream_tell(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
uintptr_t hash_same_fn(void *key) { return (uintptr_t)key; }


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

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

LLVM IR (-O0):
define i64 @hash_same_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @hash_same_fn(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
void C_Utils_free_long_ptr(long *item) { free(item); }


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

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

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

LLVM IR (-O2):
define void @C_Utils_free_long_ptr(i64* nocapture %0) {
%2 = tail call i32 @free(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, j, k;
  i = -1;
  j = 1;
  if (i)
    j--;
  if (j)
    i++;
  k = i * j;
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <main+0x30>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1153 <main+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void proc_end() {}


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

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

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

LLVM IR (-O2):
define void @proc_end() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
bool RingCompareLt(uint32_t a, uint32_t b) { return (int32_t)(a - b) < 0; }


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

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

LLVM IR (-O0):
define i32 @RingCompareLt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_ttl(const uint32_t ttl) {
  uint32_t time, s, m, h;
  time = ttl;
  h = time / (60 * 60);
  time %= (60 * 60);
  m = time / 60;
  time %= 60;
  s = time;
  printf("%u:%u:%u\n", h, m, s);
}


x86 assembly (clang, -O0):
<print_ttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ttl>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
lea    0xea0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%u:%u:%u\0A\00"
define void @print_ttl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 3600
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = srem i32 %10, 3600
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 60
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = srem i32 %14, 60
store i32 %15, i32* %3
%16 = load i32, i32* %3
store i32 %16, i32* %4
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%u:%u:%u\0A\00"
define void @print_ttl(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = srem i32 %0, 3600
%4 = trunc i32 %3 to i16
%5 = sdiv i16 %4, 60
%6 = sext i16 %5 to i32
%7 = srem i16 %4, 60
%8 = sext i16 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6, i32 %8)
ret void
}
/* Variables and functions */
long sizeToPages(size_t size) {
  long ret = size / 4096;
  if (size % 4096) {
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<sizeToPages>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfff,%rax
cmp    $0x0,%rax
je     1134 <sizeToPages+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeToPages>:
mov    %rdi,%rax
shr    $0xc,%rax
and    $0xfff,%edi
cmp    $0x1,%rdi
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @sizeToPages(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 4096
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = urem i64 %6, 4096
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
store i64 %11, i64* %3
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @sizeToPages(i64 %0) {
%2 = lshr i64 %0, 12
%3 = and i64 %0, 4095
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %2, %5
ret i64 %6
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int COM_StrLen(const char *str) { return (int)strlen(str); }


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

x86 assembly (clang, -O2):
<COM_StrLen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @COM_StrLen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @COM_StrLen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void le_uint8_write(void *ptr, unsigned v) {
  unsigned char *ptr8 = (unsigned char *)ptr;
  ptr8[0] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<le_uint8_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_uint8_write>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @le_uint8_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @le_uint8_write(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret void
}
void RTGetOptArgvFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTGetOptArgvFree() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_uint64(int /*<<< orphan*/, int /*<<< orphan*/);
void mpz_mul_uint64(mpz_t z, uint64_t x) {
  mpz_t aux;
  mpz_init(aux);
  mpz_set_uint64(aux, x);
  mpz_mul(z, z, aux);
  mpz_clear(aux);
}


x86 assembly (clang, -O0):
<mpz_mul_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mpz_set_uint64@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <mpz_mul@plt>
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_mul_uint64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %ebx,%esi
call   1030 <mpz_set_uint64@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <mpz_mul@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @mpz_mul_uint64(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* %5
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @mpz_set_uint64(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i32 @mpz_mul(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @mpz_clear(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mpz_mul_uint64(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_set_uint64(i32 undef, i32 %1)
%5 = tail call i32 @mpz_mul(i32 %0, i32 %0, i32 undef)
%6 = tail call i32 @mpz_clear(i32 undef)
ret void
}
int used_fn_vars(void) {
  static int svar __attribute__((used));
  auto int lvar __attribute__((used));
  return 0;
}


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

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

LLVM IR (-O0):
@used_fn_vars.svar = internal global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* @used_fn_vars.svar to i8*)], section "llvm.metadata"
define i32 @used_fn_vars() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
@used_fn_vars.svar = internal global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* @used_fn_vars.svar to i8*)], section "llvm.metadata"
define i32 @used_fn_vars() {
ret i32 0
}
int cmp_double(char *op, char *l, char *r) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmp_double(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putnbr_s(int, long);
int /*<<< orphan*/ my_putstr_to(int, char *);
void my_putnbr(int fd, long nb) {
  if (nb < 0) {
    my_putstr_to(fd, "-");
    my_putnbr_s(fd, nb);
  } else
    my_putnbr_s(fd, -nb);
}


x86 assembly (clang, -O0):
<my_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    115a <my_putnbr+0x3a>
mov    -0x4(%rbp),%edi
lea    0xebc(%rip),%rsi
call   1030 <my_putstr_to@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <my_putnbr_s@plt>
jmp    116a <my_putnbr+0x4a>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
sub    -0x10(%rbp),%rsi
call   1040 <my_putnbr_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnbr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %rsi,%rsi
js     1132 <my_putnbr+0x12>
neg    %rbx
jmp    1140 <my_putnbr+0x20>
lea    0xec7(%rip),%rsi
mov    %ebp,%edi
call   1030 <my_putstr_to@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <my_putnbr_s@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @my_putnbr(i32 %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @my_putstr_to(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = sub nsw i64 0, %1
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %7, %6 ], [ %1, %4 ]
%10 = tail call i32 @my_putnbr_s(i32 %0, i64 %9)
ret void
}
char *sw_strchr(const char *str, int c) {
  const char *p;
  p = str;
  while (*p != '\0') {
    if (*p == c) {
      return (char *)p;
    } else {
      p++;
    }
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<sw_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <sw_strchr+0x51>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <sw_strchr+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <sw_strchr+0x59>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <sw_strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <sw_strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <sw_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <sw_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @sw_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ booster_telldir(void *);
off_t telldir(void *dir) { return booster_telldir(dir); }


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

x86 assembly (clang, -O2):
<telldir>:
jmp    1030 <booster_telldir@plt>

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

LLVM IR (-O2):
define i32 @telldir(i8* %0) {
%2 = tail call i32 @booster_telldir(i8* %0)
ret i32 %2
}
int wratchet_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wratchet_init() {
ret i32 0
}
/* Variables and functions */
int part(int *, int);
void quicksort(int arr[], int n) {
  int pivndex;
  if (n <= 1)
    return;
  pivndex = part(arr, n);
  quicksort(arr, pivndex);
  quicksort(arr + pivndex + 1, n - pivndex - 1);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quicksort+0x1e>
jmp    117a <quicksort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <part@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quicksort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <part@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <quicksort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(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 = icmp sle i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %24
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 @part(i32* %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 %20, %21
%23 = sub nsw i32 %22, 1
br label %24
24: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @part(i32* %6, i32 %5)
tail call void @quicksort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
double c_cos(ang)
double ang;
{ return cos(ang); }


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

x86 assembly (clang, -O2):
<c_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @c_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}