xunge/DecIR huggingface dataset:
/* Variables and functions */
int sum(int);
int get(int i, int k) {
  if (i > 1)
    return sum(i + k) - sum(i - 1);
  else
    return sum(i + k);
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1150 <get+0x40>
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <sum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <get+0x4e>
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <sum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    (%rsi,%rbx,1),%edi
call   1030 <sum@plt>
mov    %eax,%ebp
cmp    $0x2,%ebx
jl     1130 <get+0x20>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1030 <sum@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 1
%4 = add nsw i32 %1, %0
%5 = tail call i32 @sum(i32 %4)
br i1 %3, label %6, label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = tail call i32 @sum(i32 %7)
%9 = sub nsw i32 %5, %8
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ %5, %2 ]
ret i32 %11
}
void ifree(p) char *const p;
{
  if (!((p) == ((void *)0)))
    (void)free(p);
}


x86 assembly (clang, -O0):
<ifree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ifree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifree>:
test   %rdi,%rdi
je     111a <ifree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ifree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ifree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
int division(int val1, int val2) { return val1 / val2; }


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

x86 assembly (clang, -O2):
<division>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @division(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
double flabs(x)
long x;
{
  if (x >= 0)
    return (double)x;
  return -((double)x);
}


x86 assembly (clang, -O0):
<flabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1123 <flabs+0x23>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1145 <flabs+0x45>
cvtsi2sdq -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flabs>:
cvtsi2sd %rdi,%xmm0
test   %rdi,%rdi
jns    1112 <flabs+0x12>
xorpd  0xeee(%rip),%xmm0
ret

LLVM IR (-O0):
define double @flabs(i64 %0) {
%2 = alloca double
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
store double %8, double* %2
br label %13
9: ; preds = %1
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = fneg double %11
store double %12, double* %2
br label %13
13: ; preds = %9, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @flabs(i64 %0) {
%2 = icmp sgt i64 %0, -1
%3 = sitofp i64 %0 to double
%4 = fneg double %3
%5 = select i1 %2, double %3, double %4
ret double %5
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
scalar_t__ pthread_self();
void *tidFunc(void *args) {
  printf("thread: thread\n\tpid: %u, tid: %u(%#0x)\n", (unsigned int)getpid(),
         (unsigned int)pthread_self(), (unsigned int)pthread_self());
  return NULL;
}


x86 assembly (clang, -O0):
<tidFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tidFunc>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeaa(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"thread: thread\0A\09pid: %u, tid: %u(%x)\0A\00"
define i8* @tidFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = call i64 (...) @pthread_self()
%6 = trunc i64 %5 to i32
%7 = call i64 (...) @pthread_self()
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
ret i8* null
}

LLVM IR (-O2):
@.str = [40 x i8] c"thread: thread\0A\09pid: %u, tid: %u(%x)\0A\00"
define noalias i8* @tidFunc(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
%4 = tail call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = tail call i64 (...) @pthread_self()
%7 = trunc i64 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7)
ret i8* null
}
int tstbit(unsigned int *w, unsigned int flags) { return *w & flags; }


x86 assembly (clang, -O0):
<tstbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tstbit>:
mov    %esi,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @tstbit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = and i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @tstbit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, %1
ret i32 %4
}
void glutPostWindowRedisplay(int win) {}


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

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

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

LLVM IR (-O2):
define void @glutPostWindowRedisplay(i32 %0) {
ret void
}
void HASH_RNG_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @HASH_RNG_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port17__default__fired();
void HplMsp430InterruptP__Port17__fired(void) {
  HplMsp430InterruptP__Port17__default__fired();
}


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

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

LLVM IR (-O0):
define void @HplMsp430InterruptP__Port17__fired() {
%1 = call i32 (...) @HplMsp430InterruptP__Port17__default__fired()
ret void
}

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port17__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port17__default__fired()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPBYTES;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPBYTES_it;
OCSP_RESPBYTES *d2i_OCSP_RESPBYTES(OCSP_RESPBYTES **a, const unsigned char **in,
                                   long len) {
  return (OCSP_RESPBYTES *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &OCSP_RESPBYTES_it);
}


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

x86 assembly (clang, -O2):
<d2i_OCSP_RESPBYTES>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_RESPBYTES_it = global i32 0
define i32* @d2i_OCSP_RESPBYTES(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_RESPBYTES_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_RESPBYTES_it = global i32 0
define i32* @d2i_OCSP_RESPBYTES(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_RESPBYTES_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int nth_position(int num, int position) { return ((num >> position) & 1); }


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
float get_percentage(unsigned long long total, unsigned long long hit) {
  return ((float)(hit * 100) / (total));
}


x86 assembly (clang, -O0):
<get_percentage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x64,%rax,%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    %rax,%rcx
shr    %rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
test   %rax,%rax
movss  %xmm0,-0x14(%rbp)
js     1145 <get_percentage+0x45>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     118c <get_percentage+0x8c>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_percentage>:
imul   $0x64,%rsi,%rax
test   %rax,%rax
js     112d <get_percentage+0x2d>
cvtsi2ss %rax,%xmm0
test   %rdi,%rdi
jns    113e <get_percentage+0x3e>
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm1
addss  %xmm1,%xmm1
divss  %xmm1,%xmm0
ret
shr    %rax
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
test   %rdi,%rdi
js     1113 <get_percentage+0x13>
cvtsi2ss %rdi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @get_percentage(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul i64 %5, 100
%7 = uitofp i64 %6 to float
%8 = load i64, i64* %3
%9 = uitofp i64 %8 to float
%10 = fdiv float %7, %9
ret float %10
}

LLVM IR (-O2):
define float @get_percentage(i64 %0, i64 %1) {
%3 = mul i64 %1, 100
%4 = uitofp i64 %3 to float
%5 = uitofp i64 %0 to float
%6 = fdiv float %4, %5
ret float %6
}
void t3() { __complex__ long long v = 2; }


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
movq   $0x2,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t3() {
%1 = alloca { i64, i64 }
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 1
store i64 2, i64* %2
store i64 0, i64* %3
ret void
}

LLVM IR (-O2):
define void @t3() {
ret void
}
void char_swap(char *a, char *b) {
  *a ^= *b;
  *b ^= *a;
  *a ^= *b;
}


x86 assembly (clang, -O0):
<char_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_swap>:
mov    (%rdi),%al
xor    (%rsi),%al
mov    %al,(%rdi)
xor    (%rsi),%al
mov    %al,(%rsi)
xor    %al,(%rdi)
ret

LLVM IR (-O0):
define void @char_swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = xor i32 %10, %7
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = xor i32 %18, %15
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = xor i32 %26, %23
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
ret void
}

LLVM IR (-O2):
define void @char_swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8, i8* %0
%5 = xor i8 %4, %3
store i8 %5, i8* %0
%6 = load i8, i8* %1
%7 = xor i8 %6, %5
store i8 %7, i8* %1
%8 = load i8, i8* %0
%9 = xor i8 %8, %7
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
float __ocml_add_rtz_f32(float, float);
float __fadd_rz(float x, float y) { return __ocml_add_rtz_f32(x, y); }


x86 assembly (clang, -O0):
<__fadd_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__ocml_add_rtz_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fadd_rz>:
jmp    1030 <__ocml_add_rtz_f32@plt>

LLVM IR (-O0):
define float @__fadd_rz(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__ocml_add_rtz_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fadd_rz(float %0, float %1) {
%3 = tail call float @__ocml_add_rtz_f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
size_t myStrlen(const char *s) {
  size_t n = 0;
  while (s[n] != '\0')
    n++;
  return n;
}


x86 assembly (clang, -O0):
<myStrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <myStrlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <myStrlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <myStrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @myStrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void a5bcdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @a5bcdefghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ overflow();
int main(void) {
  overflow();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @overflow()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void errorCheck(void *pointer, char *pointerName) {
  if (pointer == NULL) {
    printf("Não há memória suficiente para alocar %s. Saindo...\n",
           pointerName);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<errorCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <errorCheck+0x32>
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorCheck>:
test   %rdi,%rdi
je     1126 <errorCheck+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"N\C3\A3o h\C3\A1 mem\C3\B3ria suficiente para alocar %s. Saindo...\0A\00"
define void @errorCheck(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"N\C3\A3o h\C3\A1 mem\C3\B3ria suficiente para alocar %s. Saindo...\0A\00"
define void @errorCheck(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
ret void
}
void l2x0_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @l2x0_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int userinput1(void) {
  int a;
  system("clear");
  printf("Please enter your first positive integer: ");
  scanf("%d", &a);
  return a;
}


x86 assembly (clang, -O0):
<userinput1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userinput1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [43 x i8] c"Please enter your first positive integer: \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @userinput1() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [43 x i8] c"Please enter your first positive integer: \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @userinput1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
ret i32 %6
}
/* Type definitions */
struct xfs_dir2_data_hdr {
  int dummy;
};
struct xfs_dir2_data_entry {
  int dummy;
};

/* Variables and functions */
int xfs_dir3_data_dot_offset(struct xfs_dir2_data_hdr *);
struct xfs_dir2_data_entry *
xfs_dir3_data_dot_entry_p(struct xfs_dir2_data_hdr *hdr) {
  return (struct xfs_dir2_data_entry *)((char *)hdr +
                                        xfs_dir3_data_dot_offset(hdr));
}


x86 assembly (clang, -O0):
<xfs_dir3_data_dot_entry_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xfs_dir3_data_dot_offset@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_dir3_data_dot_entry_p>:
push   %rbx
mov    %rdi,%rbx
call   1030 <xfs_dir3_data_dot_offset@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_dot_entry_p(%struct.xfs_dir2_data_hdr* %0) {
%2 = alloca %struct.xfs_dir2_data_hdr*
store %struct.xfs_dir2_data_hdr* %0, %struct.xfs_dir2_data_hdr** %2
%3 = load %struct.xfs_dir2_data_hdr*, %struct.xfs_dir2_data_hdr** %2
%4 = bitcast %struct.xfs_dir2_data_hdr* %3 to i8*
%5 = load %struct.xfs_dir2_data_hdr*, %struct.xfs_dir2_data_hdr** %2
%6 = call i32 @xfs_dir3_data_dot_offset(%struct.xfs_dir2_data_hdr* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = bitcast i8* %8 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %9
}

LLVM IR (-O2):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_dot_entry_p(%struct.xfs_dir2_data_hdr* %0) {
%2 = bitcast %struct.xfs_dir2_data_hdr* %0 to i8*
%3 = tail call i32 @xfs_dir3_data_dot_offset(%struct.xfs_dir2_data_hdr* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %6
}
/* Variables and functions */
float fabsf(float);
float fabsolute(float _a) { return fabsf(_a); }


x86 assembly (clang, -O0):
<fabsolute>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsolute>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fabsolute(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fabs.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @fabsolute(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *xstrsignal(int n) {
  static char buf[sizeof("Signal ") + 1 + sizeof(int) * 3];
  sprintf(buf, "Signal %d", n);
  return buf;
}


x86 assembly (clang, -O0):
<xstrsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrsignal>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@xstrsignal.buf = internal global [21 x i8] zeroinitializer
@.str = [10 x i8] c"Signal %d\00"
define i8* @xstrsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @xstrsignal.buf, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @xstrsignal.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@xstrsignal.buf = internal global [21 x i8] zeroinitializer
@.str = [10 x i8] c"Signal %d\00"
define i8* @xstrsignal(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @xstrsignal.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @xstrsignal.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module() {
  printk("init_module\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"init_module\0A\00"
define i32 @init_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"init_module\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float test_modff(float x, float *y) { return __builtin_modff(x, y); }


x86 assembly (clang, -O0):
<test_modff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <modff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_modff>:
jmp    1030 <modff@plt>

LLVM IR (-O0):
define float @test_modff(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = call float @modff(float %5, float* %6)
ret float %7
}

LLVM IR (-O2):
define float @test_modff(float %0, float* nocapture %1) {
%3 = tail call float @modff(float %0, float* %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x72() {
  Assert_real((islower(114)),
              "/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_islower.c",
              575, ("islower should be 1 for r"));
}


x86 assembly (clang, -O0):
<t_islower_0x72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23f,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for r\00"
define void @t_islower_0x72() {
%1 = call i32 @islower(i32 114)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for r\00"
define void @t_islower_0x72() {
%1 = tail call i32 @islower(i32 114)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(unsigned char const *, unsigned char *, int);
int cdiUUIDIsNull(const unsigned char uuid[16]) {
  static unsigned char uuid_nil[16];
  return !memcmp(uuid, uuid_nil, 16);
}


x86 assembly (clang, -O0):
<cdiUUIDIsNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f19(%rip),%rsi
mov    $0x10,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiUUIDIsNull>:
push   %rax
lea    0x2f28(%rip),%rsi
mov    $0x10,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@cdiUUIDIsNull.uuid_nil = internal global [16 x i8] zeroinitializer
define i32 @cdiUUIDIsNull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memcmp(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @cdiUUIDIsNull.uuid_nil, i64 0, i64 0), i32 16)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@cdiUUIDIsNull.uuid_nil = internal global [16 x i8] zeroinitializer
define i32 @cdiUUIDIsNull(i8* %0) {
%2 = tail call i32 @memcmp(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @cdiUUIDIsNull.uuid_nil, i64 0, i64 0), i32 16)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
long exec_getconf(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, long,
                           long);
int /*<<< orphan*/ stderr;
unsigned int do_check(char const *var, long exp) {
  long cur = exec_getconf(var);
  if (cur != exp) {
    fprintf(stderr, "%s mismatch: got %ld, expected %ld\n", var, cur, exp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <exec_getconf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1178 <do_check+0x58>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117f <do_check+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_check>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <exec_getconf@plt>
xor    %ecx,%ecx
cmp    %r14,%rax
je     1159 <do_check+0x39>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeba(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %r14,%r8
call   1030 <fprintf@plt>
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"%s mismatch: got %ld, expected %ld\0A\00"
define i32 @do_check(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = call i64 @exec_getconf(i8* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %4
%15 = load i64, i64* %6
%16 = load i64, i64* %5
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %14, i64 %15, i64 %16)
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"%s mismatch: got %ld, expected %ld\0A\00"
define i32 @do_check(i8* %0, i64 %1) {
%3 = tail call i64 @exec_getconf(i8* %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %3, i64 %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int tgaReadUChar(FILE *f, unsigned char *c) { return fread(c, 1, 1, f) == 1; }


x86 assembly (clang, -O0):
<tgaReadUChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgaReadUChar>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tgaReadUChar(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @fread(i8* %5, i32 1, i32 1, i32* %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @tgaReadUChar(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fread(i8* %1, i32 1, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
void Heater(int heatercmd) {}


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

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

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

LLVM IR (-O2):
define void @Heater(i32 %0) {
ret void
}
/* Variables and functions */
double atof(char *);
scalar_t__ double_virtually_same(double, double);
int /*<<< orphan*/ sprintf(char *, char *, double);
double round_money(double d) {
  char string[32];
  if (double_virtually_same(d, 0.0))
    return 0.0;
  sprintf(string, "%.2lf", d);
  return atof(string);
}


x86 assembly (clang, -O0):
<round_money>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1040 <double_virtually_same@plt>
cmp    $0x0,%rax
je     1161 <round_money+0x31>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <round_money+0x54>
lea    -0x30(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xe8f(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_money>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm1,%xmm1
movsd  %xmm0,0x8(%rsp)
call   1040 <double_virtually_same@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    116d <round_money+0x3d>
lea    0xeae(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2lf\00"
define double @round_money(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca [32 x i8]
store double %0, double* %3
%5 = load double, double* %3
%6 = call i64 @double_virtually_same(double %5, double 0.000000e+00)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %15
9: ; preds = %1
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%11 = load double, double* %3
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%14 = call double @atof(i8* %13)
store double %14, double* %2
br label %15
15: ; preds = %9, %8
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2lf\00"
define double @round_money(double %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @double_virtually_same(double %0, double 0.000000e+00)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
%8 = call double @atof(i8* %3)
br label %9
9: ; preds = %1, %6
%10 = phi double [ %8, %6 ], [ 0.000000e+00, %1 ]
ret double %10
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t max32(int32_t v1, int32_t v2) { return v1 > v2 ? v1 : v2; }


x86 assembly (clang, -O0):
<max32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t roundup_pow2(uint32_t value) {
  --value;
  value |= value >> 1;
  value |= value >> 2;
  value |= value >> 4;
  value |= value >> 8;
  value |= value >> 16;
  ++value;
  return value;
}


x86 assembly (clang, -O0):
<roundup_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_pow2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @roundup_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @roundup_pow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
int isValidCell(int row, int col, int numRow, int numCol) {
  if (row < 0 || col < 0 || row >= numRow || col >= numCol)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isValidCell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113c <isValidCell+0x3c>
cmpl   $0x0,-0xc(%rbp)
jl     113c <isValidCell+0x3c>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113c <isValidCell+0x3c>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1148 <isValidCell+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <isValidCell+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidCell>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    %edx,%edi
setl   %dl
and    %al,%dl
cmp    %ecx,%esi
setl   %al
and    %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isValidCell(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = or i32 %1, %0
%6 = icmp sgt i32 %5, -1
%7 = icmp slt i32 %0, %2
%8 = and i1 %6, %7
%9 = icmp slt i32 %1, %3
%10 = and i1 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double salary = 0.0;
  double imp = 0.0;
  double grt = 0.0;
  scanf("%lf", &salary);
  imp = salary * 0.07;
  grt = salary * 0.05;
  printf("%.2lf\n", salary - imp + grt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xea9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = fmul double %6, 7.000000e-02
store double %7, double* %3
%8 = load double, double* %2
%9 = fmul double %8, 5.000000e-02
store double %9, double* %4
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = load double, double* %4
%14 = fadd double %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 7.000000e-02
%6 = fmul double %4, 5.000000e-02
%7 = fsub double %4, %5
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printInventoryEmpty(void) {
  printf("\nThe bookstore inventory is empty.\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"\0AThe bookstore inventory is empty.\0A\00"
define void @printInventoryEmpty() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"\0AThe bookstore inventory is empty.\00"
define void @printInventoryEmpty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}