xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int number_of_cores() {
  static int cores = 0;
  if (cores == 0)
    cores = sysconf(_SC_NPROCESSORS_ONLN);
  return cores;
}


x86 assembly (clang, -O0):
<number_of_cores>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1135 <number_of_cores+0x25>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,0x2ef7(%rip)
mov    0x2ef1(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_cores>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <number_of_cores+0xd>
pop    %rcx
ret
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,0x2efb(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@number_of_cores.cores = internal global i32 0
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @number_of_cores() {
%1 = load i32, i32* @number_of_cores.cores
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @_SC_NPROCESSORS_ONLN
%5 = call i32 @sysconf(i32 %4)
store i32 %5, i32* @number_of_cores.cores
br label %6
6: ; preds = %3, %0
%7 = load i32, i32* @number_of_cores.cores
ret i32 %7
}

LLVM IR (-O2):
@number_of_cores.cores = internal unnamed_addr global i32 0
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @number_of_cores() {
%1 = load i32, i32* @number_of_cores.cores
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @_SC_NPROCESSORS_ONLN
%5 = tail call i32 @sysconf(i32 %4)
store i32 %5, i32* @number_of_cores.cores
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ %5, %3 ], [ %1, %0 ]
ret i32 %7
}
int do_249() { return 249; }


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

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

LLVM IR (-O0):
define i32 @do_249() {
ret i32 249
}

LLVM IR (-O2):
define i32 @do_249() {
ret i32 249
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_cpus() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<get_cpus>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpus>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long getCurrentMS() {
  struct timeval current_time;
  gettimeofday(&current_time, NULL);
  return current_time.tv_sec * 1000 + current_time.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getCurrentMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentMS>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentMS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentMS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int killProgramm(void) {
  system("cls");
  system("pause");
  system("exit");
}


x86 assembly (clang, -O0):
<killProgramm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
lea    0xed9(%rip),%rdi
call   1030 <system@plt>
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killProgramm>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xee0(%rip),%rdi
call   1030 <system@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [5 x i8] c"exit\00"
define i32 @killProgramm() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [5 x i8] c"exit\00"
define i32 @killProgramm() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
int is_string_char(int c) {
  c &= 0177;
  return (c >= ' ' || c == '\n' || c == '\r' || c == '\t');
}


x86 assembly (clang, -O0):
<is_string_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1147 <is_string_char+0x47>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1147 <is_string_char+0x47>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1147 <is_string_char+0x47>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_char>:
and    $0x7f,%edi
mov    $0x1,%eax
cmp    $0x1f,%edi
ja     1117 <is_string_char+0x17>
cmp    $0xa,%edi
je     1117 <is_string_char+0x17>
cmp    $0xd,%edi
jne    1118 <is_string_char+0x18>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_string_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 32
br i1 %6, label %16, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 10
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 13
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 9
br label %16
16: ; preds = %13, %10, %7, %1
%17 = phi i1 [ true, %10 ], [ true, %7 ], [ true, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_string_char(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ugt i32 %2, 31
br i1 %3, label %8, label %4
4: ; preds = %1
switch i32 %2, label %5 [
i32 13, label %8
i32 10, label %8
]
5: ; preds = %4
%6 = icmp eq i32 %2, 9
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %4, %1, %5
%9 = phi i32 [ 1, %4 ], [ %7, %5 ], [ 1, %1 ], [ 1, %4 ]
ret i32 %9
}
void exchange(int *a, int *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int func4b(int);
__attribute__((gnu_)) __attribute__((always_)) int func4a(int x) {
  return func4b(x * 17);
}


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

x86 assembly (clang, -O2):
<func4a>:
mov    %edi,%eax
shl    $0x4,%eax
add    %eax,%edi
jmp    1030 <func4b@plt>

LLVM IR (-O0):
define i32 @func4a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 17
%5 = call i32 @func4b(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func4a(i32 %0) {
%2 = mul nsw i32 %0, 17
%3 = tail call i32 @func4b(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_name_and_version();
int /*<<< orphan*/ puts(char *);
void print_help() {
  print_name_and_version();
  puts("line1\nline 2\nfoo\n\nbar");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <print_name_and_version@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
xor    %eax,%eax
call   1040 <print_name_and_version@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"line1\0Aline 2\0Afoo\0A\0Abar\00"
define void @print_help() {
%1 = call i32 (...) @print_name_and_version()
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"line1\0Aline 2\0Afoo\0A\0Abar\00"
define void @print_help() {
%1 = tail call i32 (...) @print_name_and_version()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgemmRegular(int, int, float *, float *, float *);
int /*<<< orphan*/ sgemmSpecial(float *, float *, float *);
void sgemm(int m_a, int n_a, float *A, float *B, float *C) {
  m_a == 36 && n_a == 36 ? sgemmSpecial(A, B, C)
                         : sgemmRegular(m_a, n_a, A, B, C);
}


x86 assembly (clang, -O0):
<sgemm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x24,-0x4(%rbp)
jne    1164 <sgemm+0x44>
cmpl   $0x24,-0x8(%rbp)
jne    1164 <sgemm+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <sgemmSpecial@plt>
jmp    117b <sgemm+0x5b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <sgemmRegular@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgemm>:
cmp    $0x24,%edi
jne    1138 <sgemm+0x18>
cmp    $0x24,%esi
jne    1138 <sgemm+0x18>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
jmp    1040 <sgemmSpecial@plt>
jmp    1030 <sgemmRegular@plt>

LLVM IR (-O0):
define void @sgemm(i32 %0, i32 %1, float* %2, float* %3, float* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store i32 %0, i32* %6
store i32 %1, i32* %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 36
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 36
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load float*, float** %8
%18 = load float*, float** %9
%19 = load float*, float** %10
%20 = call i32 @sgemmSpecial(float* %17, float* %18, float* %19)
br label %28
21: ; preds = %13, %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load float*, float** %8
%25 = load float*, float** %9
%26 = load float*, float** %10
%27 = call i32 @sgemmRegular(i32 %22, i32 %23, float* %24, float* %25, float* %26)
br label %28
28: ; preds = %21, %16
%29 = phi i32 [ %20, %16 ], [ %27, %21 ]
ret void
}

LLVM IR (-O2):
define void @sgemm(i32 %0, i32 %1, float* %2, float* %3, float* %4) {
%6 = icmp eq i32 %0, 36
%7 = icmp eq i32 %1, 36
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @sgemmSpecial(float* %2, float* %3, float* %4)
br label %13
11: ; preds = %5
%12 = tail call i32 @sgemmRegular(i32 %0, i32 %1, float* %2, float* %3, float* %4)
br label %13
13: ; preds = %11, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_211() {
  Assert_real((isqrt(211) == 14),
              "/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/stdlib/isqrt.c",
              1060, ("Integer square root of 211 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_211>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd3,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x424,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_211>:
push   %rax
mov    $0xd3,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x424,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 211 should be 14\00"
define void @t_sqrt_211() {
%1 = call i32 @isqrt(i32 211)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 211 should be 14\00"
define void @t_sqrt_211() {
%1 = tail call i32 @isqrt(i32 211)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void efface_ecran(void) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @efface_ecran() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @efface_ecran() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rq_asset_asset_correlation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
rq_asset_asset_correlation_free(struct rq_asset_asset_correlation *);
void rq_asset_asset_correlation_freefunc(void *asset_data) {
  rq_asset_asset_correlation_free(
      (struct rq_asset_asset_correlation *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_asset_correlation_freefunc>:
jmp    1030 <rq_asset_asset_correlation_free@plt>

LLVM IR (-O0):
%struct.rq_asset_asset_correlation = type { i32 }
define void @rq_asset_asset_correlation_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_asset_correlation*
%5 = call i32 @rq_asset_asset_correlation_free(%struct.rq_asset_asset_correlation* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_asset_correlation = type { i32 }
define void @rq_asset_asset_correlation_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_asset_correlation*
%3 = tail call i32 @rq_asset_asset_correlation_free(%struct.rq_asset_asset_correlation* %2)
ret void
}
/* Variables and functions */
void *myrealloc(int /*<<< orphan*/ *, int);
void *mymalloc(int size) { return myrealloc(NULL, size); }


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

x86 assembly (clang, -O2):
<mymalloc>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <myrealloc@plt>

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

LLVM IR (-O2):
define i8* @mymalloc(i32 %0) {
%2 = tail call i8* @myrealloc(i32* null, i32 %0)
ret i8* %2
}
/* Variables and functions */
unsigned int strlen(char *str) {
  int n = 0;
  while (*(str++) != 0)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
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 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strlen(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 @strlen(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
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (!p)
    return;
  free(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <xfree+0x1c>
jmp    1135 <xfree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funHello();
int main() {
  funHello();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @funHello()
ret i32 0
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (i) {
    linea_max[i] = linea[i];
    if (linea_max[i] == '\0')
      i--;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <copia+0x57>
movslq -0x4(%rbp),%rcx
mov    0x2ed0(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2eaa(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1152 <copia+0x52>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @copia() {
ret void
}
void gu1_delay_precise(unsigned long milliseconds) {}


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

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

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

LLVM IR (-O2):
define void @gu1_delay_precise(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xfa() {
  Assert_real((isbdigit(250) == 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",
              1255, ("isbdigit should be 0 for 0xfa"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xfa>:
push   %rax
mov    $0xfa,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4e7,%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 0xfa\00"
define void @t_isbdigit_0xfa() {
%1 = call i64 @isbdigit(i32 250)
%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 1255, 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 0xfa\00"
define void @t_isbdigit_0xfa() {
%1 = tail call i64 @isbdigit(i32 250)
%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 1255, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float fastfabs(const float n) {
  if (n >= 0.0f)
    return n;
  else
    return 0.0f - n;
}


x86 assembly (clang, -O0):
<fastfabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <fastfabs+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <fastfabs+0x36>
xorps  %xmm0,%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastfabs>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
subss  %xmm0,%xmm2
cmpnless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fastfabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fsub float 0.000000e+00, %9
store float %10, float* %2
br label %11
11: ; preds = %8, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @fastfabs(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fsub float 0.000000e+00, %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int f(int n) {
  if (-(1 << (sizeof(int) * 8 - 2)) <= n &&
      n <= (1 << (sizeof(int) * 8 - 2)) - 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0xc0000000,%eax
cmp    -0x8(%rbp),%eax
jg     112e <f+0x2e>
cmpl   $0x3fffffff,-0x8(%rbp)
jg     112e <f+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <f+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xbfffffff,%eax
sub    %edi,%eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sub i32 -1073741825, %0
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
void printdochead(int fd, unsigned long docID) {
  char str[50];
  int bwrite;
  sprintf(str, "<sphinx:document id=\"%lu\">\n", docID);
  bwrite = write(fd, str, strlen(str));
  return;
}


x86 assembly (clang, -O0):
<printdochead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x54(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdochead>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"<sphinx:document id=\22%lu\22>\0A\00"
define void @printdochead(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [50 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i32, i32* %3
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 %10, i8* %11, i32 %13)
store i32 %14, i32* %6
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"<sphinx:document id=\22%lu\22>\0A\00"
define void @printdochead(i32 %0, i64 %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @write(i32 %0, i8* %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int main(int argc, char **argv) {
  char buffer[64];
  gets(buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void fputc_f(char c, FILE *stream) {
  if (fputc(c, stream) != c) {
    fprintf(stderr, "Error writing to output file\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<fputc_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
movsbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
je     1183 <fputc_f+0x53>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc_f>:
push   %rbx
mov    %edi,%ebx
call   1030 <fputc@plt>
cmp    %bl,%al
jne    113e <fputc_f+0xe>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Error writing to output file\0A\00"
@EXIT_FAILURE = global i32 0
define void @fputc_f(i8 signext %0, i32* nocapture %1) {
%3 = tail call signext i8 @fputc(i8 signext %0, i32* %1)
%4 = icmp eq i8 %3, %0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
int is_leap_year(int year) {
  return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <is_leap_year+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <is_leap_year+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
test   $0x3,%dil
jne    112c <is_leap_year+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <is_leap_year+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
void RTTestSummaryAndDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestSummaryAndDestroy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ getSipHash24b(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
uint64_t getSipHash24(char *b, uint64_t k0, uint64_t k1) {
  return getSipHash24b(b, 0, strlen(b), k0, k1);
}


x86 assembly (clang, -O0):
<getSipHash24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
xor    %esi,%esi
call   1040 <getSipHash24b@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSipHash24>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <getSipHash24b@plt>

LLVM IR (-O0):
define i32 @getSipHash24(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @getSipHash24b(i8* %7, i32 0, i32 %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @getSipHash24(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @getSipHash24b(i8* %0, i32 0, i32 %4, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_prime(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n1, n2;
  scanf("%d%d", &n1, &n2);
  print_prime(n1, n2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <print_prime@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @print_prime(i32 %6, i32 %7)
ret i32 0
}
void ResInit(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @analysis_generate_aux_witness_files() {
ret void
}
void do_nsap(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}


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

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

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

LLVM IR (-O2):
define void @do_nsap(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int rnd();
int f4() { return rnd() >> 63; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rnd@plt>
mov    $0x3f,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f4() {
%1 = call i32 (...) @rnd()
%2 = ashr i32 %1, 63
ret i32 %2
}

LLVM IR (-O2):
define i32 @f4() {
%1 = tail call i32 (...) @rnd()
ret i32 poison
}
void gtk_widget_translate_coordinates() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_translate_coordinates() {
ret void
}
int is_digtial(char num) {
  if (num >= '0' && num <= '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_digtial>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_digtial+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_digtial+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_digtial+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digtial>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_digtial(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int xyz_1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xyz_1() {
ret i32 0
}
int main() {
  volatile int foo[10][10];
  foo[10][0] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 10
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store volatile i32 0, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() {
  int e = 3, f = 10;
  int x = e + f;
  e = 5;
  int y = e + f;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned char GLCD_ReadByteFromROMMemory(char *ptr) { return *(ptr); }


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

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

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

LLVM IR (-O2):
define zeroext i8 @GLCD_ReadByteFromROMMemory(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func2(int con1, int con2) {
  int x = 1;
  if (con1 == 0) {
    x = x + 1;
  }
  if (con2 > 1) {
    x = x * 2;
  }
  printf("x = %d\n", x);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <func2+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114b <func2+0x3b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
cmp    $0x1,%edi
mov    $0x1,%eax
adc    $0x0,%eax
cmp    $0x2,%esi
setge  %cl
shl    %cl,%eax
lea    0xed6(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define void @func2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 2, i32 1
%5 = icmp sgt i32 %1, 1
%6 = zext i1 %5 to i32
%7 = shl nuw nsw i32 %4, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}