xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print2(size_t count) {
  int i;
  for (i = 0; i < count; i++) {
    fprintf(stderr, "2");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<print2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1154 <print2+0x44>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print2+0x13>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print2>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1141 <print2+0x31>
mov    %rdi,%rbx
mov    0x2ebc(%rip),%r15
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <print2+0x20>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"2\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = add nuw i64 %4, 1
%8 = icmp eq i64 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x7b() {
  Assert_real((iscntrl(123) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              620, ("iscntrl should be 0 for {"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x7b>:
push   %rax
mov    $0x7b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x26c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for {\00"
define void @t_iscntrl_0x7b() {
%1 = tail call i64 @iscntrl(i32 123)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void XtAddEventHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtAddEventHandler() {
ret void
}
void evm_release_result(struct evm_result const *result) {}


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

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

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

LLVM IR (-O2):
%struct.evm_result = type opaque
define void @evm_release_result(%struct.evm_result* nocapture %0) {
ret void
}
unsigned int chartoint(char str[]) {
  int i0 = 0, i1 = 0, i2 = 0, i3 = 0;
  i0 = str[0];
  i1 = str[1];
  i2 = str[2];
  i3 = str[3];
  int numero = (i3 >>= 24) | (i2 >>= 16) | (i1 >>= 8) | i0;
  return numero;
}


x86 assembly (clang, -O0):
<chartoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
sar    $0x10,%ecx
mov    %ecx,-0x14(%rbp)
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
sar    $0x8,%ecx
mov    %ecx,-0x10(%rbp)
or     %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartoint>:
mov    0x2(%rdi),%al
or     0x1(%rdi),%al
or     0x3(%rdi),%al
sar    $0x7,%al
or     (%rdi),%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @chartoint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %3
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %4
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
store i32 %19, i32* %5
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = ashr i32 %24, 24
store i32 %25, i32* %6
%26 = load i32, i32* %5
%27 = ashr i32 %26, 16
store i32 %27, i32* %5
%28 = or i32 %25, %27
%29 = load i32, i32* %4
%30 = ashr i32 %29, 8
store i32 %30, i32* %4
%31 = or i32 %28, %30
%32 = load i32, i32* %3
%33 = or i32 %31, %32
store i32 %33, i32* %7
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @chartoint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = or i8 %6, %4
%10 = or i8 %9, %8
%11 = ashr i8 %10, 7
%12 = or i8 %11, %2
%13 = sext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
void *fopen(char const *, char const *);
void *zfile_fopen(const char *name, const char *mode) {
  return fopen(name, mode);
}


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

x86 assembly (clang, -O2):
<zfile_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i8* @zfile_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @fopen(i8* %0, i8* %1)
ret i8* %3
}
dch(pn) int pn;
{ brc(pn, 'P'); }


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

x86 assembly (clang, -O2):
<dch>:
mov    $0x50,%esi
xor    %eax,%eax
jmp    1030 <brc@plt>

LLVM IR (-O0):
define i32 @dch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %4, i32 80)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @dch(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %0, i32 80)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put2_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int,
                             int /*<<< orphan*/);
void MC_put_x_8_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_put2_8(height, dest, ref, stride, 1, 0);
}


x86 assembly (clang, -O0):
<MC_put_x_8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <MC_put2_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_x_8_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <MC_put2_8@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysRangeRemove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR61_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR61_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR61_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int rand();
int randNumber(int min, int max) {
  int number = (rand() % (max - min + 1)) + min;
  return number;
}


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

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

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

LLVM IR (-O2):
define i32 @randNumber(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _Term();
int /*<<< orphan*/ advance();
scalar_t__ match(int);
void _Exp_prime(void) {
  if (match(2)) {
    advance();
    _Term();
    _Exp_prime();
  }
}


x86 assembly (clang, -O0):
<_Exp_prime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1050 <match@plt>
cmp    $0x0,%rax
je     116b <_Exp_prime+0x2b>
mov    $0x0,%al
call   1040 <advance@plt>
mov    $0x0,%al
call   1030 <_Term@plt>
call   1060 <_Exp_prime@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Exp_prime>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1050 <match@plt>
test   %rax,%rax
je     115f <_Exp_prime+0x2f>
xor    %eax,%eax
call   1040 <advance@plt>
xor    %eax,%eax
call   1030 <_Term@plt>
jmp    1140 <_Exp_prime+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @_Exp_prime() {
%1 = call i64 @match(i32 2)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @advance()
%5 = call i32 (...) @_Term()
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Exp_prime() {
%1 = tail call i64 @match(i32 2)
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @advance()
%5 = tail call i32 (...) @_Term()
%6 = tail call i64 @match(i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
double pdfStandard(double);
double pdfNormal(double m, double s, double x) {
  double t = (x - m) / s;
  return (pdfStandard(t) / s);
}


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

x86 assembly (clang, -O2):
<pdfNormal>:
push   %rax
movsd  %xmm1,(%rsp)
subsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <pdfStandard@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pdfNormal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = load double, double* %5
%12 = fdiv double %10, %11
store double %12, double* %7
%13 = load double, double* %7
%14 = call double @pdfStandard(double %13)
%15 = load double, double* %5
%16 = fdiv double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @pdfNormal(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = fdiv double %4, %1
%6 = tail call double @pdfStandard(double %5)
%7 = fdiv double %6, %1
ret double %7
}
void RichIsGettingTiredOfEmptyFileVMCompilerWarnings() {
  int andUnderstandablySo = 0;
}


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

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

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

LLVM IR (-O2):
define void @RichIsGettingTiredOfEmptyFileVMCompilerWarnings() {
ret void
}
int t_month(int *box, int month) {
  int check = 0;
  while (check != 2) {
    if (month >= 1 && month <= 12) {
      return 1;
    } else {
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<t_month>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
je     1148 <t_month+0x48>
cmpl   $0x1,-0x14(%rbp)
jl     113c <t_month+0x3c>
cmpl   $0xc,-0x14(%rbp)
jg     113c <t_month+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    114f <t_month+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    114f <t_month+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_month>:
add    $0xffffffff,%esi
xor    %eax,%eax
cmp    $0xc,%esi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @t_month(i32* nocapture readnone %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 12
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int mkstemp(char *);
int no_resourceLeak_mkstemp_02(char *template) { return mkstemp(template); }


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

x86 assembly (clang, -O2):
<no_resourceLeak_mkstemp_02>:
jmp    1030 <mkstemp@plt>

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

LLVM IR (-O2):
define i32 @no_resourceLeak_mkstemp_02(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
ret i32 %2
}
void *Calloc(unsigned n, unsigned size) {
  unsigned len = n * size;
  char *p = Malloc(len);
  if (p == 0)
    return 0;
  char *q = p;
  int i;
  for (i = 0; i < len; i++)
    *q++ = 0;
  return p;
}


x86 assembly (clang, -O0):
<Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1150 <Calloc+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1193 <Calloc+0x83>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    118b <Calloc+0x7b>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115f <Calloc+0x4f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
imul   %esi,%ebp
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <Malloc@plt>
test   %eax,%eax
je     114a <Calloc+0x2a>
movslq %eax,%rbx
test   %ebp,%ebp
je     114a <Calloc+0x2a>
mov    %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @Calloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %4, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = icmp eq i32 %3, 0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = zext i32 %3 to i64
br label %12
12: ; preds = %10, %8, %2
%13 = phi i8* [ null, %2 ], [ %6, %8 ], [ %6, %10 ]
ret i8* %13
}
void uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @uninit() {
ret void
}
void f() {
  int j, i;
  char s[11];
  char t[11];
  for (j = 0; j <= 10; j++) {
    s[j] = '\0';
  }
  for (i = 0; i <= 11; i++) {
    t[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     112c <f+0x2c>
movslq -0x4(%rbp),%rax
movb   $0x0,-0x13(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
movl   $0x0,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jg     1154 <f+0x54>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x1e(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <f+0x33>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
char *getenv(char const *);
char *get_environment_variable(const char *varName) { return getenv(varName); }


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

x86 assembly (clang, -O2):
<get_environment_variable>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @get_environment_variable(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_ws(char *str) {
  char *p = str;
  while (*p && isspace(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <skip_ws+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <skip_ws+0x4f>
jmp    1170 <skip_ws+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skip_ws+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_ws+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_ws+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_ws(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %17, %1
%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 %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i64 @isspace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %15
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_ws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int main(int argc, char *argv[]) {
  int age = 100;
  int height = 72;
  printf("I am %d years old.\n", argv);
  printf("I am %d inches tall.\n", height);
  return 0;
}


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)
movl   $0x64,-0x14(%rbp)
movl   $0x48,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store i32 72, i32* %7
%8 = load i8**, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %8)
%10 = load i32, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Type definitions */
struct MIDIMessageFormat {
  int dummy;
};
struct MIDIMessageData {
  int dummy;
};

/* Variables and functions */
int MIDIMessageFormatDecodeRunningStatus(struct MIDIMessageFormat *,
                                         struct MIDIMessageData *,
                                         int /*<<< orphan*/ *, size_t, void *,
                                         size_t *);
int MIDIMessageFormatDecode(struct MIDIMessageFormat *format,
                            struct MIDIMessageData *data, size_t size,
                            void *buffer, size_t *read) {
  return MIDIMessageFormatDecodeRunningStatus(format, data, NULL, size, buffer,
                                              read);
}


x86 assembly (clang, -O0):
<MIDIMessageFormatDecode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %eax,%eax
mov    %eax,%edx
call   1030 <MIDIMessageFormatDecodeRunningStatus@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDIMessageFormatDecode>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <MIDIMessageFormatDecodeRunningStatus@plt>

LLVM IR (-O0):
%struct.MIDIMessageFormat = type { i32 }
%struct.MIDIMessageData = type { i32 }
define i32 @MIDIMessageFormatDecode(%struct.MIDIMessageFormat* %0, %struct.MIDIMessageData* %1, i64 %2, i8* %3, i64* %4) {
%6 = alloca %struct.MIDIMessageFormat*
%7 = alloca %struct.MIDIMessageData*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64*
store %struct.MIDIMessageFormat* %0, %struct.MIDIMessageFormat** %6
store %struct.MIDIMessageData* %1, %struct.MIDIMessageData** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64* %4, i64** %10
%11 = load %struct.MIDIMessageFormat*, %struct.MIDIMessageFormat** %6
%12 = load %struct.MIDIMessageData*, %struct.MIDIMessageData** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64*, i64** %10
%16 = call i32 @MIDIMessageFormatDecodeRunningStatus(%struct.MIDIMessageFormat* %11, %struct.MIDIMessageData* %12, i32* null, i64 %13, i8* %14, i64* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.MIDIMessageFormat = type { i32 }
%struct.MIDIMessageData = type { i32 }
define i32 @MIDIMessageFormatDecode(%struct.MIDIMessageFormat* %0, %struct.MIDIMessageData* %1, i64 %2, i8* %3, i64* %4) {
%6 = tail call i32 @MIDIMessageFormatDecodeRunningStatus(%struct.MIDIMessageFormat* %0, %struct.MIDIMessageData* %1, i32* null, i64 %2, i8* %3, i64* %4)
ret i32 %6
}
void init_add_rel_pixel_mask_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_pixel_mask_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ perror(char *);
int snprintf(char *, int, char *);
int write(int /*<<< orphan*/, char *, int);
void clear_screen() {
  char stuff[80];
  int bw = snprintf(stuff, 80, "\x1b[0m\x1b[H\x1b[2J");
  if (write(STDOUT_FILENO, stuff, bw) == -1) {
    perror("Unable to clear screen");
  }
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
lea    0xeb8(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x54(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    117a <clear_screen+0x4a>
lea    0xe97(%rip),%rdi
call   1050 <perror@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <snprintf@plt>
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     116a <clear_screen+0x3a>
add    $0x50,%rsp
pop    %rbx
ret
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
jmp    1164 <clear_screen+0x34>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[0m\1B[H\1B[2J\00"
@STDOUT_FILENO = global i32 0
@.str.1 = [23 x i8] c"Unable to clear screen\00"
define void @clear_screen() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* @STDOUT_FILENO
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @write(i32 %5, i8* %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[0m\1B[H\1B[2J\00"
@STDOUT_FILENO = global i32 0
@.str.1 = [23 x i8] c"Unable to clear screen\00"
define void @clear_screen() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8* %2, i32 %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret void
}
/* Variables and functions */
double *Diff_lf(double *, double *, double *, int);
double Norm_lf(double *, int, unsigned char);
int /*<<< orphan*/ free(double *);
double NormDiff_lf(double *x, double *y, double *tmp, int n,
                   unsigned char norm) {
  double nrm, *z;
  int i;
  z = tmp;
  nrm = 0.0;
  z = Diff_lf(x, y, z, n);
  nrm = Norm_lf(z, n, norm);
  free(z);
  return nrm;
}


x86 assembly (clang, -O0):
<NormDiff_lf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <Diff_lf@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%esi
movzbl -0x1d(%rbp),%edx
call   1040 <Norm_lf@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormDiff_lf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%r14d
mov    %ecx,%ebp
call   1050 <Diff_lf@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Norm_lf@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @NormDiff_lf(double* %0, double* %1, double* %2, i32 %3, i8 zeroext %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i8
%11 = alloca double
%12 = alloca double*
%13 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i8 %4, i8* %10
%14 = load double*, double** %8
store double* %14, double** %12
store double 0.000000e+00, double* %11
%15 = load double*, double** %6
%16 = load double*, double** %7
%17 = load double*, double** %12
%18 = load i32, i32* %9
%19 = call double* @Diff_lf(double* %15, double* %16, double* %17, i32 %18)
store double* %19, double** %12
%20 = load double*, double** %12
%21 = load i32, i32* %9
%22 = load i8, i8* %10
%23 = call double @Norm_lf(double* %20, i32 %21, i8 zeroext %22)
store double %23, double* %11
%24 = load double*, double** %12
%25 = call i32 @free(double* %24)
%26 = load double, double* %11
ret double %26
}

LLVM IR (-O2):
define double @NormDiff_lf(double* %0, double* %1, double* %2, i32 %3, i8 zeroext %4) {
%6 = tail call double* @Diff_lf(double* %0, double* %1, double* %2, i32 %3)
%7 = tail call double @Norm_lf(double* %6, i32 %3, i8 zeroext %4)
%8 = tail call i32 @free(double* %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ *tmpfile();
int main() {
  char buffer[100];
  FILE *file = tmpfile();
  while (fgets(buffer, 100, file) != NULL) {
    printf("%s\n", buffer);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tmpfile@plt>
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rdx
mov    $0x64,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    -0x70(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1050 <tmpfile@plt>
mov    %rax,%r15
mov    %rsp,%rdi
mov    $0x64,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1190 <main+0x60>
lea    0xea1(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @tmpfile()
store i32* %4, i32** %3
br label %5
5: ; preds = %10, %0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = load i32*, i32** %3
%8 = call i32* @fgets(i8* %6, i32 100, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %5
13: ; preds = %5
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32* (...) @tmpfile()
%4 = call i32* @fgets(i8* %2, i32 100, i32* %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %0, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32* @fgets(i8* %2, i32 100, i32* %3)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %0
ret i32 0
}
int unsignedToSignedInt(unsigned int unsignedInt) {
  union _Integer {
    int s;
    unsigned int u;
  } Integer;
  Integer.u = unsignedInt;
  return Integer.s;
}


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

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

LLVM IR (-O0):
%union._Integer = type { i32 }
define i32 @unsignedToSignedInt(i32 %0) {
%2 = alloca i32
%3 = alloca %union._Integer
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union._Integer* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union._Integer* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @unsignedToSignedInt(i32 returned %0) {
ret i32 %0
}
float call_radian(float x) {
  return (((x)*180.0f) / 3.141592653589793238462643);
}


x86 assembly (clang, -O0):
<call_radian>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_radian>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @call_radian(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fpext float %4 to double
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @call_radian(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
ret float %5
}
int strsize(char *mem) {
  int i = 0;
  while (mem[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strsize+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strsize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strsize+0x10>
ret

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

LLVM IR (-O2):
define i32 @strsize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int product(int, int, int, int, int, int);
int main(int argc, char const *argv[]) {
  int pro;
  pro = product(5, 1, 2, 3, 4, 5);
  printf("%d\n", pro);
  return 0;
}


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    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <product@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <product@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @product(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *progname) {
  fprintf(stderr,
          "usage: %s inputfirmware.bin \"/media/CRP DISABLD/firmware.bin\"\n\n"
          "Either or both input and output may be -, which indicates to work\n"
          "on stdin or stdout\n\n",
          progname);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [150 x i8] c"usage: %s inputfirmware.bin \22/media/CRP DISABLD/firmware.bin\22\0A\0AEither or both input and output may be -, which indicates to work\0Aon stdin or stdout\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [150 x i8] c"usage: %s inputfirmware.bin \22/media/CRP DISABLD/firmware.bin\22\0A\0AEither or both input and output may be -, which indicates to work\0Aon stdin or stdout\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}