xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *concat(char *s1, char *s2) {
  char *result = malloc(strlen(s1) + strlen(s2) + 1);
  if (!result)
    return 0;
  strcpy(result, s1);
  strcat(result, s2);
  return result;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1192 <concat+0x52>
movq   $0x0,-0x8(%rbp)
jmp    11b4 <concat+0x74>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1186 <concat+0x46>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
%11 = tail call i32 @strcat(i8* %7, i8* %1)
br label %12
12: ; preds = %2, %9
ret i8* %7
}
/* Type definitions */
struct timespec {
  int tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_cpu_time_in_usec() {
  struct timespec clock;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &clock);
  return clock.tv_sec * 1000000 + (clock.tv_nsec / 1000.0);
}


x86 assembly (clang, -O0):
<get_cpu_time_in_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_time_in_usec>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  0xebf(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, double }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @get_cpu_time_in_usec() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+03
%11 = fadd double %7, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, double }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @get_cpu_time_in_usec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sitofp i32 %7 to double
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+03
%12 = fadd double %11, %8
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake512_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_blake512(unsigned char *out, FILE *fp) {
  return blake512_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_blake512>:
jmp    1030 <blake512_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake512(i8* %0, i32* %1) {
%3 = tail call i8* @blake512_file(i8* %0, i32* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getdelim(char **, size_t *, char, int /*<<< orphan*/ *);
ssize_t getline(char **buf, size_t *s, FILE *f) {
  return getdelim(buf, s, '\n', f);
}


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

x86 assembly (clang, -O2):
<getline>:
mov    %rdx,%rcx
mov    $0xa,%edx
jmp    1030 <getdelim@plt>

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

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getdelim(i8** %0, i64* %1, i8 signext 10, i32* %2)
ret i32 %4
}
/* Variables and functions */
double ln_get_mars_earth_dist(double);
double ln_get_mars_sdiam(double JD) {
  double So = 4.68;
  double dist;
  dist = ln_get_mars_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_mars_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_mars_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_mars_sdiam>:
push   %rax
call   1030 <ln_get_mars_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_mars_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 4.680000e+00, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_mars_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_mars_sdiam(double %0) {
%2 = tail call double @ln_get_mars_earth_dist(double %0)
%3 = fdiv double 4.680000e+00, %2
ret double %3
}
double dd_two_sum(double a, double b, double *err) {
  double s = a + b;
  double bb = s - a;
  *err = (a - (s - bb)) + (b - bb);
  return s;
}


x86 assembly (clang, -O0):
<dd_two_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_two_sum>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm3
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm4,%xmm3
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dd_two_sum(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fadd double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %4
%14 = fsub double %12, %13
store double %14, double* %8
%15 = load double, double* %4
%16 = load double, double* %7
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = fsub double %15, %18
%20 = load double, double* %5
%21 = load double, double* %8
%22 = fsub double %20, %21
%23 = fadd double %19, %22
%24 = load double*, double** %6
store double %23, double* %24
%25 = load double, double* %7
ret double %25
}

LLVM IR (-O2):
define double @dd_two_sum(double %0, double %1, double* nocapture writeonly %2) {
%4 = fadd double %0, %1
%5 = fsub double %4, %0
%6 = fsub double %4, %5
%7 = fsub double %0, %6
%8 = fsub double %1, %5
%9 = fadd double %8, %7
store double %9, double* %2
ret double %4
}
void signed_char_mul_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) *= RHS;
}


x86 assembly (clang, -O0):
<signed_char_mul_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
imul   %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signed_char_mul_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_mul_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, woldr!\n");
  printf("Good Bye! \n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%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>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, woldr!\0A\00"
@.str.1 = [12 x i8] c"Good Bye! \0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, woldr!\00"
@str.2 = [11 x i8] c"Good Bye! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int munmap(void *, unsigned long);
int /*<<< orphan*/ printf(char *, void *);
void release_addr(void *addr) {
  int r = munmap(addr, 4096UL);
  if (r != 0) {
    printf("Failed to unmap addr.: %p\n", addr);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<release_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000,%esi
call   1040 <munmap@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <release_addr+0x41>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_addr>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1000,%esi
call   1040 <munmap@plt>
test   %eax,%eax
jne    1144 <release_addr+0x14>
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Failed to unmap addr.: %p\0A\00"
define void @release_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @munmap(i8* %4, i64 4096)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Failed to unmap addr.: %p\0A\00"
define void @release_addr(i8* %0) {
%2 = tail call i32 @munmap(i8* %0, i64 4096)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
struct NQueens {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct NQueens *);
int destroy_nqueens(struct NQueens *nqueens) {
  int destroyed = 0;
  if (nqueens != NULL) {
    free(nqueens);
    destroyed = 1;
  }
  return destroyed;
}


x86 assembly (clang, -O0):
<destroy_nqueens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <destroy_nqueens+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_nqueens>:
test   %rdi,%rdi
je     1125 <destroy_nqueens+0x15>
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.NQueens = type { i32 }
define i32 @destroy_nqueens(%struct.NQueens* %0) {
%2 = alloca %struct.NQueens*
%3 = alloca i32
store %struct.NQueens* %0, %struct.NQueens** %2
store i32 0, i32* %3
%4 = load %struct.NQueens*, %struct.NQueens** %2
%5 = icmp ne %struct.NQueens* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.NQueens*, %struct.NQueens** %2
%8 = call i32 @free(%struct.NQueens* %7)
store i32 1, i32* %3
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.NQueens = type { i32 }
define i32 @destroy_nqueens(%struct.NQueens* %0) {
%2 = icmp eq %struct.NQueens* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.NQueens* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %6
}
void ls_cost_nm2_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm2_incref() {
ret void
}
void phosphor2x_generic_output(void *data, unsigned *out_width,
                               unsigned *out_height, unsigned width,
                               unsigned height) {
  (void)data;
  *out_width = width * 2;
  *out_height = height * 2;
}


x86 assembly (clang, -O0):
<phosphor2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<phosphor2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @phosphor2x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %9
%13 = mul i32 %12, 2
%14 = load i32*, i32** %7
store i32 %13, i32* %14
%15 = load i32, i32* %10
%16 = mul i32 %15, 2
%17 = load i32*, i32** %8
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @phosphor2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
int IsSeqtype(const int seqtype) {
  switch (seqtype) {
  case 0:
  case 1:
  case 2:
  case 3:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsSeqtype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
ja     1124 <IsSeqtype+0x24>
jmp    1118 <IsSeqtype+0x18>
movl   $0x1,-0x4(%rbp)
jmp    112b <IsSeqtype+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSeqtype>:
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsSeqtype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsSeqtype(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
const char *SignatureSkipCallPrefix(const char *signature) {
  if (signature[0] == '_') {
    signature += 2;
  }
  return signature;
}


x86 assembly (clang, -O0):
<SignatureSkipCallPrefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    1124 <SignatureSkipCallPrefix+0x24>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignatureSkipCallPrefix>:
xor    %eax,%eax
cmpb   $0x5f,(%rdi)
sete   %al
lea    (%rdi,%rax,2),%rax
ret

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

LLVM IR (-O2):
define i8* @SignatureSkipCallPrefix(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 95
%4 = select i1 %3, i64 2, i64 0
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
double umrechnung_mm_in_inch(double wert) {
  double umrechnungsfaktor = 25.4000508001016;
  wert = wert / umrechnungsfaktor;
  return wert;
}


x86 assembly (clang, -O0):
<umrechnung_mm_in_inch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @umrechnung_mm_in_inch(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x40396669BAAF2CCD, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = fdiv double %4, %5
store double %6, double* %2
%7 = load double, double* %2
ret double %7
}

LLVM IR (-O2):
define double @umrechnung_mm_in_inch(double %0) {
%2 = fdiv double %0, 0x40396669BAAF2CCD
ret double %2
}
void setif_register_rollback(void) {}


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

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

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

LLVM IR (-O2):
define void @setif_register_rollback() {
ret void
}
void rb_init_float(float *obj_val) {
  if (obj_val) {
    *obj_val = 0.0;
  }
}


x86 assembly (clang, -O0):
<rb_init_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111e <rb_init_float+0x1e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_init_float>:
test   %rdi,%rdi
je     110b <rb_init_float+0xb>
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @rb_init_float(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = icmp ne float* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float*, float** %2
store float 0.000000e+00, float* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @rb_init_float(float* writeonly %0) {
%2 = icmp eq float* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store float 0.000000e+00, float* %0
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_le_clear_white_list(const void *test_data) { test_command(0x2010); }


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

x86 assembly (clang, -O2):
<test_le_clear_white_list>:
mov    $0x2010,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_le_clear_white_list(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 8208)
ret void
}

LLVM IR (-O2):
define void @test_le_clear_white_list(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 8208)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thanks(void) {
  printf("\n\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
  printf("Thank you for using this program\n");
  printf("It written by Habibur Rahman[shadhin]\n");
  printf("Email:root@hrshadhin.me\n");
  printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}


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

x86 assembly (clang, -O2):
<thanks>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0A\0A>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\0A\00"
@.str.1 = [34 x i8] c"Thank you for using this program\0A\00"
@.str.2 = [39 x i8] c"It written by Habibur Rahman[shadhin]\0A\00"
@.str.3 = [25 x i8] c"Email:root@hrshadhin.me\0A\00"
@.str.4 = [34 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\0A\00"
define void @thanks() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"\0A\0A\0A>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\00"
@str.5 = [33 x i8] c"Thank you for using this program\00"
@str.6 = [38 x i8] c"It written by Habibur Rahman[shadhin]\00"
@str.7 = [24 x i8] c"Email:root@hrshadhin.me\00"
@str.8 = [33 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\00"
define void @thanks() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, Comments!");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Hello, Comments!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int isBadVersion(int version) {
  if (version >= 1702766719)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isBadVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x657e287f,-0x8(%rbp)
jl     1120 <isBadVersion+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1127 <isBadVersion+0x27>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBadVersion>:
xor    %eax,%eax
cmp    $0x657e287f,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @isBadVersion(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 1702766719
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isBadVersion(i32 %0) {
%2 = icmp sgt i32 %0, 1702766718
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ butler();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I will summon the butler function.\n");
  butler();
  printf("Yes. Bring me some tea and writeable CD-ROMS.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"I will summon the butler function.\0A\00"
@.str.1 = [47 x i8] c"Yes. Bring me some tea and writeable CD-ROMS.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @butler()
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"I will summon the butler function.\00"
@str.2 = [46 x i8] c"Yes. Bring me some tea and writeable CD-ROMS.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @butler()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void _ZTimerInit(void) {}


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

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

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

LLVM IR (-O2):
define void @_ZTimerInit() {
ret void
}
int main(int argc, char **argv) {
  if (argv != 2) {
    return 0;
  }
  int i;
  i = atoi(argv[1]);
  prime_factor(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    %rax,-0x10(%rbp)
je     1151 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    116d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <prime_factor@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%rsi
je     1129 <main+0x9>
xor    %eax,%eax
ret
push   %rax
mov    0xa,%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <prime_factor@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = icmp ne i8** %7, inttoptr (i64 2 to i8**)
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %17
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 (i32, ...) bitcast (i32 (...)* @prime_factor to i32 (i32, ...)*)(i32 %15)
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** readnone %1) {
%3 = icmp eq i8** %1, inttoptr (i64 2 to i8**)
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** inttoptr (i64 10 to i8**)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @prime_factor to i32 (i32, ...)*)(i32 %6)
br label %8
8: ; preds = %2, %4
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned currentMS(void) {
  struct timeval now_time;
  gettimeofday(&now_time, 0);
  return (now_time.tv_sec * 1000 + now_time.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<currentMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentMS>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @currentMS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @currentMS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
extern void reset_ss02_control(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_ss02_control() {
ret void
}
/* Variables and functions */
int sqrt(int);
int isp(int a) {
  int k = sqrt(a);
  for (int i = 2; i <= k; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1168 <isp+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1155 <isp+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <isp+0x5f>
jmp    115a <isp+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <isp+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isp>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1149 <isp+0x39>
xor    %eax,%eax
test   $0x1,%bl
je     1149 <isp+0x39>
mov    $0x2,%edi
mov    %edi,%esi
cmp    %edi,%ecx
je     1142 <isp+0x32>
lea    0x1(%rsi),%edi
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1130 <isp+0x20>
xor    %eax,%eax
cmp    %ecx,%esi
setge  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isp(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %17, label %4
4: ; preds = %1
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %11
%8 = phi i32 [ %9, %11 ], [ 2, %4 ]
%9 = add nuw i32 %8, 1
%10 = icmp eq i32 %8, %2
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = srem i32 %0, %9
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %11
%15 = icmp sge i32 %8, %2
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %14, %4, %1
%18 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %16, %14 ]
ret i32 %18
}
void glReadPixels(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glReadPixels() {
ret void
}
/* Type definitions */
struct target_ops {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tcomplain();
void tdefault_async(struct target_ops *self, int arg1) { tcomplain(); }


x86 assembly (clang, -O0):
<tdefault_async>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <tcomplain@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type { i32 }
define void @tdefault_async(%struct.target_ops* %0, i32 %1) {
%3 = alloca %struct.target_ops*
%4 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %3
store i32 %1, i32* %4
%5 = call i32 (...) @tcomplain()
ret void
}

LLVM IR (-O2):
%struct.target_ops = type { i32 }
define void @tdefault_async(%struct.target_ops* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @tcomplain()
ret void
}
void restore_processor_state(void) {}


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

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

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

LLVM IR (-O2):
define void @restore_processor_state() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int a;
  a = 0;
  while (str[a] != '\0') {
    ft_putchar(str[a]);
    a++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strings_cmp(void *a, void *b) {
  return strcmp((const char *)a, (const char *)b);
}


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

x86 assembly (clang, -O2):
<strings_cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strings_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int input_init() { return (!0); }


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

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

LLVM IR (-O0):
define i32 @input_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @input_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "Usage:\n\tls <dir>\n"); }


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage:\0A\09ls <dir>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage:\0A\09ls <dir>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void test79_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test79_TestProg_targetInit__I() {
ret void
}
void vsnprintf_dummy_func() { vsnprintf_dummy_func(); }


x86 assembly (clang, -O0):
<vsnprintf_dummy_func>:
push   %rbp
mov    %rsp,%rbp
call   1030 <vsnprintf_dummy_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf_dummy_func>:
jmp    1100 <vsnprintf_dummy_func>

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

LLVM IR (-O2):
define void @vsnprintf_dummy_func() {
br label %1
1: ; preds = %1, %0
br label %1
}
void INT_Excep_TPU4_TGI4B(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU4_TGI4B() {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_middle(int);
void write_one_sector_middle(void) {
  ssize_t n;
  init_test();
  n = log_write_middle(512);
  basic_test(n == 512);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_sector_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x200,%edi
call   1040 <log_write_middle@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x200,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_sector_middle>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x200,%edi
call   1040 <log_write_middle@plt>
xor    %edi,%edi
cmp    $0x200,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_sector_middle() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_middle(i32 512)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 512
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_sector_middle() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_middle(i32 512)
%3 = icmp eq i32 %2, 512
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_network();
int /*<<< orphan*/ init_sys();
int /*<<< orphan*/ init_telnet();
int /*<<< orphan*/ init_terminal();
void tninit(void) {
  init_terminal();
  init_network();
  init_telnet();
  init_sys();
}


x86 assembly (clang, -O0):
<tninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_terminal@plt>
mov    $0x0,%al
call   1030 <init_network@plt>
mov    $0x0,%al
call   1060 <init_telnet@plt>
mov    $0x0,%al
call   1050 <init_sys@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tninit>:
push   %rax
xor    %eax,%eax
call   1040 <init_terminal@plt>
xor    %eax,%eax
call   1030 <init_network@plt>
xor    %eax,%eax
call   1060 <init_telnet@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <init_sys@plt>

LLVM IR (-O0):
define void @tninit() {
%1 = call i32 (...) @init_terminal()
%2 = call i32 (...) @init_network()
%3 = call i32 (...) @init_telnet()
%4 = call i32 (...) @init_sys()
ret void
}

LLVM IR (-O2):
define void @tninit() {
%1 = tail call i32 (...) @init_terminal()
%2 = tail call i32 (...) @init_network()
%3 = tail call i32 (...) @init_telnet()
%4 = tail call i32 (...) @init_sys()
ret void
}
int Cyc_Tctyp_ok_as_assn_stmt(int *ok, struct Cyc_Absyn_Stmt *s) {
  int *_T0;
  _T0 = ok;
  *_T0 = 0;
  return 0;
}


x86 assembly (clang, -O0):
<Cyc_Tctyp_ok_as_assn_stmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tctyp_ok_as_assn_stmt>:
movl   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Stmt = type opaque
define i32 @Cyc_Tctyp_ok_as_assn_stmt(i32* %0, %struct.Cyc_Absyn_Stmt* %1) {
%3 = alloca i32*
%4 = alloca %struct.Cyc_Absyn_Stmt*
%5 = alloca i32*
store i32* %0, i32** %3
store %struct.Cyc_Absyn_Stmt* %1, %struct.Cyc_Absyn_Stmt** %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = load i32*, i32** %5
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Stmt = type opaque
define i32 @Cyc_Tctyp_ok_as_assn_stmt(i32* nocapture writeonly %0, %struct.Cyc_Absyn_Stmt* nocapture readnone %1) {
store i32 0, i32* %0
ret i32 0
}