xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rand_r(unsigned int *);
unsigned int time(int /*<<< orphan*/ *);
uint32_t new_transaction_id(void) {
  unsigned int seed = time(NULL);
  return rand_r(&seed);
}


x86 assembly (clang, -O0):
<new_transaction_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <rand_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_transaction_id>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <rand_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @new_transaction_id() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i32 @rand_r(i32* %1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @new_transaction_id() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @rand_r(i32* %1)
ret i32 %4
}
/* Type definitions */
struct timex {
  int freq;
  scalar_t__ modes;
};

/* Variables and functions */
scalar_t__ __adjtimex(struct timex *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int get_current_freq(void) {
  struct timex txc;
  txc.modes = 0;
  if (__adjtimex(&txc) < 0) {
    perror("adjtimex");
    exit(1);
  }
  return txc.freq;
}


x86 assembly (clang, -O0):
<get_current_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <__adjtimex@plt>
cmp    $0x0,%rax
jge    1169 <get_current_freq+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_freq>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <__adjtimex@plt>
test   %rax,%rax
js     1155 <get_current_freq+0x25>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = call i64 @__adjtimex(%struct.timex* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = call i64 @__adjtimex(%struct.timex* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Variables and functions */
double gsl_ran_beta_pdf(double, double, double);
double pdf_Beta(double a, double b, double x) {
  return gsl_ran_beta_pdf(x, a, b);
}


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

x86 assembly (clang, -O2):
<pdf_Beta>:
movaps %xmm1,%xmm3
movaps %xmm0,%xmm1
movaps %xmm2,%xmm0
movaps %xmm3,%xmm2
jmp    1030 <gsl_ran_beta_pdf@plt>

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

LLVM IR (-O2):
define double @pdf_Beta(double %0, double %1, double %2) {
%4 = tail call double @gsl_ran_beta_pdf(double %2, double %0, double %1)
ret double %4
}
double INtoMM(double IN) { return IN * 25.4; }


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

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

LLVM IR (-O0):
define double @INtoMM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.540000e+01
ret double %4
}

LLVM IR (-O2):
define double @INtoMM(double %0) {
%2 = fmul double %0, 2.540000e+01
ret double %2
}
int strcmp(const char *s1, const char *s2) {
  while ((*s1) && (*s1 == *s2)) {
    ++s1;
    ++s2;
  }
  return (*(unsigned char *)s1 - *(unsigned char *)s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int get_unsigned_nb_bits(int /*<<< orphan*/);
int get_signed_nb_bits(int64_t value) {
  if (value < 0) {
    value = -value;
  } else {
    value++;
  }
  return get_unsigned_nb_bits(value) + 1;
}


x86 assembly (clang, -O0):
<get_signed_nb_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <get_signed_nb_bits+0x22>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <get_signed_nb_bits+0x2b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_unsigned_nb_bits@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_signed_nb_bits>:
push   %rax
mov    %edi,%ecx
neg    %ecx
lea    0x1(%rdi),%eax
test   %edi,%edi
cmovs  %ecx,%eax
mov    %eax,%edi
call   1030 <get_unsigned_nb_bits@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_signed_nb_bits(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = add nsw i32 %0, 1
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @get_unsigned_nb_bits(i32 %5)
%7 = add nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("SecMain\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"SecMain\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int dmemory_end(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmemory_end() {
ret i32 0
}
int is_rDRG(int id) {
  switch (id) {
  case 146:
  case 147:
  case 148:
  case 149:
  case 150:
  case 151:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<is_rDRG>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff6e,%eax
sub    $0x5,%eax
ja     1129 <is_rDRG+0x29>
jmp    111d <is_rDRG+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1130 <is_rDRG+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rDRG>:
add    $0xffffff6e,%edi
xor    %eax,%eax
cmp    $0x6,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_rDRG(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 146, label %5
i32 147, label %5
i32 148, label %5
i32 149, label %5
i32 150, label %5
i32 151, label %5
]
5: ; preds = %1, %1, %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 @is_rDRG(i32 %0) {
%2 = add i32 %0, -146
%3 = icmp ult i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) {
  zend_bailout();
  ZEND_VM_NEXT_OPCODE();
}


x86 assembly (clang, -O0):
<ZEND_EXIT_SPEC_CV_HANDLER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <zend_bailout@plt>
mov    $0x0,%al
call   1040 <ZEND_VM_NEXT_OPCODE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ZEND_EXIT_SPEC_CV_HANDLER(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @zend_bailout()
%5 = call i32 (...) @ZEND_VM_NEXT_OPCODE()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ZEND_EXIT_SPEC_CV_HANDLER(i32 %0) {
%2 = tail call i32 (...) @zend_bailout()
%3 = tail call i32 (...) @ZEND_VM_NEXT_OPCODE()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, k, m;
  scanf("%d", &n);
  k = n * n;
  m = n * n * n;
  printf("\n%d", k);
  printf("\n%d", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
char *trimLeadingZeros(char *ptr) {
  for (; *ptr == '0'; ++ptr) {
    switch (*(ptr + 1)) {
    case '.':
    case '\0':
      return ptr;
    default:
      *ptr = '\0';
      break;
    }
  }
  return ptr;
}


x86 assembly (clang, -O0):
<trimLeadingZeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    116b <trimLeadingZeros+0x6b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1141 <trimLeadingZeros+0x41>
jmp    1130 <trimLeadingZeros+0x30>
mov    -0x14(%rbp),%eax
sub    $0x2e,%eax
jne    114e <trimLeadingZeros+0x4e>
jmp    1141 <trimLeadingZeros+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <trimLeadingZeros+0x73>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115a <trimLeadingZeros+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <trimLeadingZeros+0x8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimLeadingZeros>:
mov    %rdi,%rax
cmpb   $0x30,(%rdi)
jne    112c <trimLeadingZeros+0x2c>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
movsbl %cl,%edx
test   %edx,%edx
je     112c <trimLeadingZeros+0x2c>
cmp    $0x2e,%edx
je     112c <trimLeadingZeros+0x2c>
movb   $0x0,(%rax)
add    $0x1,%rax
cmp    $0x30,%cl
je     1110 <trimLeadingZeros+0x10>
ret

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

LLVM IR (-O2):
define i8* @trimLeadingZeros(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %11
4: ; preds = %1, %9
%5 = phi i8* [ %6, %9 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %9 [
i32 46, label %11
i32 0, label %11
]
9: ; preds = %4
store i8 0, i8* %5
%10 = icmp eq i8 %7, 48
br i1 %10, label %4, label %11
11: ; preds = %4, %4, %9, %1
%12 = phi i8* [ %0, %1 ], [ %6, %9 ], [ %5, %4 ], [ %5, %4 ]
ret i8* %12
}
/* Variables and functions */
int fselect_sort(void const *, void const *);
int fselect_sort_nothumb(const void *v1, const void *v2) {
  return fselect_sort(v1, v2);
}


x86 assembly (clang, -O0):
<fselect_sort_nothumb>:
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 <fselect_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fselect_sort_nothumb>:
jmp    1030 <fselect_sort@plt>

LLVM IR (-O0):
define i32 @fselect_sort_nothumb(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 @fselect_sort(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fselect_sort_nothumb(i8* %0, i8* %1) {
%3 = tail call i32 @fselect_sort(i8* %0, i8* %1)
ret i32 %3
}
int count_list_size() {
  int total = 0;
  return total;
}


x86 assembly (clang, -O0):
<count_list_size>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @count_list_size() {
ret i32 0
}
int exists(int *arr, int size, int value) {
  while (size > 0) {
    if (*arr == value)
      return 1;
    arr++;
    size--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114d <exists+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    1133 <exists+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1154 <exists+0x54>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110e <exists+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
xor    %eax,%eax
test   %esi,%esi
jle    1120 <exists+0x20>
add    $0x1,%esi
nopl   0x0(%rax)
cmp    %edx,(%rdi)
je     1121 <exists+0x21>
add    $0x4,%rdi
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <exists+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exists(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %12, %10 ], [ %1, %3 ]
%7 = phi i32* [ %11, %10 ], [ %0, %3 ]
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %2
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = add nsw i32 %6, -1
%13 = icmp sgt i32 %6, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %10, %3
%15 = phi i32 [ 0, %3 ], [ 0, %10 ], [ 1, %5 ]
ret i32 %15
}
unsigned xrop3_89_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_89_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_89_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %ecx,%edx
not    %edx
or     %eax,%edx
xor    $0xff,%edx
or     %ecx,%eax
not    %eax
and    %edx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_89_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_89_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
%9 = xor i32 %8, 255
%10 = or i32 %6, %4
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = or i8 %1, %0
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int fun(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  int r = fun("hello");
  printf("fun returns %d\n", r);
  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 <fun@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [16 x i8] c"fun returns %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [16 x i8] c"fun returns %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void rop3_116_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_116_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_116_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %dl,%cl
or     %sil,%cl
xor    %r8b,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_116_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_116_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int lib();
int lib2();
int rootlib();
int main(int argc, char *argv[]) { return lib() + lib2() + rootlib(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lib@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <lib2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <rootlib@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <lib@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <lib2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <rootlib@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @lib()
%7 = call i32 (...) @lib2()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @rootlib()
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lib()
%4 = tail call i32 (...) @lib2()
%5 = add nsw i32 %4, %3
%6 = tail call i32 (...) @rootlib()
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ e_imm();
int /*<<< orphan*/ e_ldy();
void e_ldy_imm() {
  e_imm();
  e_ldy();
}


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

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

LLVM IR (-O0):
define void @e_ldy_imm() {
%1 = call i32 (...) @e_imm()
%2 = call i32 (...) @e_ldy()
ret void
}

LLVM IR (-O2):
define void @e_ldy_imm() {
%1 = tail call i32 (...) @e_imm()
%2 = tail call i32 (...) @e_ldy()
ret void
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_102(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 102)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_102>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x66,%eax
jne    1144 <fn_ch_102+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_102+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_102>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x66,%ecx
jne    1133 <fn_ch_102+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_102(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 102
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_102(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 102
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
char subtract1(char i) { return i--; }


x86 assembly (clang, -O0):
<subtract1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x1(%rbp)
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @subtract1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = add i8 %3, -1
store i8 %4, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @subtract1(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ integer_in_range_display_error(int /*<<< orphan*/ const,
                                                  int /*<<< orphan*/ const,
                                                  int /*<<< orphan*/ const);
void _assert_in_range(const uint64_t value, const uint64_t minimum,
                      const uint64_t maximum, const char *const file,
                      const int line) {
  if (!integer_in_range_display_error(value, minimum, maximum)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <integer_in_range_display_error@plt>
cmp    $0x0,%eax
jne    115c <_assert_in_range+0x3c>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
call   1040 <integer_in_range_display_error@plt>
test   %eax,%eax
je     1139 <_assert_in_range+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_in_range(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @integer_in_range_display_error(i32 %0, i32 %1, i32 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_fail(i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
double mjd2epb(dj)
double dj;
{ return (1900.0 + (dj - 15019.81352) / 365.242198781); }


x86 assembly (clang, -O0):
<mjd2epb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xefa(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @mjd2epb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x40CD55E8216C6152
%5 = fdiv double %4, 0x4076D3E00BD4386B
%6 = fadd double 1.900000e+03, %5
ret double %6
}

LLVM IR (-O2):
define double @mjd2epb(double %0) {
%2 = fadd double %0, 0xC0CD55E8216C6152
%3 = fdiv double %2, 0x4076D3E00BD4386B
%4 = fadd double %3, 1.900000e+03
ret double %4
}
/* Variables and functions */
void *malloc(int);
void *sawmill_malloc(int size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @sawmill_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ calc2_parse(int *, int *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  int regs[26];
  int base = 10;
  while (!feof(stdin)) {
    calc2_parse(regs, &base);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x74(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115c <main+0x3c>
jmp    116e <main+0x4e>
lea    -0x70(%rbp),%rdi
lea    -0x74(%rbp),%rsi
call   1030 <calc2_parse@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movl   $0xa,0xc(%rsp)
mov    0x2ead(%rip),%r15
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1177 <main+0x57>
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <calc2_parse@plt>
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%11 = call i32 @calc2_parse(i32* %10, i32* %3)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [26 x i32]
%2 = alloca i32
%3 = bitcast [26 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
br label %10
10: ; preds = %8, %10
%11 = call i32 @calc2_parse(i32* %9, i32* %2)
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %10, label %15
15: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a, b;
  a = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  while (a >= 0) {
    a = a + b;
    if (b >= 0) {
      b = -b - 1;
    } else {
      b = -b;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     116d <main+0x5d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1160 <main+0x50>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x58>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello Dhayal");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"Hello Dhayal\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_network();
int main(int argc, char **args) {
  test_network();
  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    $0x0,%al
call   1030 <test_network@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_network()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ POSIX_FADV_DONTNEED;
int /*<<< orphan*/ fdatasync(int);
int /*<<< orphan*/ fsync(int);
int /*<<< orphan*/ perror(char *);
int posix_fadvise(int, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int fd_flush(int fd) {
  int ret;
  fsync(fd);
  fdatasync(fd);
  ret = posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
  if (ret)
    perror("posix_fadvise() failed");
  return ret;
}


x86 assembly (clang, -O0):
<fd_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <fsync@plt>
mov    -0x4(%rbp),%edi
call   1030 <fdatasync@plt>
mov    -0x4(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1040 <posix_fadvise@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1189 <fd_flush+0x49>
lea    0xe7c(%rip),%rdi
call   1060 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_flush>:
push   %rbx
mov    %edi,%ebx
call   1050 <fsync@plt>
mov    %ebx,%edi
call   1030 <fdatasync@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <posix_fadvise@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    116d <fd_flush+0x2d>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe8c(%rip),%rdi
call   1060 <perror@plt>
jmp    1169 <fd_flush+0x29>

LLVM IR (-O0):
@POSIX_FADV_DONTNEED = global i32 0
@.str = [23 x i8] c"posix_fadvise() failed\00"
define i32 @fd_flush(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fsync(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @fdatasync(i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* @POSIX_FADV_DONTNEED
%10 = call i32 @posix_fadvise(i32 %8, i32 0, i32 0, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@POSIX_FADV_DONTNEED = global i32 0
@.str = [23 x i8] c"posix_fadvise() failed\00"
define i32 @fd_flush(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
%3 = tail call i32 @fdatasync(i32 %0)
%4 = load i32, i32* @POSIX_FADV_DONTNEED
%5 = tail call i32 @posix_fadvise(i32 %0, i32 0, i32 0, i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}