xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ceil(size_t);
size_t EstimateBas64EncodedDataSizeFHS(size_t inDataSize) {
  size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;
  theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;
  return (theEncodedDataSize);
}


x86 assembly (clang, -O0):
<EstimateBas64EncodedDataSizeFHS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x4a,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EstimateBas64EncodedDataSizeFHS>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
movslq %eax,%rcx
movabs $0xe38e38e38e38e38f,%rdx
38 8e e3
mov    %rcx,%rax
mul    %rdx
shr    $0x6,%rdx
imul   $0x4a,%rdx,%rax
shl    $0x3,%rdx
lea    (%rdx,%rdx,8),%rdx
sub    %rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @EstimateBas64EncodedDataSizeFHS(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 3.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 4
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = udiv i64 %12, 72
%14 = mul i64 %13, 74
%15 = load i64, i64* %3
%16 = urem i64 %15, 72
%17 = add i64 %14, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @EstimateBas64EncodedDataSizeFHS(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fdiv double %2, 3.000000e+00
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = trunc i64 %5 to i32
%7 = shl nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 72
%10 = mul i64 %9, 74
%11 = urem i64 %8, 72
%12 = add i64 %10, %11
ret i64 %12
}
int vde_chain_nm2_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm2_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <vde_chain_nm2_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm2_alloc>:
test   %rdi,%rdi
je     110c <vde_chain_nm2_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm2_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
int mappedFreq(int ind) {
  if (ind < 40) {
    return ind * 2;
  } else {
    return ((ind - 39) * 2) - 1;
  }
}


x86 assembly (clang, -O0):
<mappedFreq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x28,-0x8(%rbp)
jge    111f <mappedFreq+0x1f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <mappedFreq+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x27,%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mappedFreq>:
lea    (%rdi,%rdi,1),%ecx
cmp    $0x28,%edi
lea    -0x4f(%rdi,%rdi,1),%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mappedFreq(i32 %0) {
%2 = icmp slt i32 %0, 40
%3 = shl i32 %0, 1
%4 = add i32 %3, -79
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
const unsigned long long int clock_tic_() {
  unsigned long long int x;
  __asm__ volatile("rdtsc\n" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @clock_tic_() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc\0A", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @clock_tic_() {
%1 = tail call i64 asm sideeffect "rdtsc\0A", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int findGapBetweenOnes(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int N = 74901729;
  printf("find gap between ones for %d : %d\n", N, findGapBetweenOnes(N));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x476e8e1,%edi
call   1040 <findGapBetweenOnes@plt>
lea    0xece(%rip),%rdi
mov    $0x476e8e1,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"find gap between ones for %d : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 74901729, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @findGapBetweenOnes(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"find gap between ones for %d : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @findGapBetweenOnes(i32 74901729)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 74901729, i32 %1)
ret i32 0
}
int test_imm_E8int32_reg(int val) { return ((val) & (0xE8 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_E8int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E8int32_reg>:
test   $0xe8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E8int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 232
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_E8int32_reg(i32 %0) {
%2 = and i32 %0, 232
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void SLLIB_closeSocket(int *sock) { close(*sock); }


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

x86 assembly (clang, -O2):
<SLLIB_closeSocket>:
mov    (%rdi),%edi
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @SLLIB_closeSocket(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
ret void
}
/* Variables and functions */
void *alloc(unsigned long);
void *allocate(unsigned long n, unsigned a) { return alloc(n); }


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

x86 assembly (clang, -O2):
<allocate>:
jmp    1030 <alloc@plt>

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

LLVM IR (-O2):
define i8* @allocate(i64 %0, i32 %1) {
%3 = tail call i8* @alloc(i64 %0)
ret i8* %3
}
void commandO() { return; }


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

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

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

LLVM IR (-O2):
define void @commandO() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_CRIT;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ logx(int /*<<< orphan*/, char *, char const *, unsigned int,
                        char const *, void const *, unsigned int, unsigned int);
void __dm_magic_assert_fail(const char *field, const void *ptr,
                            unsigned int expected, unsigned int got,
                            unsigned int line, const char *function) {
  logx(LOG_CRIT, "invalid magic at %s:%d, %s(%p): %08x != %08x", function, line,
       field, ptr, got, expected);
  abort();
}


x86 assembly (clang, -O0):
<__dm_magic_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%r10d
mov    -0x14(%rbp),%eax
lea    0xe9c(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <logx@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__dm_magic_assert_fail>:
push   %rbx
mov    %ecx,%r10d
mov    %edx,%r11d
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%edi
lea    0xec3(%rip),%rsi
mov    %r9,%rdx
mov    %r8d,%ecx
mov    %rbx,%r8
mov    %rax,%r9
push   %r11
push   %r10
call   1040 <logx@plt>
add    $0x10,%rsp
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@LOG_CRIT = global i32 0
@.str = [45 x i8] c"invalid magic at %s:%d, %s(%p): %08x != %08x\00"
define void @__dm_magic_assert_fail(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i32, i32* @LOG_CRIT
%14 = load i8*, i8** %12
%15 = load i32, i32* %11
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = load i32, i32* %10
%19 = load i32, i32* %9
%20 = call i32 @logx(i32 %13, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i8* %17, i32 %18, i32 %19)
%21 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@LOG_CRIT = global i32 0
@.str = [45 x i8] c"invalid magic at %s:%d, %s(%p): %08x != %08x\00"
define void @__dm_magic_assert_fail(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = load i32, i32* @LOG_CRIT
%8 = tail call i32 @logx(i32 %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %4, i8* %0, i8* %1, i32 %3, i32 %2)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *argv0) {
  char *r = strrchr(argv0, '/');
  return r ? (r + 1) : argv0;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void printchar(char **str, int c) {
  extern int port_putchar(int c);
  if (str) {
    **str = (char)c;
    ++(*str);
  } else {
    (void)port_putchar(c);
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <port_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <port_putchar@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @port_putchar(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @port_putchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ foo();
void f(int x) {
  while (x % 5) {
    x += foo();
    if (x % 7)
      exit(-1);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1176 <f+0x56>
mov    $0x0,%al
call   1030 <foo@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1171 <f+0x51>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    112b <f+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   $0xcccccccd,%ebx,%eax
add    $0x19999999,%eax
cmp    $0x33333333,%eax
jb     1167 <f+0x47>
xor    %eax,%eax
call   1030 <foo@plt>
add    %eax,%ebx
imul   $0xb6db6db7,%ebx,%eax
add    $0x12492492,%eax
cmp    $0x24924925,%eax
jb     1130 <f+0x10>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %18, %1
%4 = load i32, i32* %2
%5 = srem i32 %4, 5
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = call i64 (...) @foo()
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = srem i32 %13, 7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %7
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %7
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %9, %6 ]
%4 = srem i32 %3, 5
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = tail call i64 (...) @foo()
%8 = trunc i64 %7 to i32
%9 = add i32 %3, %8
%10 = srem i32 %9, 7
%11 = icmp eq i32 %10, 0
br i1 %11, label %2, label %12
12: ; preds = %6
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, char);
main() {
  unsigned char x;
  signed char y;
  y = 5001;
  x = 5001;
  printf("%d %d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x89,-0x2(%rbp)
movb   $0x89,-0x1(%rbp)
mov    -0x1(%rbp),%al
lea    0xed6(%rip),%rdi
movzbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext -119, i8 signext -119)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ PROXY_POLICY;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PROXY_POLICY_it;
int i2d_PROXY_POLICY(PROXY_POLICY *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PROXY_POLICY_it);
}


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

x86 assembly (clang, -O2):
<i2d_PROXY_POLICY>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@PROXY_POLICY_it = global i32 0
define i32 @i2d_PROXY_POLICY(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PROXY_POLICY_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func_7(int, char *, unsigned long);
void func_6(int a, char *b, unsigned long c) { func_7(a, b, c); }


x86 assembly (clang, -O0):
<func_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <func_7@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_6>:
jmp    1030 <func_7@plt>

LLVM IR (-O0):
define void @func_6(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 i32 @func_7(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @func_6(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_7(i32 %0, i8* %1, i64 %2)
ret void
}
int umount(s)
char *s;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @umount(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, int);
void rk29_sdmmc_gpio_open(int device_id, int on) {
  printk("********rk29_sdmmc_gpio_open device_id=%d**********nition\n",
         device_id);
  switch (device_id) {
  case 0: {
  } break;
  case 1: {
  } break;
  case 2:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<rk29_sdmmc_gpio_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1162 <rk29_sdmmc_gpio_open+0x52>
jmp    1140 <rk29_sdmmc_gpio_open+0x30>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1167 <rk29_sdmmc_gpio_open+0x57>
jmp    1151 <rk29_sdmmc_gpio_open+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116c <rk29_sdmmc_gpio_open+0x5c>
jmp    1171 <rk29_sdmmc_gpio_open+0x61>
jmp    1176 <rk29_sdmmc_gpio_open+0x66>
jmp    1176 <rk29_sdmmc_gpio_open+0x66>
jmp    1176 <rk29_sdmmc_gpio_open+0x66>
jmp    1176 <rk29_sdmmc_gpio_open+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rk29_sdmmc_gpio_open>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"********rk29_sdmmc_gpio_open device_id=%d**********nition\0A\00"
define void @rk29_sdmmc_gpio_open(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 = call i32 @printk(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
switch i32 %7, label %11 [
i32 0, label %8
i32 1, label %9
i32 2, label %10
]
8: ; preds = %2
br label %12
9: ; preds = %2
br label %12
10: ; preds = %2
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %10, %9, %8
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"********rk29_sdmmc_gpio_open device_id=%d**********nition\0A\00"
define void @rk29_sdmmc_gpio_open(i32 %0, i32 %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_insert_pi16(int /*<<< orphan*/, int, int);
__m64 __mm_insert_pi16(__m64 A, int B, int const I) {
  return _mm_insert_pi16(A, B, 1);
}


x86 assembly (clang, -O0):
<__mm_insert_pi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <_mm_insert_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mm_insert_pi16>:
mov    $0x1,%edx
jmp    1030 <_mm_insert_pi16@plt>

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

LLVM IR (-O2):
define i32 @__mm_insert_pi16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_insert_pi16(i32 %0, i32 %1, i32 1)
ret i32 %4
}
/* Type definitions */
struct bufstate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __putc(int /*<<< orphan*/, struct bufstate *);
void __puts(char *s, struct bufstate *b) {
  while (*s != '\0')
    __putc(*s++, b);
}


x86 assembly (clang, -O0):
<__puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <__puts+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__putc@plt>
jmp    1120 <__puts+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <__puts+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <__putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <__puts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bufstate = type { i32 }
define void @__puts(i8* %0, %struct.bufstate* %1) {
%3 = alloca i8*
%4 = alloca %struct.bufstate*
store i8* %0, i8** %3
store %struct.bufstate* %1, %struct.bufstate** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = load %struct.bufstate*, %struct.bufstate** %4
%16 = call i32 @__putc(i32 %14, %struct.bufstate* %15)
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.bufstate = type { i32 }
define void @__puts(i8* nocapture %0, %struct.bufstate* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @__putc(i32 %8, %struct.bufstate* %1)
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ad_reset_buff(int, int);
int /*<<< orphan*/ ad_reset_token_bound(int, int);
int /*<<< orphan*/ set_rtc_date(int);
int cmd_reset_dev(int dev) {
  set_rtc_date(dev);
  ad_reset_token_bound(1, dev);
  ad_reset_buff(1, dev);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_reset_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <set_rtc_date@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1050 <ad_reset_token_bound@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <ad_reset_buff@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_reset_dev>:
push   %rbx
mov    %edi,%ebx
call   1040 <set_rtc_date@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1050 <ad_reset_token_bound@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <ad_reset_buff@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cmd_reset_dev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_rtc_date(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ad_reset_token_bound(i32 1, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @ad_reset_buff(i32 1, i32 %7)
ret i32 1
}

LLVM IR (-O2):
define i32 @cmd_reset_dev(i32 %0) {
%2 = tail call i32 @set_rtc_date(i32 %0)
%3 = tail call i32 @ad_reset_token_bound(i32 1, i32 %0)
%4 = tail call i32 @ad_reset_buff(i32 1, i32 %0)
ret i32 1
}
void INT_Excep_MTU9_TGIA9(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU9_TGIA9() {
ret void
}
void change_failed_names() {}


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

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

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

LLVM IR (-O2):
define void @change_failed_names() {
ret void
}
int ccstrlen(char *str) {
  int size = 0;
  while (*(str++) != 0)
    size++;
  return size;
}


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

x86 assembly (clang, -O2):
<ccstrlen>:
cmpb   $0x0,(%rdi)
je     111c <ccstrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ccstrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ccstrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int has_atomic_file_replace(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @has_atomic_file_replace() {
ret i32 1
}
/* Variables and functions */
float third(float, int);
void finalcostCost(float gallon, int size, float *cost) {
  (*cost) = third(gallon, size);
}


x86 assembly (clang, -O0):
<finalcostCost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <third@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalcostCost>:
push   %rbx
mov    %rsi,%rbx
call   1030 <third@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @finalcostCost(float %0, i32 %1, float* %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float*
store float %0, float* %4
store i32 %1, i32* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load i32, i32* %5
%9 = call float @third(float %7, i32 %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @finalcostCost(float %0, i32 %1, float* nocapture writeonly %2) {
%4 = tail call float @third(float %0, i32 %1)
store float %4, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strnew(int /*<<< orphan*/);
char *ft_strdup(const char *s1) {
  char *dst;
  dst = ft_strnew(ft_strlen(s1));
  if (dst != 0)
    ft_strcpy(dst, s1);
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,%edi
call   1050 <ft_strnew@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <ft_strdup+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <ft_strlen@plt>
mov    %eax,%edi
call   1050 <ft_strnew@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1156 <ft_strdup+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i8* @ft_strnew(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @ft_strcpy(i8* %10, i8* %11)
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i8* @ft_strnew(i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @ft_strcpy(i8* %3, i8* %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void awesome(char *a, char *b) {
  printf(".");
  return;
}


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

x86 assembly (clang, -O2):
<awesome>:
mov    $0x2e,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @awesome(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 46)
ret void
}
void _getch(void) {}


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

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

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

LLVM IR (-O2):
define void @_getch() {
ret void
}
int f9(int x) { return x * 9; }


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
lea    (%rdi,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @f9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 9
ret i32 %4
}

LLVM IR (-O2):
define i32 @f9(i32 %0) {
%2 = mul nsw i32 %0, 9
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void delay(int nDelayMilliSeconds) {
  time_t start, now;
  double elapsedSeconds;
  int nDelaySeconds = nDelayMilliSeconds / 1000;
  time(&start);
  do {
    time(&now);
    elapsedSeconds = difftime(now, start);
  } while (elapsedSeconds < nDelaySeconds);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <difftime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x1c(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1142 <delay+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
sub    $0x10,%rsp
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x26,%rbx
add    %eax,%ebx
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <time@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <difftime@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1160 <delay+0x40>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 1000
store i32 %8, i32* %6
%9 = call i32 @time(i32* %3)
br label %10
10: ; preds = %15, %1
%11 = call i32 @time(i32* %4)
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = call double @difftime(i32 %12, i32 %13)
store double %14, double* %5
br label %15
15: ; preds = %10
%16 = load double, double* %5
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fcmp olt double %16, %18
br i1 %19, label %10, label %20
20: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = sdiv i32 %0, 1000
%7 = call i32 @time(i32* %2)
%8 = sitofp i32 %6 to double
br label %9
9: ; preds = %9, %1
%10 = call i32 @time(i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call double @difftime(i32 %11, i32 %12)
%14 = fcmp olt double %13, %8
br i1 %14, label %9, label %15
15: ; preds = %9
ret void
}
int test_imm_DCuint32_mem(unsigned int *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xdc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCuint32_mem>:
testb  $0xdc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DCuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 220
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_DCuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 220
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xcc() {
  Assert_real((isbdigit(204) == 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_isbdigit.c",
              1025, ("isbdigit should be 0 for 0xcc"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x401,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xcc\00"
define void @t_isbdigit_0xcc() {
%1 = call i64 @isbdigit(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xcc\00"
define void @t_isbdigit_0xcc() {
%1 = tail call i64 @isbdigit(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *bar(void *);
int /*<<< orphan*/ foo();
void *thread_first(void *arg) {
  foo();
  return bar(arg);
}


x86 assembly (clang, -O0):
<thread_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_first>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i8* @thread_first(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @foo()
%4 = load i8*, i8** %2
%5 = call i8* @bar(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @thread_first(i8* %0) {
%2 = tail call i32 (...) @foo()
%3 = tail call i8* @bar(i8* %0)
ret i8* %3
}
void view_makeAStackFromFile(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ uart_print_string(char *, int);
int _write_r(struct _reent *r, int file, char *ptr, int len) {
  r = r;
  file = file;
  ptr = ptr;
  uart_print_string(ptr, len);
  return len;
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <uart_print_string@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_r>:
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%rdi
mov    %ecx,%esi
call   1030 <uart_print_string@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct._reent*, %struct._reent** %5
store %struct._reent* %9, %struct._reent** %5
%10 = load i32, i32* %6
store i32 %10, i32* %6
%11 = load i8*, i8** %7
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @uart_print_string(i8* %12, i32 %13)
%15 = load i32, i32* %8
ret i32 %15
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* %2, i32 returned %3) {
%5 = tail call i32 @uart_print_string(i8* %2, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int strlen(char *);
void printChars(char *str) {
  int i, strLength = strlen(str);
  for (i = 0; i <= strLength - 1; i++) {
    printf("str[%d] char: %c\n", i, str[i]);
  }
}


x86 assembly (clang, -O0):
<printChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1179 <printChars+0x59>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe9e(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <printChars+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChars>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1158 <printChars+0x38>
mov    %eax,%r12d
xor    %ebx,%ebx
lea    0xec0(%rip),%r15
movsbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printChars+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"str[%d] char: %c\0A\00"
define void @printChars(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp sle i32 %8, %10
br i1 %11, label %12, label %23
12: ; preds = %7
%13 = load i32, i32* %3
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13, i8 signext %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"str[%d] char: %c\0A\00"
define void @printChars(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}
/* Variables and functions */
unsigned int read_from_address(int);
int /*<<< orphan*/ write_to_address(int, unsigned int);
void led_init() {
  unsigned int register_a;
  register_a = read_from_address(0x3F200010);
  register_a |= (1 << 21);
  write_to_address(0x3F200010, register_a);
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3f200010,%edi
call   1030 <read_from_address@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x200000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3f200010,%edi
call   1040 <write_to_address@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
push   %rax
mov    $0x3f200010,%edi
call   1030 <read_from_address@plt>
or     $0x200000,%eax
mov    $0x3f200010,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <write_to_address@plt>

LLVM IR (-O0):
define void @led_init() {
%1 = alloca i32
%2 = call i32 @read_from_address(i32 1059061776)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 2097152
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @write_to_address(i32 1059061776, i32 %5)
ret void
}

LLVM IR (-O2):
define void @led_init() {
%1 = tail call i32 @read_from_address(i32 1059061776)
%2 = or i32 %1, 2097152
%3 = tail call i32 @write_to_address(i32 1059061776, i32 %2)
ret void
}