xunge/DecIR huggingface dataset:
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/formatstr.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/formatstr.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
int isUppercaseLetter(char c) {
  if ('A' <= c && c <= 'Z') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isUppercaseLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1134 <isUppercaseLetter+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1134 <isUppercaseLetter+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <isUppercaseLetter+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUppercaseLetter>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isUppercaseLetter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 65, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isUppercaseLetter(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_20() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x02ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_20>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0130,%eax
movslq (%rax),%rax
cmp    $0x9,%rax
jne    1139 <errata_20+0x39>
mov    $0xff0134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1134 <errata_20+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_20+0x40>
jmp    1139 <errata_20+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_20>:
cmpl   $0x9,0xff0130
09
jne    1119 <errata_20+0x19>
mov    $0x1,%eax
cmpl   $0x2,0xff0134
02
je     111b <errata_20+0x1b>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @errata_20() {
%1 = load i32, i32* inttoptr (i64 16711984 to i32*)
%2 = icmp eq i32 %1, 9
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 16711988 to i32*)
%5 = icmp eq i32 %4, 2
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randto(int n) {
  int r;
  int maxrand = (RAND_MAX / n) * n;
  do
    r = rand();
  while (r >= maxrand);
  return r % n;
}


x86 assembly (clang, -O0):
<randto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x4(%rbp)
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112f <randto+0x1f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randto>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
cltd
idiv   %edi
sub    %edx,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebp,%eax
jge    1130 <randto+0x20>
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %4
br label %10
10: ; preds = %12, %1
%11 = call i32 (...) @rand()
store i32 %11, i32* %3
br label %12
12: ; preds = %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp sge i32 %13, %14
br i1 %15, label %10, label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = srem i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randto(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = srem i32 %2, %0
%4 = sub i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = icmp slt i32 %6, %4
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = srem i32 %6, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void async_ssl__free_pem_peer_certificate_chain(char *certs) {
  free(certs);
  return;
}


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

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

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

LLVM IR (-O2):
define void @async_ssl__free_pem_peer_certificate_chain(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_cvtsd_i32(int /*<<< orphan*/);
int test_mm_cvtsd_i32(__m128d A) { return _mm_cvtsd_i32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtsd_i32>:
jmp    1030 <_mm_cvtsd_i32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtsd_i32(i32 %0) {
%2 = tail call i32 @_mm_cvtsd_i32(i32 %0)
ret i32 %2
}
int main() {
  int a = 0;
L1:
  if (a == 1) {
    goto L2;
  }
  a++;
  goto L1;
L2:
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1121 <main+0x21>
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void ui_print(const char *format __attribute__((unused)), ...) {}


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

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

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

LLVM IR (-O2):
define void @ui_print(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double RAND_MAX;
int rand();
int rand_getbernoulli(double p) {
  int cutoff = p * RAND_MAX;
  int val = rand();
  return (val > cutoff) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rand_getbernoulli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mulsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_getbernoulli>:
push   %rbx
mov    0x2ed0(%rip),%rax
mulsd  (%rax),%xmm0
cvttsd2si %xmm0,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setle  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_getbernoulli(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = load double, double* @RAND_MAX
%7 = fmul double %5, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = call i32 (...) @rand()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 1
ret i32 %14
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_getbernoulli(double %0) {
%2 = load double, double* @RAND_MAX
%3 = fmul double %2, %0
%4 = fptosi double %3 to i32
%5 = tail call i32 (...) @rand()
%6 = icmp sle i32 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *mc_strstr(const char *s1, const char *s2) { return strstr(s1, s2); }


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

x86 assembly (clang, -O2):
<mc_strstr>:
jmp    1030 <strstr@plt>

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

LLVM IR (-O2):
define i8* @mc_strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
void slib_init(int mcount, const char *mlist) {}


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

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

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

LLVM IR (-O2):
define void @slib_init(i32 %0, i8* nocapture %1) {
ret void
}
int isCleanable(char c) {
  if (c == '(' || c == ')') {
    return 1;
  } else if (c == ';') {
    return 1;
  } else if (c == ' ') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isCleanable>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
je     1124 <isCleanable+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    1130 <isCleanable+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isCleanable+0x73>
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
jne    1149 <isCleanable+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isCleanable+0x73>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1162 <isCleanable+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1173 <isCleanable+0x73>
jmp    1167 <isCleanable+0x67>
jmp    116c <isCleanable+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCleanable>:
mov    %edi,%eax
and    $0xfe,%al
cmp    $0x28,%al
sete   %al
cmp    $0x3b,%dil
sete   %cl
cmp    $0x20,%dil
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @isCleanable(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 40
%4 = icmp eq i8 %0, 59
%5 = icmp eq i8 %0, 32
%6 = or i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned long long *);
unsigned long long hextoll(char *str) {
  unsigned long long ret;
  sscanf(str, "%llx", &ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<hextoll>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llx\00"
define i64 @hextoll(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
ret i64 %5
}
/* Variables and functions */
char *get_configuration_value(char *);
int strtol(char *, int /*<<< orphan*/ *, int);
int get_paragraph_save_amount() {
  char *nof_paragraphs_as_string =
      get_configuration_value("save-text-history-paragraphs");
  if (nof_paragraphs_as_string == NULL)
    return -1;
  else
    return strtol(nof_paragraphs_as_string, NULL, 10);
}


x86 assembly (clang, -O0):
<get_paragraph_save_amount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <get_configuration_value@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <get_paragraph_save_amount+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <get_paragraph_save_amount+0x44>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_paragraph_save_amount>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <get_configuration_value@plt>
test   %rax,%rax
je     1142 <get_paragraph_save_amount+0x22>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rax
jmp    1030 <strtol@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"save-text-history-paragraphs\00"
define i32 @get_paragraph_save_amount() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @get_configuration_value(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @strtol(i8* %8, i32* null, i32 10)
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [29 x i8] c"save-text-history-paragraphs\00"
define i32 @get_paragraph_save_amount() {
%1 = tail call i8* @get_configuration_value(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @strtol(i8* nocapture %1, i32* null, i32 10)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
size_t shl_array_pow2(size_t v) {
  size_t i;
  if (!v)
    return 4;
  --v;
  for (i = 1; i < 8 * sizeof(size_t); i *= 2)
    v |= v >> i;
  return ++v;
}


x86 assembly (clang, -O0):
<shl_array_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <shl_array_pow2+0x20>
movq   $0x4,-0x8(%rbp)
jmp    1173 <shl_array_pow2+0x73>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x40,-0x18(%rbp)
jae    1163 <shl_array_pow2+0x63>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <shl_array_pow2+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_array_pow2>:
test   %rdi,%rdi
je     1149 <shl_array_pow2+0x49>
add    $0xffffffffffffffff,%rdi
mov    %rdi,%rax
shr    %rax
or     %rdi,%rax
mov    %rax,%rcx
shr    $0x2,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x4,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x8,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x10,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x20,%rax
or     %rdx,%rax
add    $0x1,%rax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @shl_array_pow2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i64 4, i64* %2
br label %26
8: ; preds = %1
%9 = load i64, i64* %3
%10 = add i64 %9, -1
store i64 %10, i64* %3
store i64 1, i64* %4
br label %11
11: ; preds = %20, %8
%12 = load i64, i64* %4
%13 = icmp ult i64 %12, 64
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = lshr i64 %15, %16
%18 = load i64, i64* %3
%19 = or i64 %18, %17
store i64 %19, i64* %3
br label %20
20: ; preds = %14
%21 = load i64, i64* %4
%22 = mul i64 %21, 2
store i64 %22, i64* %4
br label %11
23: ; preds = %11
%24 = load i64, i64* %3
%25 = add i64 %24, 1
store i64 %25, i64* %3
store i64 %25, i64* %2
br label %26
26: ; preds = %23, %7
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @shl_array_pow2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = add i64 %0, -1
%5 = lshr i64 %4, 1
%6 = or i64 %5, %4
%7 = lshr i64 %6, 2
%8 = or i64 %7, %6
%9 = lshr i64 %8, 4
%10 = or i64 %9, %8
%11 = lshr i64 %10, 8
%12 = or i64 %11, %10
%13 = lshr i64 %12, 16
%14 = or i64 %13, %12
%15 = lshr i64 %14, 32
%16 = or i64 %15, %14
%17 = add i64 %16, 1
br label %18
18: ; preds = %1, %3
%19 = phi i64 [ %17, %3 ], [ 4, %1 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_script_run() { create_write_byte(153); }


x86 assembly (clang, -O0):
<create_script_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%edi
call   1030 <create_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_script_run>:
mov    $0x99,%edi
jmp    1030 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_script_run() {
%1 = call i32 @create_write_byte(i32 153)
ret void
}

LLVM IR (-O2):
define void @create_script_run() {
%1 = tail call i32 @create_write_byte(i32 153)
ret void
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int ENOENT;
int NSS_STATUS_NOTFOUND;
enum nss_status _nss_noenum_getgrgid_r(const gid_t gid, struct group *gr,
                                       char *buffer, size_t buflen,
                                       int *errnop) {
  *errnop = ENOENT;
  return NSS_STATUS_NOTFOUND;
}


x86 assembly (clang, -O0):
<_nss_noenum_getgrgid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_getgrgid_r>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%r8)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getgrgid_r(i32 %0, %struct.group* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.group*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.group* %1, %struct.group** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i32, i32* @ENOENT
%12 = load i32*, i32** %10
store i32 %11, i32* %12
%13 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %13
}

LLVM IR (-O2):
%struct.group = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getgrgid_r(i32 %0, %struct.group* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32* nocapture writeonly %4) {
%6 = load i32, i32* @ENOENT
store i32 %6, i32* %4
%7 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ lcd_command(int);
int /*<<< orphan*/ ms_sleep(int);
void lcdInit() {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x60)) |= 0xff;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x40)) |= 8 | 4;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x5C)) = 8;
  ms_sleep(20);
  lcd_command(0x38);
  lcd_command(1);
  lcd_command(0x0c);
}


x86 assembly (clang, -O0):
<lcdInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fffc060,%eax
mov    (%rax),%rcx
or     $0xff,%rcx
mov    $0x3fffc060,%eax
mov    %rcx,(%rax)
mov    $0x3fffc040,%eax
mov    (%rax),%rcx
or     $0xc,%rcx
mov    $0x3fffc040,%eax
mov    %rcx,(%rax)
mov    $0x3fffc05c,%eax
movq   $0x8,(%rax)
mov    $0x14,%edi
call   1030 <ms_sleep@plt>
mov    $0x38,%edi
call   1040 <lcd_command@plt>
mov    $0x1,%edi
call   1040 <lcd_command@plt>
mov    $0xc,%edi
call   1040 <lcd_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdInit>:
push   %rax
orq    $0xff,0x3fffc060
orq    $0xc,0x3fffc040
3f 0c
movq   $0x8,0x3fffc05c
mov    $0x14,%edi
call   1030 <ms_sleep@plt>
mov    $0x38,%edi
call   1040 <lcd_command@plt>
mov    $0x1,%edi
call   1040 <lcd_command@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <lcd_command@plt>

LLVM IR (-O0):
define void @lcdInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725536 to i64*)
%2 = or i64 %1, 255
store volatile i64 %2, i64* inttoptr (i64 1073725536 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725504 to i64*)
%4 = or i64 %3, 12
store volatile i64 %4, i64* inttoptr (i64 1073725504 to i64*)
store volatile i64 8, i64* inttoptr (i64 1073725532 to i64*)
%5 = call i32 @ms_sleep(i32 20)
%6 = call i32 @lcd_command(i32 56)
%7 = call i32 @lcd_command(i32 1)
%8 = call i32 @lcd_command(i32 12)
ret void
}

LLVM IR (-O2):
define void @lcdInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725536 to i64*)
%2 = or i64 %1, 255
store volatile i64 %2, i64* inttoptr (i64 1073725536 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725504 to i64*)
%4 = or i64 %3, 12
store volatile i64 %4, i64* inttoptr (i64 1073725504 to i64*)
store volatile i64 8, i64* inttoptr (i64 1073725532 to i64*)
%5 = tail call i32 @ms_sleep(i32 20)
%6 = tail call i32 @lcd_command(i32 56)
%7 = tail call i32 @lcd_command(i32 1)
%8 = tail call i32 @lcd_command(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char s[100];
  scanf("%[^\n]%*c", &s);
  printf("Hello, World!\n");
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.2 = [3 x i8] c"%s\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void __attribute__((
    warning("curl_easy_setopt expects a FILE* argument for this option")))
__attribute__((unused)) __attribute__((no)) _curl_easy_setopt_err_FILE(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_FILE() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void sigpipe_hdl(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigpipe_hdl(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gamma_ramp(double, double, double, double);
int /*<<< orphan*/ glFlush();
void display(void) {
  gamma_ramp(0.5, 1.0, 1.0, 1.0);
  gamma_ramp(0.0, 1.0, 0.0, 0.0);
  gamma_ramp(-0.5, 0.0, 1.0, 0.0);
  gamma_ramp(-1.0, 0.0, 0.0, 1.0);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeec(%rip),%xmm0
movsd  0xed4(%rip),%xmm3
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <gamma_ramp@plt>
xorps  %xmm3,%xmm3
movsd  0xebe(%rip),%xmm1
movaps %xmm3,%xmm0
movaps %xmm3,%xmm2
call   1030 <gamma_ramp@plt>
movsd  0xeb3(%rip),%xmm0
xorps  %xmm3,%xmm3
movsd  0xea0(%rip),%xmm2
movaps %xmm3,%xmm1
call   1030 <gamma_ramp@plt>
movsd  0xe88(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xe85(%rip),%xmm3
movaps %xmm2,%xmm1
call   1030 <gamma_ramp@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movaps %xmm1,%xmm2
movaps %xmm1,%xmm3
call   1030 <gamma_ramp@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movsd  0xebb(%rip),%xmm1
call   1030 <gamma_ramp@plt>
movsd  0xeb6(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
movsd  0xea0(%rip),%xmm2
call   1030 <gamma_ramp@plt>
movsd  0xea3(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe85(%rip),%xmm3
call   1030 <gamma_ramp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
define void @display() {
%1 = call i32 @gamma_ramp(double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = call i32 @gamma_ramp(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%3 = call i32 @gamma_ramp(double -5.000000e-01, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%4 = call i32 @gamma_ramp(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%5 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
define void @display() {
%1 = tail call i32 @gamma_ramp(double 5.000000e-01, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = tail call i32 @gamma_ramp(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%3 = tail call i32 @gamma_ramp(double -5.000000e-01, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%4 = tail call i32 @gamma_ramp(double -1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%5 = tail call i32 (...) @glFlush()
ret void
}
void RTSemRWCreateEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWCreateEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ShowUsage(void) {
  printf("Usage: bin2txt in_file out_file\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: bin2txt in_file out_file\0A\00"
define void @ShowUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: bin2txt in_file out_file\00"
define void @ShowUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
void GENERAL_SUBTREE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @GENERAL_SUBTREE_new() {
ret void
}
int c_opener__(bb)
char bb[];
{ return (creat(bb, 0644)); }


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

x86 assembly (clang, -O2):
<c_opener__>:
mov    $0x1a4,%esi
xor    %eax,%eax
jmp    1030 <creat@plt>

LLVM IR (-O0):
define i32 @c_opener__(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %3, i32 420)
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_opener__(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %0, i32 420)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ rlim_t;

/* Variables and functions */
scalar_t__ RLIM_INFINITY;
bool tp_utils_limitisunlimited(rlim_t limit) {
  return limit == RLIM_INFINITY ? true : false;
}


x86 assembly (clang, -O0):
<tp_utils_limitisunlimited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    0x2ecd(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_utils_limitisunlimited>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@RLIM_INFINITY = global i64 0
define i32 @tp_utils_limitisunlimited(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @RLIM_INFINITY
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
@RLIM_INFINITY = global i64 0
define i32 @tp_utils_limitisunlimited(i64 %0) {
%2 = load i64, i64* @RLIM_INFINITY
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ unlink(char *);
void aofRemoveTempFile(pid_t childpid) {
  char tmpfile[256];
  snprintf(tmpfile, 256, "temp-rewriteaof-bg-%d.aof", (int)childpid);
  unlink(tmpfile);
}


x86 assembly (clang, -O0):
<aofRemoveTempFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aofRemoveTempFile>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"temp-rewriteaof-bg-%d.aof\00"
define void @aofRemoveTempFile(i64 %0) {
%2 = alloca i64
%3 = alloca [256 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
%7 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @unlink(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"temp-rewriteaof-bg-%d.aof\00"
define void @aofRemoveTempFile(i64 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = trunc i64 %0 to i32
%5 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @unlink(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printSudoku(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void animateSudoku(int S[][9]) {
  printf("\033c");
  printSudoku(S);
  usleep(5000);
}


x86 assembly (clang, -O0):
<animateSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printSudoku@plt>
mov    $0x1388,%edi
call   1050 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<animateSudoku>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <printSudoku@plt>
mov    $0x1388,%edi
pop    %rbx
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1Bc\00"
define void @animateSudoku([9 x i32]* %0) {
%2 = alloca [9 x i32]*
store [9 x i32]* %0, [9 x i32]** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load [9 x i32]*, [9 x i32]** %2
%5 = bitcast [9 x i32]* %4 to i32**
%6 = call i32 @printSudoku(i32** %5)
%7 = call i32 @usleep(i32 5000)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1Bc\00"
define void @animateSudoku([9 x i32]* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [9 x i32]* %0 to i32**
%4 = tail call i32 @printSudoku(i32** %3)
%5 = tail call i32 @usleep(i32 5000)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double timer_cpu_seconds() {
  struct timeval tv;
  double wtime;
  gettimeofday(&tv, NULL);
  wtime = tv.tv_sec;
  wtime += (double)tv.tv_usec * 1.0e-6;
  return wtime;
}


x86 assembly (clang, -O0):
<timer_cpu_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_cpu_seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @timer_cpu_seconds() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
store double %5, double* %2
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %9)
store double %10, double* %2
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @timer_cpu_seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write_file(char const *, char *, int /*<<< orphan*/);
ssize_t write_int_to_file(const char *path, int value) {
  char buf[32];
  snprintf(buf, sizeof(buf), "%d\n", value);
  return write_file(path, buf, strlen(buf));
}


x86 assembly (clang, -O0):
<write_int_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x20,%esi
lea    0xeae(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
call   1040 <write_file@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int_to_file>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ecx
mov    %rdi,%r14
lea    0xebd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write_file@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @write_int_to_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write_file(i8* %9, i8* %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @write_int_to_file(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @write_file(i8* %0, i8* %4, i32 %6)
ret i32 %7
}
int next(void) {
  static int i = 0;
  return i++;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@next.i = internal global i32 0
define i32 @next() {
%1 = load i32, i32* @next.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @next.i
ret i32 %1
}

LLVM IR (-O2):
@next.i = internal unnamed_addr global i32 0
define i32 @next() {
%1 = load i32, i32* @next.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @next.i
ret i32 %1
}
unsigned int set_bit_off(int reg, int pos) {
  unsigned int mask, output;
  mask = ~(1 << pos);
  output = reg & mask;
  return output;
}


x86 assembly (clang, -O0):
<set_bit_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set_bit_off(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @set_bit_off(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_divisible_by(int);
int main(void) {
  printf("%d\n",
         sum_divisible_by(3) + sum_divisible_by(5) - sum_divisible_by(15));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <sum_divisible_by@plt>
mov    %eax,-0xc(%rbp)
mov    $0x5,%edi
call   1030 <sum_divisible_by@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <sum_divisible_by@plt>
mov    -0x8(%rbp),%esi
sub    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1030 <sum_divisible_by@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1030 <sum_divisible_by@plt>
add    %eax,%ebx
mov    $0xf,%edi
call   1030 <sum_divisible_by@plt>
sub    %eax,%ebx
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum_divisible_by(i32 3)
%2 = tail call i32 @sum_divisible_by(i32 5)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @sum_divisible_by(i32 15)
%5 = sub i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
void setK2ExtendedMode(int fd) {
  write(fd, "K22;", 4);
  usleep(100e3);
}


x86 assembly (clang, -O0):
<setK2ExtendedMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x186a0,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setK2ExtendedMode>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x186a0,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"K22;\00"
define void @setK2ExtendedMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = call i32 @usleep(i32 100000)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"K22;\00"
define void @setK2ExtendedMode(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = tail call i32 @usleep(i32 100000)
ret void
}