xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ insertion_sort_one(int *, int);
int /*<<< orphan*/ print_arr(int *, int);
int main() {
  int arr[] = {2, 4, 6, 8, 3};
  print_arr(arr, 5);
  insertion_sort_one(arr, 5);
  print_arr(arr, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <print_arr@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <insertion_sort_one@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insertion_sort_one@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 2, i32 4, i32 6, i32 8, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @print_arr(i32* %4, i32 5)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @insertion_sort_one(i32* %6, i32 5)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @print_arr(i32* %8, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 2, i32 4, i32 6, i32 8, i32 3]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_arr(i32* %3, i32 5)
%5 = call i32 @insertion_sort_one(i32* %3, i32 5)
%6 = call i32 @print_arr(i32* %3, i32 5)
ret i32 0
}
int codegen_timing_winchip_jump_cycles() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @codegen_timing_winchip_jump_cycles() {
ret i32 0
}
double compute_bisector_slope(double slope) {
  double bisector = 0.0;
  bisector = -1 / slope;
  return bisector;
}


x86 assembly (clang, -O0):
<compute_bisector_slope>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee7(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_bisector_slope>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @compute_bisector_slope(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fdiv double -1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @compute_bisector_slope(double %0) {
%2 = fdiv double -1.000000e+00, %0
ret double %2
}
indirect(typeobj) char typeobj;
{
  if (typeobj == 1)
    call("ccgchar");
  else
    call("ccgint");
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    113e <indirect+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <call@plt>
jmp    114c <indirect+0x3c>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
cmp    $0x1,%dil
lea    0xee5(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <call@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ccgchar\00"
@.str.1 = [7 x i8] c"ccgint\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"ccgchar\00"
@.str.1 = [7 x i8] c"ccgint\00"
define i32 @indirect(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @call to i32 (i8*, ...)*)(i8* %4)
ret i32 undef
}
/* Variables and functions */
int strcasecmp(char *, char *);
int Q_stricmp(char *s1, char *s2) { return strcasecmp(s1, s2); }


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

x86 assembly (clang, -O2):
<Q_stricmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @Q_stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ setup();
int main() { setup(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @setup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
ret i32 0
}
/* Variables and functions */
unsigned long long udivmoddi4(unsigned long long, unsigned long long, int);
unsigned long long __umoddi3(unsigned long long a, unsigned long long b) {
  return udivmoddi4(a, b, 1);
}


x86 assembly (clang, -O0):
<__umoddi3>:
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    $0x1,%edx
call   1030 <udivmoddi4@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__umoddi3(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 = call i64 @udivmoddi4(i64 %5, i64 %6, i32 1)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @udivmoddi4(i64 %0, i64 %1, i32 1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_slice_buffer_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_slice_buffer_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_slice_buffer_destroy>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_filled_circle(int /*<<< orphan*/, float, float, float);
void g2_filled_circle_(float *dev, float *x, float *y, float *r) {
  g2_filled_circle(dtoi(*dev), *x, *y, *r);
}


x86 assembly (clang, -O0):
<g2_filled_circle_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
call   1040 <g2_filled_circle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_filled_circle_>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r15),%xmm1
movss  (%r14),%xmm2
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <g2_filled_circle@plt>

LLVM IR (-O0):
define void @g2_filled_circle_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = load float, float* %9
%11 = call i32 @dtoi(float %10)
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = call i32 @g2_filled_circle(i32 %11, float %13, float %15, float %17)
ret void
}

LLVM IR (-O2):
define void @g2_filled_circle_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load float, float* %0
%6 = tail call i32 @dtoi(float %5)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = load float, float* %3
%10 = tail call i32 @g2_filled_circle(i32 %6, float %7, float %8, float %9)
ret void
}
const char *fpp_config_get_default_plugin_descr(void) {
  return "libpdf.so frontend";
}


x86 assembly (clang, -O0):
<fpp_config_get_default_plugin_descr>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_config_get_default_plugin_descr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"libpdf.so frontend\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"libpdf.so frontend\00"
define i8* @fpp_config_get_default_plugin_descr() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void formato_hora(int *horas, int *minutos, int *segundos) {
  *horas = *segundos / 3600;
  *minutos = (*segundos / 60) % 60;
  *segundos = *segundos % 60;
}


x86 assembly (clang, -O0):
<formato_hora>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<formato_hora>:
movslq (%rdx),%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0xb,%ecx
add    %eax,%ecx
mov    %ecx,(%rdi)
movslq (%rdx),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x5,%ecx
add    %edi,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rsi)
movslq (%rdx),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
sar    $0x5,%ecx
add    %esi,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @formato_hora(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** %6
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 3600
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 60
%14 = srem i32 %13, 60
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = srem i32 %17, 60
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @formato_hora(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3600
store i32 %5, i32* %0
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 60
%8 = srem i32 %7, 60
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 60
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
char *rumStrcat(char *str1, char *str2) {
  char *cat = malloc(strlen(str1) + strlen(str2) + 1);
  cat[0] = '\0';
  strcat(cat, str1);
  strcat(cat, str2);
  return cat;
}


x86 assembly (clang, -O0):
<rumStrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rumStrcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %rax,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rumStrcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @rumStrcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
store i8 0, i8* %7
%8 = tail call i32 @strcat(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
unsigned get_char_count(FILE *fp) {
  unsigned char_count = 0;
  char c = '\0';
  while ((c = fgetc(fp)) != EOF) {
    char_count++;
  }
  rewind(fp);
  return char_count;
}


x86 assembly (clang, -O0):
<get_char_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0xd(%rbp)
movsbl %al,%eax
mov    0x2e9b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1166 <get_char_count+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <get_char_count+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_count>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2eb4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <fgetc@plt>
add    $0x1,%ebx
cmp    (%r15),%al
jne    1140 <get_char_count+0x20>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @get_char_count(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
store i32* %0, i32** %2
store i32 0, i32* %3
store i8 0, i8* %4
br label %5
5: ; preds = %12, %1
%6 = load i32*, i32** %2
%7 = call signext i8 @fgetc(i32* %6)
store i8 %7, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32*, i32** %2
%17 = call i32 @rewind(i32* %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @get_char_count(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
%7 = add i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = tail call i32 @rewind(i32* %0)
ret i32 %3
}
unsigned short myhtons(unsigned short port) {
  return (port << 8) | (port >> 8);
}


x86 assembly (clang, -O0):
<myhtons>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myhtons>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @myhtons(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @myhtons(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int sites() {
  int o = 1;
  for (int i = 0; i < 4; i++)
    o *= 16;
  return o;
}


x86 assembly (clang, -O0):
<sites>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1133 <sites+0x33>
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <sites+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sites() {
ret i32 65536
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void tracer_cond_flush(void *t) { fprintf(stdout, "Conditional flush\n"); }


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

x86 assembly (clang, -O2):
<tracer_cond_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"Conditional flush\0A\00"
define void @tracer_cond_flush(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"Conditional flush\0A\00"
define void @tracer_cond_flush(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
int of_property_read_string(struct device_node *np, const char *propname,
                            const char **out_string) {
  return -38;
}


x86 assembly (clang, -O0):
<of_property_read_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffda,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i32 @of_property_read_string(%struct.device_node* %0, i8* %1, i8** %2) {
%4 = alloca %struct.device_node*
%5 = alloca i8*
%6 = alloca i8**
store %struct.device_node* %0, %struct.device_node** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
ret i32 -38
}

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_property_read_string(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 -38
}
int devlib_process_remove(struct devlib_process *process, int index) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.devlib_process = type opaque
define i32 @devlib_process_remove(%struct.devlib_process* %0, i32 %1) {
%3 = alloca %struct.devlib_process*
%4 = alloca i32
store %struct.devlib_process* %0, %struct.devlib_process** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.devlib_process = type opaque
define i32 @devlib_process_remove(%struct.devlib_process* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ endswap16(int /*<<< orphan*/);
scalar_t__ is_little_endian();
uint16_t be16_to_cpu(uint16_t x) {
  uint16_t ret = x;
  if (is_little_endian()) {
    ret = endswap16(x);
  }
  return ret;
}


x86 assembly (clang, -O0):
<be16_to_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114d <be16_to_cpu+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <endswap16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16_to_cpu>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <be16_to_cpu+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <endswap16@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @be16_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = call i64 (...) @is_little_endian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @endswap16(i32 %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @be16_to_cpu(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @endswap16(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
int age(int n) {
  if (1 == n)
    return 10;
  else
    return (age(n - 1) + 2);
}


x86 assembly (clang, -O0):
<age>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1135 <age+0x25>
movl   $0xa,-0x4(%rbp)
jmp    1146 <age+0x36>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <age@plt>
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<age>:
cmp    $0x1,%edi
lea    0x8(%rdi,%rdi,1),%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @age(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = shl i32 %0, 1
%4 = add i32 %3, 8
%5 = select i1 %2, i32 10, i32 %4
ret i32 %5
}
int hisi_adc_get_adc(int adc_channel) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @hisi_adc_get_adc(i32 %0) {
ret i32 -1
}
void lockup() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<lockup>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <lockup+0x9>
jmp    1109 <lockup+0x9>

x86 assembly (clang, -O2):
<lockup>:
jmp    1100 <lockup>

LLVM IR (-O0):
define void @lockup() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @lockup() {
br label %1
1: ; preds = %1, %0
br label %1
}
int pow2check(long N) {
  long n = N;
  while (n > 1) {
    if (n % 2)
      return 0;
    n = n / 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<pow2check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jle    1156 <pow2check+0x56>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     113f <pow2check+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    115d <pow2check+0x5d>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    1110 <pow2check+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2check>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1125 <pow2check+0x25>
nopl   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    1126 <pow2check+0x26>
mov    %rdi,%rcx
shr    %rcx
cmp    $0x4,%rdi
mov    %rcx,%rdi
jae    1110 <pow2check+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pow2check(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %6, label %10
3: ; preds = %6
%4 = lshr i64 %7, 1
%5 = icmp ugt i64 %7, 3
br i1 %5, label %6, label %10
6: ; preds = %1, %3
%7 = phi i64 [ %4, %3 ], [ %0, %1 ]
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %11
}
int _singularity_runtime_enter(void) {
  int retval = 0;
  _singularity_message(
      2, __func__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/src/"
      "lib/runtime/enter/enter.c",
      41, "Containing all rootfs components\n");
  retval += _singularity_runtime_enter_chroot();
  return (retval);
}


x86 assembly (clang, -O0):
<_singularity_runtime_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xec5(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    $0x29,%ecx
lea    0xf6c(%rip),%r8
mov    $0x0,%al
call   1030 <_singularity_message@plt>
mov    $0x0,%al
call   1040 <_singularity_runtime_enter_chroot@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_singularity_runtime_enter>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xeec(%rip),%rdx
lea    0xf84(%rip),%r8
mov    $0x2,%edi
mov    $0x29,%ecx
xor    %eax,%eax
call   1030 <_singularity_message@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_singularity_runtime_enter_chroot@plt>

LLVM IR (-O0):
@__func__._singularity_runtime_enter = [27 x i8] c"_singularity_runtime_enter\00"
@.str = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/src/lib/runtime/enter/enter.c\00"
@.str.1 = [34 x i8] c"Containing all rootfs components\0A\00"
define i32 @_singularity_runtime_enter() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__._singularity_runtime_enter, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @_singularity_runtime_enter_chroot()
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@__func__._singularity_runtime_enter = [27 x i8] c"_singularity_runtime_enter\00"
@.str = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/src/lib/runtime/enter/enter.c\00"
@.str.1 = [34 x i8] c"Containing all rootfs components\0A\00"
define i32 @_singularity_runtime_enter() {
%1 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__._singularity_runtime_enter, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @_singularity_runtime_enter_chroot()
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t offset(uint32_t i) {
  size_t ret = 0;
  if (i == 0)
    return 0;
  do
    ++ret;
  while (i >>= 1);
  return ret;
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1126 <offset+0x26>
movq   $0x0,-0x8(%rbp)
jmp    1151 <offset+0x51>
jmp    112b <offset+0x2b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    112b <offset+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
xor    %eax,%eax
test   %edi,%edi
je     111d <offset+0x1d>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <offset+0x10>
ret

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

LLVM IR (-O2):
define i64 @offset(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i64 [ %6, %3 ], [ 0, %1 ]
%6 = add i64 %5, 1
%7 = ashr i32 %4, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
void want_array(void) { error(70); }


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

x86 assembly (clang, -O2):
<want_array>:
mov    $0x46,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
define void @want_array() {
%1 = call i32 @error(i32 70)
ret void
}

LLVM IR (-O2):
define void @want_array() {
%1 = tail call i32 @error(i32 70)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void __ghdl_fprintf_clock(FILE *stream, int a, int b) {
  fprintf(stream, "%3d.%03d", a, b);
}


x86 assembly (clang, -O0):
<__ghdl_fprintf_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ghdl_fprintf_clock>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%3d.%03d\00"
define void @__ghdl_fprintf_clock(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 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%3d.%03d\00"
define void @__ghdl_fprintf_clock(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ lc_TELEPHONE();
int Ada_lc_TELEPHONE() {
  int jresult;
  int result;
  result = (int)lc_TELEPHONE();
  jresult = result;
  return jresult;
}


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

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

LLVM IR (-O0):
define i32 @Ada_lc_TELEPHONE() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @lc_TELEPHONE()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @Ada_lc_TELEPHONE() {
%1 = tail call i64 (...) @lc_TELEPHONE()
%2 = trunc i64 %1 to i32
ret i32 %2
}
void __attribute__((visibility("default")))
border_nesw_double_diagonal_special_sand_s(unsigned char *pic,
                                           unsigned char *mirr) {
  *pic = 0x29;
  *mirr = 0;
}


x86 assembly (clang, -O0):
<border_nesw_double_diagonal_special_sand_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x29,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nesw_double_diagonal_special_sand_s>:
movb   $0x29,(%rdi)
movb   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @border_nesw_double_diagonal_special_sand_s(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
store i8 41, i8* %5
%6 = load i8*, i8** %4
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nesw_double_diagonal_special_sand_s(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 41, i8* %0
store i8 0, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_pawns_able_to_capture_east(int, int);
void b_pawns_able_to_capture_east_test(void **state) {
  assert_int_equal(
      0x0000000800000000ul,
      b_pawns_able_to_capture_east(0x0000100800000000ul, 0x0000000018000000ul));
}


x86 assembly (clang, -O0):
<b_pawns_able_to_capture_east_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x18000000,%esi
call   1030 <b_pawns_able_to_capture_east@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_pawns_able_to_capture_east_test>:
push   %rax
xor    %edi,%edi
mov    $0x18000000,%esi
call   1030 <b_pawns_able_to_capture_east@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_pawns_able_to_capture_east_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_pawns_able_to_capture_east(i32 0, i32 402653184)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_pawns_able_to_capture_east_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_pawns_able_to_capture_east(i32 0, i32 402653184)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void chew_exit() { exit(0); }


x86 assembly (clang, -O0):
<chew_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<chew_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @chew_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @chew_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cleanup(int foo) {
  fprintf(stderr, "reader stopped\n");
  fflush(stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"reader stopped\0A\00"
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"reader stopped\0A\00"
define void @cleanup(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_max();
int /*<<< orphan*/ test_mean();
int main(void) {
  test_max();
  test_mean();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_max@plt>
mov    $0x0,%al
call   1030 <test_mean@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_max()
%2 = call i32 (...) @test_mean()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_max()
%2 = tail call i32 (...) @test_mean()
ret i32 0
}
void _ZGr48_gnu_Sjavax_Sprint_SPrinterDialog_de__properties(void) {}


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

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

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

LLVM IR (-O2):
define void @_ZGr48_gnu_Sjavax_Sprint_SPrinterDialog_de__properties() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned char);
int /*<<< orphan*/ stdout;
void write_tty(unsigned char value) {
  printf("%c", value);
  fflush(stdout);
  return;
}


x86 assembly (clang, -O0):
<write_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tty>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @write_tty(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int seriesLen(long num) {
  int i;
  for (i = 0; num != 1; i++) {
    if (num % 2 == 0)
      num /= 2;
    else {
      num *= 3;
      num += 1;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<seriesLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1171 <seriesLen+0x71>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1149 <seriesLen+0x49>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    115e <seriesLen+0x5e>
imul   $0x3,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <seriesLen+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <seriesLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seriesLen>:
xor    %eax,%eax
cmp    $0x1,%rdi
jne    1109 <seriesLen+0x9>
ret
xor    %eax,%eax
jmp    1121 <seriesLen+0x21>
nopl   (%rax)
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%eax
cmp    $0x1,%rdi
je     1108 <seriesLen+0x8>
test   $0x1,%dil
jne    1110 <seriesLen+0x10>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
mov    %rcx,%rdi
jmp    1118 <seriesLen+0x18>

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

LLVM IR (-O2):
define i32 @seriesLen(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 0, %1 ]
%5 = phi i64 [ %14, %13 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i64 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i64 %5, 3
%12 = add nsw i64 %11, 1
br label %13
13: ; preds = %8, %10
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i64 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 0, %1 ], [ %15, %13 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char *);
int /*<<< orphan*/ stderr;
void cmsfs_error(unsigned char *string) {
  (void)fprintf(stderr, "%s\n", string);
  (void)fflush(stderr);
}


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

x86 assembly (clang, -O2):
<cmsfs_error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cmsfs_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cmsfs_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void test34_TestMod_targetInit__I() {}


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

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

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

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