xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void g(int a, int b) {
  int c = a - b;
  if (c >= 0)
    foo(c);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1139 <g+0x29>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
sub    %esi,%edi
js     1119 <g+0x9>
jmp    1030 <foo@plt>
ret

LLVM IR (-O0):
define void @g(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 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @foo(i32 %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @g(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 %3)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int rand();
float Random(void) {
  int i = rand();
  return (float)(i % 1000) / 1000.0;
}


x86 assembly (clang, -O0):
<Random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
divss  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Random() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = srem i32 %3, 1000
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.000000e+03
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @Random() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = sitofp i32 %2 to float
%4 = fdiv float %3, 1.000000e+03
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *thr_fn(void *arg) {
  printf("in thr_fn:%s\n", (char *)arg);
  return (void *)0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"in thr_fn:%s\0A\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"in thr_fn:%s\0A\00"
define noalias i8* @thr_fn(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) {}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
define void @sysfs_notify(%struct.kobject* %0, i8* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca i8*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
define void @sysfs_notify(%struct.kobject* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ restore_terminal();
int /*<<< orphan*/ termnoecho(int /*<<< orphan*/);
int getche() {
  int key;
  termnoecho(0);
  key = getch();
  restore_terminal();
}


x86 assembly (clang, -O0):
<getche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <termnoecho@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <restore_terminal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getche>:
push   %rax
xor    %edi,%edi
call   1030 <termnoecho@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <restore_terminal@plt>

LLVM IR (-O0):
define i32 @getche() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @termnoecho(i32 0)
%4 = call i32 (...) @getch()
store i32 %4, i32* %2
%5 = call i32 (...) @restore_terminal()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @getche() {
%1 = tail call i32 @termnoecho(i32 0)
%2 = tail call i32 (...) @getch()
%3 = tail call i32 (...) @restore_terminal()
ret i32 undef
}
int cpy_bmp(unsigned long value, void *arg) {
  unsigned char **p, *q;
  p = arg;
  q = *p;
  *q++ = (unsigned char)((value >> 8) & 0xff);
  *q = (unsigned char)(value & 0xff);
  *p += 2;
  return 1;
}


x86 assembly (clang, -O0):
<cpy_bmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy_bmp>:
mov    (%rsi),%rax
rol    $0x8,%di
mov    %di,(%rax)
addq   $0x2,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cpy_bmp(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i64, i64* %3
%12 = lshr i64 %11, 8
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %6
store i8 %14, i8* %15
%17 = load i64, i64* %3
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %6
store i8 %19, i8* %20
%21 = load i8**, i8*** %5
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8* %23, i8** %21
ret i32 1
}

LLVM IR (-O2):
define i32 @cpy_bmp(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = trunc i64 %0 to i8
store i8 %8, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8* %10, i8** %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x3d() {
  Assert_real((isodigit(61) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              310, ("isodigit should be 0 for ="));
}


x86 assembly (clang, -O0):
<t_isodigit_0x3d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x136,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x136,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for =\00"
define void @t_isodigit_0x3d() {
%1 = call i64 @isodigit(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for =\00"
define void @t_isodigit_0x3d() {
%1 = tail call i64 @isodigit(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double tan(double);
double Func_Tan(double *oplist, unsigned int numops) { return tan(oplist[0]); }


x86 assembly (clang, -O0):
<Func_Tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Func_Tan>:
movsd  (%rdi),%xmm0
jmp    1030 <tan@plt>

LLVM IR (-O0):
define double @Func_Tan(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = call double @tan(double %7)
ret double %8
}

LLVM IR (-O2):
define double @Func_Tan(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
%4 = tail call double @tan(double %3)
ret double %4
}
/* Variables and functions */
int test();
int main() { return test(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 %1
}
long long unsigned int mul10(long long unsigned int value) {
  return (value << 3) + (value << 1);
}


x86 assembly (clang, -O0):
<mul10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul10>:
add    %rdi,%rdi
lea    (%rdi,%rdi,4),%rax
ret

LLVM IR (-O0):
define i64 @mul10(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 3
%5 = load i64, i64* %2
%6 = shl i64 %5, 1
%7 = add i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @mul10(i64 %0) {
%2 = mul i64 %0, 10
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime_r(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          char *);
void printTimeReentrant(time_t t) {
  char humanTime[128];
  ctime_r(&t, humanTime);
  printf("0x%lx or %ld is %s\n\n", t, t, humanTime);
}


x86 assembly (clang, -O0):
<printTimeReentrant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1040 <ctime_r@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    -0x90(%rbp),%rcx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTimeReentrant>:
push   %rbx
sub    $0x90,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <ctime_r@plt>
mov    0xc(%rsp),%edx
lea    0xeb7(%rip),%rdi
mov    %edx,%esi
mov    %rbx,%rcx
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"0x%lx or %ld is %s\0A\0A\00"
define void @printTimeReentrant(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @ctime_r(i32* %2, i8* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"0x%lx or %ld is %s\0A\0A\00"
define void @printTimeReentrant(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @ctime_r(i32* %2, i8* %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
char lookahead_c(FILE *f) {
  char result;
  int fpos;
  if (feof(f))
    return -1;
  fpos = ftell(f);
  result = fgetc(f);
  fseek(f, fpos, SEEK_SET);
  return result;
}


x86 assembly (clang, -O0):
<lookahead_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     1168 <lookahead_c+0x28>
movb   $0xff,-0x1(%rbp)
jmp    119b <lookahead_c+0x5b>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    0x2e52(%rip),%rax
mov    (%rax),%edx
call   1060 <fseek@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookahead_c>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1050 <feof@plt>
test   %rax,%rax
je     1155 <lookahead_c+0x15>
mov    $0xff,%al
jmp    1180 <lookahead_c+0x40>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <fseek@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define signext i8 @lookahead_c(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i64 @feof(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 -1, i8* %2
br label %20
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = call i32 @ftell(i32* %11)
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = call signext i8 @fgetc(i32* %13)
store i8 %14, i8* %4
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = load i32, i32* @SEEK_SET
%18 = call i32 @fseek(i32* %15, i32 %16, i32 %17)
%19 = load i8, i8* %4
store i8 %19, i8* %2
br label %20
20: ; preds = %10, %9
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define signext i8 @lookahead_c(i32* nocapture %0) {
%2 = tail call i64 @feof(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @ftell(i32* %0)
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @fseek(i32* %0, i32 %5, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i8 [ %6, %4 ], [ -1, %1 ]
ret i8 %10
}
char *test_myAdd_small(const char **_ja_name) {
  do {
    *_ja_name = __func__;
    if (!(myAdd(0, 0) == 0))
      return "0 + 0 == 0";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_myAdd_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <myAdd@plt>
cmp    $0x0,%eax
je     114e <test_myAdd_small+0x3e>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <test_myAdd_small+0x4b>
jmp    1153 <test_myAdd_small+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_myAdd_small>:
push   %rbx
lea    0xee8(%rip),%rax
mov    %rax,(%rdi)
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <myAdd@plt>
test   %eax,%eax
lea    0xee0(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@__func__.test_myAdd_small = [17 x i8] c"test_myAdd_small\00"
@.str = [11 x i8] c"0 + 0 == 0\00"
define i8* @test_myAdd_small(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %1
%5 = load i8**, i8*** %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_myAdd_small, i64 0, i64 0), i8** %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @myAdd to i32 (i32, i32, ...)*)(i32 0, i32 0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@__func__.test_myAdd_small = [17 x i8] c"test_myAdd_small\00"
@.str = [11 x i8] c"0 + 0 == 0\00"
define i8* @test_myAdd_small(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_myAdd_small, i64 0, i64 0), i8** %0
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @myAdd to i32 (i32, i32, ...)*)(i32 0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void handler(int num) {
  printf("signal %d raised\n", num);
  exit(-1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"signal %d raised\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"signal %d raised\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int Scl_ConHasOutReqs_(int /*<<< orphan*/);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConHasOutReqs() { return Scl_ConHasOutReqs_(Scl_ConReadMan()); }


x86 assembly (clang, -O0):
<Scl_ConHasOutReqs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
call   1030 <Scl_ConHasOutReqs_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConHasOutReqs>:
push   %rax
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Scl_ConHasOutReqs_@plt>

LLVM IR (-O0):
define i32 @Scl_ConHasOutReqs() {
%1 = call i32 (...) @Scl_ConReadMan()
%2 = call i32 @Scl_ConHasOutReqs_(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @Scl_ConHasOutReqs() {
%1 = tail call i32 (...) @Scl_ConReadMan()
%2 = tail call i32 @Scl_ConHasOutReqs_(i32 %1)
ret i32 %2
}
void WebPRescalerDspInitMIPS32(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPRescalerDspInitMIPS32() {
ret void
}
float invSqrt(float number) {
  long i;
  float x, y;
  const float f = 1.5F;
  x = number * 0.5F;
  y = number;
  i = *(long *)&y;
  i = 0x5f375a86 - (i >> 1);
  y = *(float *)&i;
  y = y * (f - (x * y * y));
  return y;
}


x86 assembly (clang, -O0):
<invSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f375a86,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe7b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @invSqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463174, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
ret float %25
}

LLVM IR (-O2):
define float @invSqrt(float %0) {
ret float poison
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_long(void) { fprintf(stdout, "long function\n"); }


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"long function\0A\00"
define void @print_long() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"long function\0A\00"
define void @print_long() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo44() {}


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

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

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

LLVM IR (-O2):
define void @foo44() {
ret void
}
int cdrom_mrw_exit(struct cdrom_device_info *cdi) {
  (void)cdi;
  return -1;
}


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

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

LLVM IR (-O0):
%struct.cdrom_device_info = type opaque
define i32 @cdrom_mrw_exit(%struct.cdrom_device_info* %0) {
%2 = alloca %struct.cdrom_device_info*
store %struct.cdrom_device_info* %0, %struct.cdrom_device_info** %2
%3 = load %struct.cdrom_device_info*, %struct.cdrom_device_info** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.cdrom_device_info = type opaque
define i32 @cdrom_mrw_exit(%struct.cdrom_device_info* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
size_t s_tri_upper(const size_t row, const size_t col) {
  if (row > col) {
    return 0;
  }
  return row + col * (col + 1) / 2;
}


x86 assembly (clang, -O0):
<s_tri_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <s_tri_upper+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1146 <s_tri_upper+0x46>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_tri_upper>:
lea    0x1(%rsi),%rcx
imul   %rsi,%rcx
shr    %rcx
add    %rdi,%rcx
xor    %eax,%eax
cmp    %rsi,%rdi
cmovbe %rcx,%rax
ret

LLVM IR (-O0):
define i64 @s_tri_upper(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 0, i64* %3
br label %18
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = load i64, i64* %5
%14 = add i64 %13, 1
%15 = mul i64 %12, %14
%16 = udiv i64 %15, 2
%17 = add i64 %11, %16
store i64 %17, i64* %3
br label %18
18: ; preds = %10, %9
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @s_tri_upper(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = add i64 %1, 1
%5 = mul i64 %4, %1
%6 = lshr i64 %5, 1
%7 = add i64 %6, %0
%8 = select i1 %3, i64 0, i64 %7
ret i64 %8
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
float frand(float from, float to) {
  return (float)(((double)rand() / RAND_MAX) * (to - from) + from);
}


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
movss  (%rsp),%xmm2
movss  0x4(%rsp),%xmm1
subss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @frand(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fsub float %9, %10
%12 = fpext float %11 to double
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = call double @llvm.fmuladd.f64(double %8, double %12, double %14)
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @frand(float %0, float %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub float %1, %0
%8 = fpext float %7 to double
%9 = fpext float %0 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %9)
%11 = fptrunc double %10 to float
ret float %11
}
int qsort_cmp_double(const void *x, const void *y) {
  if (*((double *)x) < *((double *)y))
    return (-1);
  else
    return (*((double *)x) > *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <qsort_cmp_double+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp_double+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ assert(int);
int tsub_ok(int, int);
int main(int argc, char *argv[]) {
  assert(!tsub_ok(0x00, INT_MIN));
  assert(tsub_ok(0x00, 0x00));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <tsub_ok@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <tsub_ok@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <tsub_ok@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <tsub_ok@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @INT_MIN
%7 = call i32 @tsub_ok(i32 0, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @tsub_ok(i32 0, i32 0)
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MIN
%4 = tail call i32 @tsub_ok(i32 0, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @tsub_ok(i32 0, i32 0)
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
bool is_exists(int *str, int size, int num) {
  int i;
  for (i = 0; i <= size; i++) {
    if (str[i] == num) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<is_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1154 <is_exists+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <is_exists+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <is_exists+0x5b>
jmp    1146 <is_exists+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <is_exists+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_exists>:
test   %esi,%esi
js     111e <is_exists+0x1e>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %edx,(%rdi,%rax,4)
je     1121 <is_exists+0x21>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <is_exists+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_exists(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %11
8: ; preds = %11
%9 = add nuw nsw i64 %12, 1
%10 = icmp eq i64 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %5, %8
%12 = phi i64 [ 0, %5 ], [ %9, %8 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %8
16: ; preds = %11, %8, %3
%17 = phi i32 [ 0, %3 ], [ 0, %8 ], [ 1, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_short_put(short *dest, const short *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_short_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_short_put(i16* %0, i16* %1, i64 %2, i32 %3) {
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i64
%8 = alloca i32
store i16* %0, i16** %5
store i16* %1, i16** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_short_put(i16* nocapture readnone %0, i16* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void prompt(char curdir[256]) { printf("%s $: ", curdir); }


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

x86 assembly (clang, -O2):
<prompt>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s $: \00"
define void @prompt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int parse_input(char *);
int parse_output(char *);
int parse_tunnel(char *);
int parse_line(char *line, int section) {
  switch (section) {
  case 1:
    return parse_input(line);
  case 2:
    return parse_output(line);
  case 3:
    return parse_tunnel(line);
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1175 <parse_line+0x45>
jmp    1153 <parse_line+0x23>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1186 <parse_line+0x56>
jmp    1164 <parse_line+0x34>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     1197 <parse_line+0x67>
jmp    11a8 <parse_line+0x78>
mov    -0x10(%rbp),%rdi
call   1030 <parse_input@plt>
mov    %eax,-0x4(%rbp)
jmp    11af <parse_line+0x7f>
mov    -0x10(%rbp),%rdi
call   1040 <parse_output@plt>
mov    %eax,-0x4(%rbp)
jmp    11af <parse_line+0x7f>
mov    -0x10(%rbp),%rdi
call   1050 <parse_tunnel@plt>
mov    %eax,-0x4(%rbp)
jmp    11af <parse_line+0x7f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
cmp    $0x3,%esi
je     1144 <parse_line+0x14>
cmp    $0x2,%esi
je     1149 <parse_line+0x19>
cmp    $0x1,%esi
jne    114e <parse_line+0x1e>
jmp    1030 <parse_input@plt>
jmp    1050 <parse_tunnel@plt>
jmp    1040 <parse_output@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @parse_line(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @parse_input(i8* %8)
store i32 %9, i32* %3
br label %17
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @parse_output(i8* %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @parse_tunnel(i8* %14)
store i32 %15, i32* %3
br label %17
16: ; preds = %2
store i32 -1, i32* %3
br label %17
17: ; preds = %16, %13, %10, %7
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @parse_line(i8* %0, i32 %1) {
switch i32 %1, label %9 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
]
3: ; preds = %2
%4 = tail call i32 @parse_input(i8* %0)
br label %9
5: ; preds = %2
%6 = tail call i32 @parse_output(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @parse_tunnel(i8* %0)
br label %9
9: ; preds = %2, %7, %5, %3
%10 = phi i32 [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int read_int(char *, char const *);
int read_bl_power(const char *driver) { return read_int("bl_power", driver); }


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

x86 assembly (clang, -O2):
<read_bl_power>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <read_int@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"bl_power\00"
define i32 @read_bl_power(i8* %0) {
%2 = tail call i32 @read_int(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
int isPresent(char a, char *varTbl) {
  int i;
  for (i = 0; varTbl[i] != '#'; i++)
    if (varTbl[i] == a)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isPresent>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     1161 <isPresent+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <isPresent+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isPresent+0x68>
jmp    1153 <isPresent+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <isPresent+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPresent>:
mov    (%rsi),%cl
xor    %eax,%eax
cmp    $0x23,%cl
je     1121 <isPresent+0x21>
add    $0x1,%rsi
nopl   (%rax)
cmp    %dil,%cl
je     1122 <isPresent+0x22>
movzbl (%rsi),%ecx
add    $0x1,%rsi
cmp    $0x23,%cl
jne    1110 <isPresent+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPresent(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 35
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 35
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}
/* Type definitions */
typedef int color;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetBcolor(unsigned short int color) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x42) & 0xFF);
  SendChar(((color) >> 8) & 0xFF);
  SendChar((color)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetBcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x42,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBcolor>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x42,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetBcolor(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 66)
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @SendChar(i32 %8)
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = call i32 @SendChar(i32 %12)
%14 = call i32 @SendChar(i32 255)
%15 = call i32 @SendChar(i32 252)
%16 = call i32 @SendChar(i32 255)
%17 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetBcolor(i16 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 66)
%4 = zext i16 %0 to i32
%5 = lshr i32 %4, 8
%6 = tail call i32 @SendChar(i32 %5)
%7 = and i32 %4, 255
%8 = tail call i32 @SendChar(i32 %7)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 252)
%11 = tail call i32 @SendChar(i32 255)
%12 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ precess_hiprec(double, double, double *, double *);
void precess(double mjd1, double mjd2, double *ra, double *dec) {
  precess_hiprec(mjd1, mjd2, ra, dec);
}


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

x86 assembly (clang, -O2):
<precess>:
jmp    1030 <precess_hiprec@plt>

LLVM IR (-O0):
define void @precess(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 @precess_hiprec(double %9, double %10, double* %11, double* %12)
ret void
}

LLVM IR (-O2):
define void @precess(double %0, double %1, double* %2, double* %3) {
%5 = tail call i32 @precess_hiprec(double %0, double %1, double* %2, double* %3)
ret void
}