xunge/DecIR huggingface dataset:
__attribute__((weak)) float floorf(float a) { return a; }


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

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

LLVM IR (-O0):
define weak float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define weak float @floorf(float %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int trio_equal(char const *, char const *);
int trio_equal_locale(const char *first, const char *second) {
  assert(first);
  assert(second);
  return trio_equal(first, second);
}


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

x86 assembly (clang, -O2):
<trio_equal_locale>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <trio_equal@plt>

LLVM IR (-O0):
define i32 @trio_equal_locale(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 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @trio_equal(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @trio_equal_locale(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i32 @trio_equal(i8* %0, i8* %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ find_set(int /*<<< orphan*/);
int /*<<< orphan*/ link_set(int /*<<< orphan*/, int /*<<< orphan*/);
void union_set(uint32_t x, uint32_t y) { link_set(find_set(x), find_set(y)); }


x86 assembly (clang, -O0):
<union_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <find_set@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <find_set@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <link_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<union_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <find_set@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <find_set@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <link_set@plt>

LLVM IR (-O0):
define void @union_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @find_set(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @find_set(i32 %7)
%9 = call i32 @link_set(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @union_set(i32 %0, i32 %1) {
%3 = tail call i32 @find_set(i32 %0)
%4 = tail call i32 @find_set(i32 %1)
%5 = tail call i32 @link_set(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void readChar1(char *variableAddress) {
  *variableAddress = fgetc(stdin);
  __fpurge(stdin);
}


x86 assembly (clang, -O0):
<readChar1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
mov    (%r14),%edi
call   1040 <fgetc@plt>
mov    %al,(%rbx)
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__fpurge@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @readChar1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdin
%4 = call signext i8 @fgetc(i32 %3)
%5 = load i8*, i8** %2
store i8 %4, i8* %5
%6 = load i32, i32* @stdin
%7 = call i32 @__fpurge(i32 %6)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @readChar1(i8* nocapture writeonly %0) {
%2 = load i32, i32* @stdin
%3 = tail call signext i8 @fgetc(i32 %2)
store i8 %3, i8* %0
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
ret void
}
/* Variables and functions */
long iter_Fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  long int fact;
  printf("Enter number to get factorial of: ");
  scanf("%d", &number);
  fact = iter_Fact(number);
  printf("Factorial of %d is:  %ld \n", number, fact);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <iter_Fact@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"Enter number to get factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Factorial of %d is: %ld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @iter_Fact(i32 %6)
store i64 %7, i64* %3
%8 = load i32, i32* %2
%9 = load i64, i64* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Enter number to get factorial of: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Factorial of %d is: %ld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @iter_Fact(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7, i64 %6)
ret i32 0
}
int And(int x, int y, int z) { return x & y; }


x86 assembly (clang, -O0):
<And>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @And(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 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @And(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *func(void *arg) {
  sleep(10000);
  sleep(10000);
  return NULL;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2710,%edi
call   1030 <sleep@plt>
mov    $0x2710,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    $0x2710,%edi
call   1030 <sleep@plt>
mov    $0x2710,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @func(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 10000)
%3 = tail call i32 @sleep(i32 10000)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exprp();
int /*<<< orphan*/ term();
void expr() {
  term();
  exprp();
}


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

x86 assembly (clang, -O2):
<expr>:
push   %rax
xor    %eax,%eax
call   1030 <term@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <exprp@plt>

LLVM IR (-O0):
define void @expr() {
%1 = call i32 (...) @term()
%2 = call i32 (...) @exprp()
ret void
}

LLVM IR (-O2):
define void @expr() {
%1 = tail call i32 (...) @term()
%2 = tail call i32 (...) @exprp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_bit(int, void *);
__attribute__((always_)) __attribute__((no_instrument_function)) void
__set_bit_le(int nr, void *addr) {
  set_bit((nr ^ ((32 - 1) & ~0x7)), (addr));
}


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

x86 assembly (clang, -O2):
<__set_bit_le>:
xor    $0x18,%edi
jmp    1030 <set_bit@plt>

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

LLVM IR (-O2):
define void @__set_bit_le(i32 %0, i8* %1) {
%3 = xor i32 %0, 24
%4 = tail call i32 @set_bit(i32 %3, i8* %1)
ret void
}
void XrmPutStringResource() {}


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

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

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

LLVM IR (-O2):
define void @XrmPutStringResource() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete_node(int);
int /*<<< orphan*/ insert_end(int);
int /*<<< orphan*/ show_list();
int main() {
  insert_end(50);
  insert_end(70);
  insert_end(90);
  insert_end(110);
  show_list();
  delete_node(1);
  show_list();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x32,%edi
call   1040 <insert_end@plt>
mov    $0x46,%edi
call   1040 <insert_end@plt>
mov    $0x5a,%edi
call   1040 <insert_end@plt>
mov    $0x6e,%edi
call   1040 <insert_end@plt>
mov    $0x0,%al
call   1030 <show_list@plt>
mov    $0x1,%edi
call   1050 <delete_node@plt>
mov    $0x0,%al
call   1030 <show_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x32,%edi
call   1040 <insert_end@plt>
mov    $0x46,%edi
call   1040 <insert_end@plt>
mov    $0x5a,%edi
call   1040 <insert_end@plt>
mov    $0x6e,%edi
call   1040 <insert_end@plt>
xor    %eax,%eax
call   1030 <show_list@plt>
mov    $0x1,%edi
call   1050 <delete_node@plt>
xor    %eax,%eax
call   1030 <show_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @insert_end(i32 50)
%3 = call i32 @insert_end(i32 70)
%4 = call i32 @insert_end(i32 90)
%5 = call i32 @insert_end(i32 110)
%6 = call i32 (...) @show_list()
%7 = call i32 @delete_node(i32 1)
%8 = call i32 (...) @show_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @insert_end(i32 50)
%2 = tail call i32 @insert_end(i32 70)
%3 = tail call i32 @insert_end(i32 90)
%4 = tail call i32 @insert_end(i32 110)
%5 = tail call i32 (...) @show_list()
%6 = tail call i32 @delete_node(i32 1)
%7 = tail call i32 (...) @show_list()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void std_usleep(unsigned long usec) { usleep(usec); }


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

x86 assembly (clang, -O2):
<std_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @std_usleep(i64 %0) {
%2 = tail call i32 @usleep(i64 %0)
ret void
}
/* Variables and functions */
scalar_t__ round(double);
float roundf(float f) { return (float)round((double)f); }


x86 assembly (clang, -O0):
<roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <round@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <round@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @round(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @roundf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @round(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ packet_disconnect(char *, int, int);
int packet_read();
void packet_read_expect(int expected_type) {
  int type;
  type = packet_read();
  if (type != expected_type)
    packet_disconnect("Protocol error: expected packet type %d, got %d",
                      expected_type, type);
}


x86 assembly (clang, -O0):
<packet_read_expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <packet_read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1153 <packet_read_expect+0x33>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <packet_disconnect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_read_expect>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <packet_read@plt>
cmp    %ebx,%eax
jne    1130 <packet_read_expect+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <packet_disconnect@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Protocol error: expected packet type %d, got %d\00"
define void @packet_read_expect(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @packet_read()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @packet_disconnect(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Protocol error: expected packet type %d, got %d\00"
define void @packet_read_expect(i32 %0) {
%2 = tail call i32 (...) @packet_read()
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @packet_disconnect(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
void AsmAllocMem() {}


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

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

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

LLVM IR (-O2):
define void @AsmAllocMem() {
ret void
}
void swap_int(int *a, int *b) {
  int i;
  i = *a;
  *a = *b;
  *b = i;
}


x86 assembly (clang, -O0):
<swap_int>:
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):
<swap_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_int(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 @swap_int(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 M_PI;
double cos(int);
double hamming(double x) { return 0.54 - 0.46 * cos(2 * M_PI * x); }


x86 assembly (clang, -O0):
<hamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  0xebd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <cos@plt>
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @hamming(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fptosi double %7 to i32
%9 = call double @cos(i32 %8)
%10 = call double @llvm.fmuladd.f64(double -4.600000e-01, double %9, double 5.400000e-01)
ret double %10
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @hamming(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
%6 = fptosi double %5 to i32
%7 = tail call double @cos(i32 %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double -4.600000e-01, double 5.400000e-01)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x9f() {
  Assert_real((iscntrl(159) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              800, ("iscntrl should be 0 for 0x9f"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @dual_modem_init() {
ret i32 0
}
int test_imm_99uint32_mem(unsigned int *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_99uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 153
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int _pint_comparator(void const *a, void const *b) {
  unsigned **left = (unsigned **)a;
  unsigned **right = (unsigned **)b;
  if (**left == **right)
    return 0;
  else if (**left < **right)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<_pint_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%eax
jne    1140 <_pint_comparator+0x40>
movl   $0x0,-0x4(%rbp)
jmp    116b <_pint_comparator+0x6b>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%eax
jae    1164 <_pint_comparator+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <_pint_comparator+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pint_comparator>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
xor    %edx,%edx
xor    %esi,%esi
cmp    (%rcx),%eax
setae  %sil
lea    -0x1(%rsi,%rsi,1),%eax
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @_pint_comparator(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32**
%7 = alloca i32**
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32**
store i32** %9, i32*** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32**
store i32** %11, i32*** %7
%12 = load i32**, i32*** %6
%13 = load i32*, i32** %12
%14 = load i32, i32* %13
%15 = load i32**, i32*** %7
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %14, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 0, i32* %3
br label %30
20: ; preds = %2
%21 = load i32**, i32*** %6
%22 = load i32*, i32** %21
%23 = load i32, i32* %22
%24 = load i32**, i32*** %7
%25 = load i32*, i32** %24
%26 = load i32, i32* %25
%27 = icmp ult i32 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %20
store i32 -1, i32* %3
br label %30
29: ; preds = %20
store i32 1, i32* %3
br label %30
30: ; preds = %29, %28, %19
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @_pint_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = bitcast i8* %1 to i32**
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = icmp ult i32 %6, %8
%11 = select i1 %10, i32 -1, i32 1
%12 = select i1 %9, i32 0, i32 %11
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t toUint32(uint8_t s0, uint8_t s1, uint8_t s2, uint8_t s3) {
  return (((uint32_t)s0) << 24) | (((uint32_t)s1) << 16) |
         (((uint32_t)s2) << 8) | (((uint32_t)s3) << 0);
}


x86 assembly (clang, -O0):
<toUint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUint32>:
mov    %rcx,%rax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%edx
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @toUint32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 24
%12 = load i64, i64* %6
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %11, %14
%16 = load i64, i64* %7
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %15, %18
%20 = load i64, i64* %8
%21 = trunc i64 %20 to i32
%22 = shl i32 %21, 0
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @toUint32(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = trunc i64 %0 to i32
%6 = shl i32 %5, 24
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %6
%10 = trunc i64 %2 to i32
%11 = shl i32 %10, 8
%12 = or i32 %9, %11
%13 = trunc i64 %3 to i32
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
scalar_t__ is_prime_power(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf(is_prime_power(n) ? "yes\n" : "no\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <is_prime_power@plt>
mov    %rax,%rcx
lea    0xea7(%rip),%rdi
lea    0xe9b(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <is_prime_power@plt>
test   %rax,%rax
lea    0xeb3(%rip),%rax
lea    0xea7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @is_prime_power(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myprint(char *, int);
int choose(int a, int b) {
  if (a >= b) {
    myprint("the 1st one\n", 13);
  } else {
    myprint("the 2nd one\n", 13);
  }
  return 0;
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1140 <choose+0x30>
lea    0xecf(%rip),%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
jmp    1151 <choose+0x41>
lea    0xec6(%rip),%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rax
cmp    %esi,%edi
lea    0xef3(%rip),%rax
lea    0xedf(%rip),%rdi
cmovl  %rax,%rdi
mov    $0xd,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"the 1st one\0A\00"
@.str.1 = [13 x i8] c"the 2nd one\0A\00"
define i32 @choose(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @myprint(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 13)
br label %12
10: ; preds = %2
%11 = call i32 @myprint(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 13)
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"the 1st one\0A\00"
@.str.1 = [13 x i8] c"the 2nd one\0A\00"
define i32 @choose(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @myprint(i8* %4, i32 13)
ret i32 0
}
void XtWarning() {}


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

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

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

LLVM IR (-O2):
define void @XtWarning() {
ret void
}
/* Variables and functions */
char *getenv(char *);
char *cgiRequestMethod() { return getenv("REQUEST_METHOD"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"REQUEST_METHOD\00"
define i8* @cgiRequestMethod() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"REQUEST_METHOD\00"
define i8* @cgiRequestMethod() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void ff_hevc_put_hevc_uni_w_qpel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h4_8_sse4() {
ret void
}
unsigned int uiPushDoApdu(unsigned int uiReader, unsigned int uiInLen,
                          unsigned char *psIn, unsigned int *puiOutLen,
                          unsigned char *psOut) {
  return (2);
}


x86 assembly (clang, -O0):
<uiPushDoApdu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uiPushDoApdu(i32 %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i8* nocapture readnone %4) {
ret i32 2
}
/* Variables and functions */
scalar_t__ malloc(size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *new_str(const char *val) {
  size_t l = strlen(val);
  char *res = (char *)malloc(l + 1);
  strncpy(res, val, l + 1);
  return res;
}


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

x86 assembly (clang, -O2):
<new_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @new_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = call i32 @strncpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @new_str(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %3)
ret i8* %5
}
unsigned long encode_zig_zag32(signed long n) { return (n << 1) ^ (n >> 31); }


x86 assembly (clang, -O0):
<encode_zig_zag32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
sar    $0x1f,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_zig_zag32>:
lea    (%rdi,%rdi,1),%rax
sar    $0x1f,%rdi
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @encode_zig_zag32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 1
%5 = load i64, i64* %2
%6 = ashr i64 %5, 31
%7 = xor i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @encode_zig_zag32(i64 %0) {
%2 = shl i64 %0, 1
%3 = ashr i64 %0, 31
%4 = xor i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_175() {
  Assert_real((isqrt(175) == 13),
              "/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",
              880, ("Integer square root of 175 should be 13"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_175>:
push   %rax
mov    $0xaf,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x370,%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 175 should be 13\00"
define void @t_sqrt_175() {
%1 = call i32 @isqrt(i32 175)
%2 = icmp eq i32 %1, 13
%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 880, 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 175 should be 13\00"
define void @t_sqrt_175() {
%1 = tail call i32 @isqrt(i32 175)
%2 = icmp eq i32 %1, 13
%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 880, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _GEN_CalculateCityMultiThread(int);
int /*<<< orphan*/ _GEN_CalculateCitySingleThread();
void GEO_GEN_CalculateCity(int thread_count) {
  if (thread_count > 0) {
    _GEN_CalculateCityMultiThread(thread_count);
  } else {
    _GEN_CalculateCitySingleThread();
  }
}


x86 assembly (clang, -O0):
<GEO_GEN_CalculateCity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1142 <GEO_GEN_CalculateCity+0x22>
mov    -0x4(%rbp),%edi
call   1040 <_GEN_CalculateCityMultiThread@plt>
jmp    1149 <GEO_GEN_CalculateCity+0x29>
mov    $0x0,%al
call   1030 <_GEN_CalculateCitySingleThread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GEO_GEN_CalculateCity>:
test   %edi,%edi
jle    1129 <GEO_GEN_CalculateCity+0x9>
jmp    1040 <_GEN_CalculateCityMultiThread@plt>
xor    %eax,%eax
jmp    1030 <_GEN_CalculateCitySingleThread@plt>

LLVM IR (-O0):
define void @GEO_GEN_CalculateCity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @_GEN_CalculateCityMultiThread(i32 %6)
br label %10
8: ; preds = %1
%9 = call i32 (...) @_GEN_CalculateCitySingleThread()
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @GEO_GEN_CalculateCity(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @_GEN_CalculateCityMultiThread(i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @_GEN_CalculateCitySingleThread()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct struct_dll {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct struct_dll *);
int /*<<< orphan*/ printf(char *);
void free_struct_dll(struct struct_dll *s) {
  printf("free_struct_dll 2\n");
  free(s);
}


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

x86 assembly (clang, -O2):
<free_struct_dll>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.struct_dll = type { i32 }
@str = [18 x i8] c"free_struct_dll 2\00"
define void @free_struct_dll(%struct.struct_dll* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @free(%struct.struct_dll* %0)
ret void
}
void gll_weights_order5_square(double *out_6934682480549297959) {
  out_6934682480549297959[0] = 0.0666666666666667;
  out_6934682480549297959[1] = 0.378474956297847;
  out_6934682480549297959[2] = 0.554858377035486;
  out_6934682480549297959[3] = 0.554858377035486;
  out_6934682480549297959[4] = 0.378474956297847;
  out_6934682480549297959[5] = 0.0666666666666667;
}


x86 assembly (clang, -O0):
<gll_weights_order5_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_weights_order5_square>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
ret

LLVM IR (-O0):
define void @gll_weights_order5_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 0x3FB1111111111113, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0x3FD838EF05E9DFC2, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 0x3FE1C1665AE8EDFA, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
store double 0x3FE1C1665AE8EDFA, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 4
store double 0x3FD838EF05E9DFC2, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 5
store double 0x3FB1111111111113, double* %14
ret void
}

LLVM IR (-O2):
define void @gll_weights_order5_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0x3FB1111111111113, double 0x3FD838EF05E9DFC2>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 0x3FE1C1665AE8EDFA, double 0x3FE1C1665AE8EDFA>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 0x3FD838EF05E9DFC2, double 0x3FB1111111111113>, <2 x double>* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_keyboard(unsigned char, int, int, int /*<<< orphan*/);
void my_keyboard_press(unsigned char key, int x, int y) {
  my_keyboard(key, x, y, 0);
}


x86 assembly (clang, -O0):
<my_keyboard_press>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
movzbl %al,%edi
call   1030 <my_keyboard@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_keyboard_press>:
xor    %ecx,%ecx
jmp    1030 <my_keyboard@plt>

LLVM IR (-O0):
define void @my_keyboard_press(i8 zeroext %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 i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @my_keyboard(i8 zeroext %7, i32 %8, i32 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @my_keyboard_press(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @my_keyboard(i8 zeroext %0, i32 %1, i32 %2, i32 0)
ret void
}
int fixIxBounds(int *ix1p, int *ix2p, int nval) {
  int ix1 = *ix1p, ix2 = *ix2p;
  if (ix2 < 0 || ix1 >= nval)
    return 0;
  if (ix1 < 0)
    *ix1p = 0;
  if (ix2 >= nval)
    *ix2p = nval - 1;
  return 1;
}


x86 assembly (clang, -O0):
<fixIxBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1137 <fixIxBounds+0x37>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     1143 <fixIxBounds+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1176 <fixIxBounds+0x76>
cmpl   $0x0,-0x20(%rbp)
jge    1157 <fixIxBounds+0x57>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     116f <fixIxBounds+0x6f>
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixIxBounds>:
mov    (%rsi),%r8d
xor    %eax,%eax
test   %r8d,%r8d
js     1129 <fixIxBounds+0x29>
mov    (%rdi),%ecx
cmp    %edx,%ecx
jge    1129 <fixIxBounds+0x29>
test   %ecx,%ecx
jns    111a <fixIxBounds+0x1a>
movl   $0x0,(%rdi)
mov    $0x1,%eax
cmp    %edx,%r8d
jl     1129 <fixIxBounds+0x29>
add    $0xffffffff,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define i32 @fixIxBounds(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
store i32 %11, i32* %8
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %3
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16, %3
store i32 0, i32* %4
br label %35
21: ; preds = %16
%22 = load i32, i32* %8
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32*, i32** %5
store i32 0, i32* %25
br label %26
26: ; preds = %24, %21
%27 = load i32, i32* %9
%28 = load i32, i32* %7
%29 = icmp sge i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = load i32*, i32** %6
store i32 %32, i32* %33
br label %34
34: ; preds = %30, %26
store i32 1, i32* %4
br label %35
35: ; preds = %34, %20
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @fixIxBounds(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, -1
%7 = icmp slt i32 %4, %2
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = icmp slt i32 %4, 0
br i1 %10, label %11, label %12
11: ; preds = %9
store i32 0, i32* %0
br label %12
12: ; preds = %11, %9
%13 = icmp slt i32 %5, %2
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = add nsw i32 %2, -1
store i32 %15, i32* %1
br label %16
16: ; preds = %12, %14, %3
%17 = phi i32 [ 0, %3 ], [ 1, %14 ], [ 1, %12 ]
ret i32 %17
}