xunge/DecIR huggingface dataset:
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_xor(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b ^ a);
}


x86 assembly (clang, -O0):
<forf_proc_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    -0x10(%rbp),%rsi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_xor(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = xor i64 %10, %11
%13 = call i32 @forf_push_num(%struct.forf_env* %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_xor(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = xor i64 %3, %2
%5 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %4)
ret void
}
/* Variables and functions */
unsigned int genrand_int32();
unsigned int mt_rand(unsigned int min, unsigned int max) {
  return (genrand_int32() % (max - min + 1)) + min;
}


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

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

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

LLVM IR (-O2):
define i32 @mt_rand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @genrand_int32()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = urem i32 %3, %5
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
void putc(int c) {}


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

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

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

LLVM IR (-O2):
define void @putc(i32 %0) {
ret void
}
/* Variables and functions */
char *out_ch(char *buf, char *end, char ch) {
  if (buf >= end)
    return NULL;
  *buf++ = ch;
  return buf;
}


x86 assembly (clang, -O0):
<out_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     112c <out_ch+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1148 <out_ch+0x48>
mov    -0x19(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_ch>:
cmp    %rsi,%rdi
jae    110f <out_ch+0xf>
mov    %rdi,%rax
mov    %dl,(%rdi)
add    $0x1,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @out_ch(i8* writeonly %0, i8* readnone %1, i8 signext %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %2, i8* %0
br label %7
7: ; preds = %3, %5
%8 = phi i8* [ %6, %5 ], [ null, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int unblockfd(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  return fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1 ? -1 : 0;
}


x86 assembly (clang, -O0):
<unblockfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unblockfd>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @unblockfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
%13 = icmp eq i32 %12, -1
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 0
ret i32 %15
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @unblockfd(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void mdbm_log_init_syslog() {
  static int initialized = 0;
  if (!initialized) {
    openlog("mdbm", LOG_PID, LOG_USER);
    initialized = 1;
  }
}


x86 assembly (clang, -O0):
<mdbm_log_init_syslog>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1149 <mdbm_log_init_syslog+0x39>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0xec6(%rip),%rdi
call   1030 <openlog@plt>
movl   $0x1,0x2ee3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdbm_log_init_syslog>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    113f <mdbm_log_init_syslog+0x2f>
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
call   1030 <openlog@plt>
movb   $0x1,0x2eed(%rip)
pop    %rax
ret

LLVM IR (-O0):
@mdbm_log_init_syslog.initialized = internal global i32 0
@.str = [5 x i8] c"mdbm\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @mdbm_log_init_syslog() {
%1 = load i32, i32* @mdbm_log_init_syslog.initialized
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_USER
%6 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
store i32 1, i32* @mdbm_log_init_syslog.initialized
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@mdbm_log_init_syslog.initialized = internal unnamed_addr global i1 false
@.str = [5 x i8] c"mdbm\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @mdbm_log_init_syslog() {
%1 = load i1, i1* @mdbm_log_init_syslog.initialized
br i1 %1, label %6, label %2
2: ; preds = %0
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_USER
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
store i1 true, i1* @mdbm_log_init_syslog.initialized
br label %6
6: ; preds = %2, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bst_test1();
int main() { bst_test1(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @bst_test1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bst_test1()
ret i32 0
}
void help_init() { ; }


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

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

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

LLVM IR (-O2):
define void @help_init() {
ret void
}
unsigned long long get6h(const unsigned char *attr, int p) {
  int i;
  unsigned long long v;
  v = 0;
  for (i = 0; i < 6; i++)
    v = (v << 8) + (attr[p + i] & 255L);
  return (v);
}


x86 assembly (clang, -O0):
<get6h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1159 <get6h+0x59>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
and    $0xff,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <get6h+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get6h>:
movslq %esi,%rax
movzbl (%rdi,%rax,1),%ecx
movzbl 0x1(%rdi,%rax,1),%edx
shl    $0x10,%rcx
shl    $0x8,%rdx
or     %rcx,%rdx
movzbl 0x2(%rdi,%rax,1),%ecx
or     %rdx,%rcx
movzbl 0x3(%rdi,%rax,1),%edx
shl    $0x10,%rcx
shl    $0x8,%rdx
or     %rcx,%rdx
movzbl 0x4(%rdi,%rax,1),%ecx
or     %rdx,%rcx
shl    $0x8,%rcx
movzbl 0x5(%rdi,%rax,1),%eax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @get6h(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = add nsw i64 %3, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl nuw nsw i64 %6, 16
%12 = shl nuw nsw i64 %10, 8
%13 = or i64 %11, %12
%14 = add nsw i64 %3, 2
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %13, %17
%19 = add nsw i64 %3, 3
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl nuw nsw i64 %18, 16
%24 = shl nuw nsw i64 %22, 8
%25 = or i64 %23, %24
%26 = add nsw i64 %3, 4
%27 = getelementptr inbounds i8, i8* %0, i64 %26
%28 = load i8, i8* %27
%29 = zext i8 %28 to i64
%30 = or i64 %25, %29
%31 = shl i64 %30, 8
%32 = add nsw i64 %3, 5
%33 = getelementptr inbounds i8, i8* %0, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i64
%36 = or i64 %31, %35
ret i64 %36
}
char __VERIFIER_nondet_char(void) {
  char c;
  { return (c); }
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_char>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @__VERIFIER_nondet_char() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @__VERIFIER_nondet_char() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Looping\n");
  int i, j, k, N = 2000;
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      for (k = 0; k < N; k++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7d0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a4 <main+0x94>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1191 <main+0x81>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117e <main+0x6e>
jmp    1170 <main+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115f <main+0x4f>
jmp    1183 <main+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x3c>
jmp    1196 <main+0x86>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Looping\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 2000, i32* %5
store i32 0, i32* %2
br label %7
7: ; preds = %30, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %33
11: ; preds = %7
store i32 0, i32* %3
br label %12
12: ; preds = %26, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %12
store i32 0, i32* %4
br label %17
17: ; preds = %22, %16
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %17
25: ; preds = %17
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %12
29: ; preds = %12
br label %30
30: ; preds = %29
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %7
33: ; preds = %7
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@str = [8 x i8] c"Looping\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ sqrt(double);
int compute_gemm_dimension(int maxmem, int datasize) {
  int dim;
  dim = (int)sqrt((double)(maxmem / (datasize * 3)));
  return (dim);
}


x86 assembly (clang, -O0):
<compute_gemm_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x3,-0x8(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   1030 <sqrt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_gemm_dimension>:
mov    %edi,%eax
lea    (%rsi,%rsi,2),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @compute_gemm_dimension(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* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 3
%9 = sdiv i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = call i64 @sqrt(double %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @compute_gemm_dimension(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 3
%4 = sdiv i32 %0, %3
%5 = sitofp i32 %4 to double
%6 = tail call i64 @sqrt(double %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
int pthread_setcanceltype(int type, int *oldtype) { return -1; }


x86 assembly (clang, -O0):
<pthread_setcanceltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_setcanceltype(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
void detect_monotonic(void) {}


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

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

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

LLVM IR (-O2):
define void @detect_monotonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
void puts(char *msg) { serial_puts(msg); }


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

x86 assembly (clang, -O2):
<puts>:
jmp    1030 <serial_puts@plt>

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @serial_puts(i8* %0)
ret void
}
void tritod(char *s) {
  for (;; ++s)
    switch (*s) {
    case '\000':
      return;
    case '\340':
      *s = '\216';
      break;
    case '\344':
      *s = '\231';
      break;
    case '\346':
      *s = '\232';
      break;
    }
}


x86 assembly (clang, -O0):
<tritod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x20,%eax
ja     1156 <tritod+0x56>
mov    -0x10(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movb   $0x8e,(%rax)
jmp    1156 <tritod+0x56>
mov    -0x8(%rbp),%rax
movb   $0x99,(%rax)
jmp    1156 <tritod+0x56>
mov    -0x8(%rbp),%rax
movb   $0x9a,(%rax)
jmp    115b <tritod+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <tritod+0x8>

x86 assembly (clang, -O2):
<tritod>:
lea    0xef9(%rip),%rax
jmp    1118 <tritod+0x18>
nopl   0x0(%rax)
mov    $0x9a,%cl
mov    %cl,(%rdi)
add    $0x1,%rdi
movsbl (%rdi),%edx
add    $0x20,%edx
cmp    $0x20,%edx
ja     1114 <tritod+0x14>
mov    $0x8e,%cl
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
mov    $0x99,%cl
jmp    1112 <tritod+0x12>
ret

LLVM IR (-O0):
define void @tritod(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %14 [
i32 0, label %7
i32 -32, label %8
i32 -28, label %10
i32 -26, label %12
]
7: ; preds = %3
ret void
8: ; preds = %3
%9 = load i8*, i8** %2
store i8 -114, i8* %9
br label %14
10: ; preds = %3
%11 = load i8*, i8** %2
store i8 -103, i8* %11
br label %14
12: ; preds = %3
%13 = load i8*, i8** %2
store i8 -102, i8* %13
br label %14
14: ; preds = %3, %12, %10, %8
br label %15
15: ; preds = %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
}

LLVM IR (-O2):
define void @tritod(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %12, %11 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 0, label %6
i32 -32, label %9
i32 -28, label %7
i32 -26, label %8
]
6: ; preds = %2
ret void
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %2, %8, %7
%10 = phi i8 [ -103, %7 ], [ -102, %8 ], [ -114, %2 ]
store i8 %10, i8* %3
br label %11
11: ; preds = %9, %2
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
}
void ohci_hlwd_bulk_quirk(struct ohci_hcd *ohci) { return; }


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

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

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

LLVM IR (-O2):
%struct.ohci_hcd = type opaque
define void @ohci_hlwd_bulk_quirk(%struct.ohci_hcd* nocapture %0) {
ret void
}
void stream_test(void) {
  static float input[20];
  int k;
  for (k = 0; k < 20; k++)
    input[k] = k * 1.0;
}


x86 assembly (clang, -O0):
<stream_test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1148 <stream_test+0x48>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2efb(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <stream_test+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
@stream_test.input = internal global [20 x float] zeroinitializer
define void @stream_test() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 20
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+00
%9 = fptrunc double %8 to float
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [20 x float], [20 x float]* @stream_test.input, i64 0, i64 %11
store float %9, float* %12
br label %13
13: ; preds = %5
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %2
16: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @stream_test() {
ret void
}
/* Variables and functions */
int strtol(char *, char **, int);
int hex2int(char *hexStr) {
  char *offset;
  return strtol(hexStr, &offset, 16);
}


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

x86 assembly (clang, -O2):
<hex2int>:
push   %rax
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hex2int(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 16)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CU_ASSERT(int);
int minmin(int *, int, int);
void ut_minmin() {
  int arr[5] = {2, 4, 1, 8, 10};
  int result = minmin(arr, 3, 5);
  CU_ASSERT(result == 1);
}


x86 assembly (clang, -O0):
<ut_minmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1030 <minmin@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <CU_ASSERT@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_minmin>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1030 <minmin@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <CU_ASSERT@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ut_minmin.arr = [5 x i32] [i32 2, i32 4, i32 1, i32 8, i32 10]
define void @ut_minmin() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @minmin(i32* %4, i32 3, i32 5)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @CU_ASSERT(i32 %8)
ret void
}

LLVM IR (-O2):
@__const.ut_minmin.arr = [5 x i32] [i32 2, i32 4, i32 1, i32 8, i32 10]
define void @ut_minmin() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @minmin(i32* %3, i32 3, i32 5)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @CU_ASSERT(i32 %6)
ret void
}
unsigned int test_hash_intptr_with_collisions(const void *data) {
  return (unsigned int)(*((int *)data) % 100);
}


x86 assembly (clang, -O0):
<test_hash_intptr_with_collisions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hash_intptr_with_collisions>:
movslq (%rdi),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_hash_intptr_with_collisions(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 100
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_hash_intptr_with_collisions(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 100
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t rt_get_nanoseconds() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return (uint64_t)t.tv_sec * 1000000000 + t.tv_nsec;
}


x86 assembly (clang, -O0):
<rt_get_nanoseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_get_nanoseconds>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @rt_get_nanoseconds() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @rt_get_nanoseconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long atol(int /*<<< orphan*/);
int /*<<< orphan*/ findLine(int /*<<< orphan*/ *, char *);
long parse_mailid(FILE *plr_file) { return atol(findLine(plr_file, "MlID:")); }


x86 assembly (clang, -O0):
<parse_mailid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
call   1030 <atol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mailid>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <atol@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"MlID:\00"
define i64 @parse_mailid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @findLine(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @atol(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"MlID:\00"
define i64 @parse_mailid(i32* %0) {
%2 = tail call i32 @findLine(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @atol(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ reset_wshed();
void Reset_Partition() { reset_wshed(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Partition() {
%1 = tail call i32 (...) @reset_wshed()
ret void
}
/* Variables and functions */
int strlen(char *);
int __attribute__((no, noclone)) f2(char *a, int n) {
  a[0] = '1';
  a[1] = '2';
  return strlen(a + 1) < n ? strlen(a) : 100;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x31,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x32,0x1(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
cmp    -0xc(%rbp),%eax
jge    1155 <f2+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
jmp    1162 <f2+0x52>
mov    $0x64,%eax
mov    %eax,-0x10(%rbp)
jmp    1162 <f2+0x52>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movw   $0x3231,(%rdi)
add    $0x1,%rdi
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    1138 <f2+0x28>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>
mov    $0x64,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 49, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 50, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @strlen(i8* %10)
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = call i32 @strlen(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %14
%19 = phi i32 [ %16, %14 ], [ 100, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @f2(i8* %0, i32 %1) {
store i8 49, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 50, i8* %3
%4 = tail call i32 @strlen(i8* %3)
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 100, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t numtolen(u_int32_t num) {
  u_int32_t len = 0;
  while ((num <<= 1))
    len++;
  return len + 1;
}


x86 assembly (clang, -O0):
<numtolen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <numtolen+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <numtolen+0xe>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numtolen>:
add    %edi,%edi
je     1109 <numtolen+0x9>
bsf    %edi,%ecx
jmp    110e <numtolen+0xe>
mov    $0x20,%ecx
mov    $0x21,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numtolen(i32 %0) {
%2 = shl i32 %0, 1
%3 = call i32 @llvm.cttz.i32(i32 %2, i1 false)
%4 = sub nuw nsw i32 33, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, git!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, git!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello, git!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __BNF_trans_string(char *);
int off_on(void) {
  int state;
  do {
    state = __BNF_trans_string("on");
    if (!state)
      break;
    state = __BNF_trans_string("off");
  } while (0);
  return state;
}


x86 assembly (clang, -O0):
<off_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <off_on+0x26>
jmp    1145 <off_on+0x35>
lea    0xec6(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_on>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     112e <off_on+0x1e>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <__BNF_trans_string@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i32 @off_on() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %2
br label %9
7: ; preds = %2
%8 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i32 @off_on() {
%1 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
void foo750() {}


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

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

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

LLVM IR (-O2):
define void @foo750() {
ret void
}
/* Variables and functions */
double gsw_sa_from_sp(double, double, double, double);
double gsw_sr_from_sp(double);
double gsw_deltasa_from_sp(double sp, double p, double lon, double lat) {
  double res;
  res = gsw_sa_from_sp(sp, p, lon, lat) - gsw_sr_from_sp(sp);
  if (res > 1e10)
    res = 9e15;
  return (res);
}


x86 assembly (clang, -O0):
<gsw_deltasa_from_sp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1040 <gsw_sa_from_sp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <gsw_sr_from_sp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1199 <gsw_deltasa_from_sp+0x79>
movsd  0xe74(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_deltasa_from_sp>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <gsw_sa_from_sp@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <gsw_sr_from_sp@plt>
movapd 0x10(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0xeaf(%rip),%xmm1
cmpltsd %xmm2,%xmm1
movsd  0xeaa(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @gsw_deltasa_from_sp(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = call double @gsw_sa_from_sp(double %10, double %11, double %12, double %13)
%15 = load double, double* %5
%16 = call double @gsw_sr_from_sp(double %15)
%17 = fsub double %14, %16
store double %17, double* %9
%18 = load double, double* %9
%19 = fcmp ogt double %18, 1.000000e+10
br i1 %19, label %20, label %21
20: ; preds = %4
store double 9.000000e+15, double* %9
br label %21
21: ; preds = %20, %4
%22 = load double, double* %9
ret double %22
}

LLVM IR (-O2):
define double @gsw_deltasa_from_sp(double %0, double %1, double %2, double %3) {
%5 = tail call double @gsw_sa_from_sp(double %0, double %1, double %2, double %3)
%6 = tail call double @gsw_sr_from_sp(double %0)
%7 = fsub double %5, %6
%8 = fcmp ogt double %7, 1.000000e+10
%9 = select i1 %8, double 9.000000e+15, double %7
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_gomark(void) {
  l6480_send_cmd(0x74, 1, 0, 0);
  return;
}


x86 assembly (clang, -O0):
<l6480_cmd_gomark>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_gomark>:
mov    $0x74,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_gomark() {
%1 = call i32 @l6480_send_cmd(i32 116, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_gomark() {
%1 = tail call i32 @l6480_send_cmd(i32 116, i32 1, i32 0, i32 0)
ret void
}
void RTAvlrooGCPtrGetRight(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned long,
                           unsigned int, char const *);
void perf_map_write_entry(FILE *method_file, const void *code_addr,
                          unsigned int code_size, const char *entry) {
  if (method_file)
    fprintf(method_file, "%lx %x %s\n", (unsigned long)code_addr, code_size,
            entry);
}


x86 assembly (clang, -O0):
<perf_map_write_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <perf_map_write_entry+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_map_write_entry>:
test   %rdi,%rdi
je     1129 <perf_map_write_entry+0x19>
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xedc(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%lx %x %s\0A\00"
define void @perf_map_write_entry(i32* %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = ptrtoint i8* %1 to i64
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %2, i8* %3)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int out(unsigned char *, int /*<<< orphan*/, int, int, int, char *);
bool writeBinaryFile(unsigned char *data, int size, char *fileName) {
  return out(data, 0, size, 1, false, fileName);
}


x86 assembly (clang, -O0):
<writeBinaryFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r9
xor    %r8d,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
call   1030 <out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBinaryFile>:
mov    %rdx,%r9
mov    %esi,%edx
xor    %esi,%esi
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <out@plt>

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

LLVM IR (-O2):
define i32 @writeBinaryFile(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @out(i8* %0, i32 0, i32 %1, i32 1, i32 0, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  int *tid = (int *)threadid;
  printf("Hello World da thread: %d\n", *tid);
  free(tid);
  pthread_exit(NULL);
}


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

x86 assembly (clang, -O2):
<PrintHello>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Hello World da thread: %d\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %4
%11 = call i32 @free(i32* %10)
%12 = call i32 @pthread_exit(i32* null)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello World da thread: %d\0A\00"
define noalias i8* @PrintHello(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i32* %2)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int test_imm_88int8_mem(signed char *val) {
  return ((*val) & (0x88 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_88int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -120
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}