xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checkForDuplicate();
int main() {
  checkForDuplicate();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @checkForDuplicate()
ret i32 0
}
int chars_compare(const void *aa, const void *bb) {
  int a = *(int *)aa;
  int b = *(int *)bb;
  return a - b;
}


x86 assembly (clang, -O0):
<chars_compare>:
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),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @chars_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @chars_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int decimal_octal(int n) {
  int rem, i = 1, octal = 0;
  while (n != 0) {
    rem = n % 8;
    n /= 8;
    octal += rem * i;
    i *= 10;
  }
  return octal;
}


x86 assembly (clang, -O0):
<decimal_octal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <decimal_octal+0x54>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <decimal_octal+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_octal>:
test   %edi,%edi
je     1139 <decimal_octal+0x39>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
lea    0x7(%rdi),%r8d
test   %edi,%edi
mov    %edi,%esi
cmovs  %r8d,%esi
mov    %esi,%edx
sar    $0x3,%edx
and    $0xfffffff8,%esi
sub    %esi,%edi
imul   %ecx,%edi
add    %edi,%eax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edx,%edi
cmp    $0xe,%r8d
ja     1110 <decimal_octal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @decimal_octal(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %8, %3 ], [ %0, %1 ]
%7 = srem i32 %6, 8
%8 = sdiv i32 %6, 8
%9 = mul nsw i32 %7, %5
%10 = add nsw i32 %4, %9
%11 = mul nsw i32 %5, 10
%12 = add i32 %6, 7
%13 = icmp ult i32 %12, 15
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void copy_int(int val, void *buf, int maxbytes) {
  if (maxbytes > 0 && maxbytes >= sizeof(val))
    memcpy(buf, (void *)&val, sizeof(val));
}


x86 assembly (clang, -O0):
<copy_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114c <copy_int+0x3c>
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jb     114c <copy_int+0x3c>
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int>:
push   %rax
mov    %edi,0x4(%rsp)
cmp    $0x4,%edx
jl     112f <copy_int+0x1f>
lea    0x4(%rsp),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_int(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* %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = icmp uge i64 %11, 4
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = bitcast i32* %4 to i8*
%16 = call i32 @memcpy(i8* %14, i8* %15, i32 4)
br label %17
17: ; preds = %13, %9, %3
ret void
}

LLVM IR (-O2):
define void @copy_int(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp sgt i32 %2, 3
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @memcpy(i8* %1, i8* %7, i32 4)
br label %9
9: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ strlen;

/* Variables and functions */
char *malloc(int);
int ntohl(int);
int /*<<< orphan*/ read(int, ...);
char *read_string(int fd) {
  char *buf;
  uint32_t strlen;
  read(fd, &strlen, sizeof(strlen));
  strlen = ntohl(strlen);
  buf = malloc(strlen + 1);
  read(fd, buf, strlen);
  buf[strlen] = '\0';
  return (buf);
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    -0x14(%rbp),%edi
call   1050 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <read@plt>
mov    0xc(%rsp),%edi
call   1050 <ntohl@plt>
mov    %eax,%ebx
mov    %eax,0xc(%rsp)
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <read@plt>
movslq 0xc(%rsp),%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @read_string(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32, ...) @read(i32 %0, i32* %2, i64 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
store i32 %6, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
%9 = call i32 (i32, ...) @read(i32 %0, i8* %8, i32 %6)
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %12
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void except(char *message) {
  printf("Exception: %s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<except>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<except>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @except(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @except(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int bb(void) {
  char t[100];
  test(t);
}


x86 assembly (clang, -O0):
<bb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
call   1030 <test@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb>:
sub    $0x68,%rsp
mov    %rsp,%rdi
call   1030 <test@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @bb() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @test(i8* %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @bb() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @test(i8* %2)
ret i32 undef
}
void ADC_DelSig_ISR2(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_ISR2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_ELAPSED_TIME;
double glutGet(int /*<<< orphan*/);
int get_msecs(void) { return glutGet(GLUT_ELAPSED_TIME) / 1000.0; }


x86 assembly (clang, -O0):
<get_msecs>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msecs>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
divsd  0xed9(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@GLUT_ELAPSED_TIME = global i32 0
define i32 @get_msecs() {
%1 = load i32, i32* @GLUT_ELAPSED_TIME
%2 = call double @glutGet(i32 %1)
%3 = fdiv double %2, 1.000000e+03
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@GLUT_ELAPSED_TIME = global i32 0
define i32 @get_msecs() {
%1 = load i32, i32* @GLUT_ELAPSED_TIME
%2 = tail call double @glutGet(i32 %1)
%3 = fdiv double %2, 1.000000e+03
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ logger_info(char *);
void test_message_stop(void) {
  logger_info("\n"
              "--a94e2gfwdd--");
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A--a94e2gfwdd--\00"
define void @test_message_stop() {
%1 = tail call i32 @logger_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int find_deepest_level(int width, int height) {
  int level = 0, w = width, h = height;
  while (!((w % 2) || (h % 2))) {
    w = w / 2;
    h = h / 2;
    level++;
  }
  return level - 1;
}


x86 assembly (clang, -O0):
<find_deepest_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x15(%rbp)
jne    114a <find_deepest_level+0x4a>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    115c <find_deepest_level+0x5c>
jmp    1186 <find_deepest_level+0x86>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <find_deepest_level+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_deepest_level>:
mov    %edi,%ecx
or     %esi,%ecx
mov    $0xffffffff,%eax
test   $0x1,%cl
jne    1141 <find_deepest_level+0x41>
mov    $0xffffffff,%eax
mov    %edi,%ecx
mov    %esi,%edx
nopw   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
mov    %ecx,%r8d
or     %edx,%r8d
add    $0x1,%eax
mov    %edx,%esi
mov    %ecx,%edi
test   $0x1,%r8b
je     1120 <find_deepest_level+0x20>
ret

LLVM IR (-O0):
define i32 @find_deepest_level(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%8 = load i32, i32* %3
store i32 %8, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %7
br label %10
10: ; preds = %21, %2
%11 = load i32, i32* %6
%12 = srem i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* %7
%16 = srem i32 %15, 2
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ true, %10 ], [ %17, %14 ]
%20 = xor i1 %19, true
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %6
%23 = sdiv i32 %22, 2
store i32 %23, i32* %6
%24 = load i32, i32* %7
%25 = sdiv i32 %24, 2
store i32 %25, i32* %7
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %10
28: ; preds = %18
%29 = load i32, i32* %5
%30 = sub nsw i32 %29, 1
ret i32 %30
}

LLVM IR (-O2):
define i32 @find_deepest_level(i32 %0, i32 %1) {
%3 = or i32 %0, %1
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ %1, %2 ]
%8 = phi i32 [ %10, %6 ], [ %0, %2 ]
%9 = phi i32 [ %12, %6 ], [ 0, %2 ]
%10 = sdiv i32 %8, 2
%11 = sdiv i32 %7, 2
%12 = add nuw nsw i32 %9, 1
%13 = and i32 %10, 1
%14 = icmp ne i32 %13, 0
%15 = and i32 %11, 1
%16 = icmp ne i32 %15, 0
%17 = select i1 %14, i1 true, i1 %16
br i1 %17, label %18, label %6
18: ; preds = %6, %2
%19 = phi i32 [ -1, %2 ], [ %9, %6 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long xfread_value(int /*<<< orphan*/ *, char *, int);
long xfread_long(FILE *fp, char *filename) {
  return xfread_value(fp, filename, 4);
}


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

x86 assembly (clang, -O2):
<xfread_long>:
mov    $0x4,%edx
jmp    1030 <xfread_value@plt>

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

LLVM IR (-O2):
define i64 @xfread_long(i32* %0, i8* %1) {
%3 = tail call i64 @xfread_value(i32* %0, i8* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ writeDebugStreamLine(char *);
void writeOnStopDebugLines() {
  writeDebugStreamLine("---");
  writeDebugStreamLine("Process complete!");
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"---\00"
@.str.1 = [18 x i8] c"Process complete!\00"
define void @writeOnStopDebugLines() {
%1 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"---\00"
@.str.1 = [18 x i8] c"Process complete!\00"
define void @writeOnStopDebugLines() {
%1 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
struct thread *get_current(void) {
  struct thread **current;
  register unsigned long sp asm("rsp");
  current = (void *)(unsigned long)(sp & ~(((1UL << 12) * (1 << 4)) - 1));
  return *current;
}


x86 assembly (clang, -O0):
<get_current>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
and    $0xffffffffffff0000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.thread = type opaque
define %struct.thread* @get_current() {
%1 = alloca %struct.thread**
%2 = alloca i64
%3 = load i64, i64* %2
%4 = and i64 %3, -65536
%5 = inttoptr i64 %4 to i8*
%6 = bitcast i8* %5 to %struct.thread**
store %struct.thread** %6, %struct.thread*** %1
%7 = load %struct.thread**, %struct.thread*** %1
%8 = load %struct.thread*, %struct.thread** %7
ret %struct.thread* %8
}

LLVM IR (-O2):
%struct.thread = type opaque
define noalias %struct.thread* @get_current() {
ret %struct.thread* undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void _free_string(void *data) {
  char *st = (char *)data;
  free(st);
}


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

x86 assembly (clang, -O2):
<_free_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_free_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void foo_2_2_1_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_1_2_2() {
ret void
}
long sqr(long x) { return x * x; }


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

x86 assembly (clang, -O2):
<sqr>:
mov    %rdi,%rax
imul   %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @sqr(i64 %0) {
%2 = mul nsw i64 %0, %0
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_def_byte(void) { output_with_tab("fcb "); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"fcb \00"
define void @gen_def_byte() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void evaluer_score() {}


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

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

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

LLVM IR (-O2):
define void @evaluer_score() {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort_algo(int *array, int l, int h) {
  int m = 0;
  if (l < h) {
    m = partition(array, l, h);
    quicksort_algo(array, l, m - 1);
    quicksort_algo(array, m + 1, h);
  }
  return;
}


x86 assembly (clang, -O0):
<quicksort_algo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <quicksort_algo+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort_algo@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort_algo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_algo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort_algo+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort_algo@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort_algo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort_algo(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort_algo(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int fun463() { return 463; }


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

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

LLVM IR (-O0):
define i32 @fun463() {
ret i32 463
}

LLVM IR (-O2):
define i32 @fun463() {
ret i32 463
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printData(void) {
  printf("GOt here");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"GOt here\00"
define i32 @printData() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"GOt here\00"
define i32 @printData() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *memdup(void *old, size_t len) {
  void *ret = NULL;
  if (old && len > 0) {
    ret = calloc(1, len);
    if (ret) {
      memcpy(ret, old, len);
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1181 <memdup+0x61>
cmpq   $0x0,-0x10(%rbp)
jbe    1181 <memdup+0x61>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <memdup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
jmp    1181 <memdup+0x61>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     115e <memdup+0x3e>
mov    %rsi,%r14
test   %rsi,%rsi
je     115e <memdup+0x3e>
mov    %rdi,%r15
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <calloc@plt>
test   %rax,%rax
je     115c <memdup+0x3c>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
jmp    115e <memdup+0x3e>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i64, i64* %4
%13 = call i8* @calloc(i32 1, i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i64, i64* %4
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
br label %21
21: ; preds = %16, %11
br label %22
22: ; preds = %21, %8, %2
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i8* @calloc(i32 1, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %1)
br label %11
11: ; preds = %6, %9, %2
%12 = phi i8* [ %7, %9 ], [ null, %6 ], [ null, %2 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void fogindex_keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<fogindex_keyboard>:
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
sub    $0x1b,%al
jne    113b <fogindex_keyboard+0x2b>
jmp    1134 <fogindex_keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <fogindex_keyboard+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fogindex_keyboard>:
cmp    $0x1b,%dil
je     1117 <fogindex_keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fogindex_keyboard(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 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @fogindex_keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setPixel(int, int, int /*<<< orphan*/);
void clearPixel(int x, int y) { setPixel(x, y, 0); }


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

x86 assembly (clang, -O2):
<clearPixel>:
xor    %edx,%edx
jmp    1030 <setPixel@plt>

LLVM IR (-O0):
define void @clearPixel(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 = call i32 @setPixel(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @clearPixel(i32 %0, i32 %1) {
%3 = tail call i32 @setPixel(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
float fmaxf(float, float);
float fminf(float, float);
float fabsminf(float n, float min) {
  return n > 0.0f ? fminf(n, min) : fmaxf(n, -min);
}


x86 assembly (clang, -O0):
<fabsminf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1151 <fabsminf+0x51>
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    118b <fabsminf+0x8b>
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsminf>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jbe    111c <fabsminf+0x1c>
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
jmp    1135 <fabsminf+0x35>
xorps  0xedd(%rip),%xmm1
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fabsminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fcmp ogt float %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call float @llvm.minnum.f32(float %8, float %9)
br label %16
11: ; preds = %2
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fneg float %13
%15 = call float @llvm.maxnum.f32(float %12, float %14)
br label %16
16: ; preds = %11, %7
%17 = phi float [ %10, %7 ], [ %15, %11 ]
ret float %17
}

LLVM IR (-O2):
define float @fabsminf(float %0, float %1) {
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call float @llvm.minnum.f32(float %0, float %1)
br label %9
6: ; preds = %2
%7 = fneg float %1
%8 = tail call float @llvm.maxnum.f32(float %0, float %7)
br label %9
9: ; preds = %6, %4
%10 = phi float [ %5, %4 ], [ %8, %6 ]
ret float %10
}
int _count(const void *k, const void *v, void *arg) {
  int *np = arg;
  (*np)++;
  return 1;
}


x86 assembly (clang, -O0):
<_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_count(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(787, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_Laurent_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x313,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_target_system_to_container>:
mov    $0x313,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 787, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
char *ecvt(arg, ndigits, decpt, sign)
double arg;
int ndigits, *decpt, *sign;
{ return (cvt(arg, ndigits, decpt, sign, 1)); }


x86 assembly (clang, -O0):
<ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecvt>:
push   %rax
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void UARTRXIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = ((ui32Base == 0x00007200) ? 0x600901 : 0x620903);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<UARTRXIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x620903,%eax
mov    $0x600901,%ecx
cmp    $0x7200,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRXIntUnregister>:
push   %rbx
cmp    $0x7200,%edi
mov    $0x600901,%eax
mov    $0x620903,%ebx
cmove  %eax,%ebx
mov    %ebx,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @UARTRXIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 29184
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 6293761, i32 6424835
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @IntDisable(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @IntUnregister(i32 %10)
ret void
}

LLVM IR (-O2):
define void @UARTRXIntUnregister(i32 %0) {
%2 = icmp eq i32 %0, 29184
%3 = select i1 %2, i32 6293761, i32 6424835
%4 = tail call i32 @IntDisable(i32 %3)
%5 = tail call i32 @IntUnregister(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x4b() {
  Assert_real((isodigit(75) == 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_isodigit.c",
              380, ("isodigit should be 0 for K"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x4b>:
push   %rax
mov    $0x4b,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x17c,%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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for K\00"
define void @t_isodigit_0x4b() {
%1 = call i64 @isodigit(i32 75)
%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 380, i8* getelementptr inbounds ([27 x i8], [27 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for K\00"
define void @t_isodigit_0x4b() {
%1 = tail call i64 @isodigit(i32 75)
%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 380, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int start_line(const char *line) {
  if (strcmp(line + 10, " _start\n") == 0) {
    return 1;
  } else if (strcmp(line + 18, " _start\n") == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<start_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <start_line+0x36>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
mov    -0x10(%rbp),%rdi
add    $0x12,%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1170 <start_line+0x60>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
jmp    1175 <start_line+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_line>:
push   %rbx
mov    %rdi,%rbx
add    $0xa,%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <start_line+0x39>
add    $0x12,%rbx
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c" _start\0A\00"
define i32 @start_line(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 10
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 18
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int strcasecmp(char *, char *);
int strcasecmp_null_argument(char *a) {
  char *b = 0;
  return strcasecmp(a, b);
}


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

x86 assembly (clang, -O2):
<strcasecmp_null_argument>:
xor    %esi,%esi
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp_null_argument(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* null)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int strtoull(char *, int /*<<< orphan*/ *, int);
uint64_t get_cas_value(char *a) {
  uint64_t cas;
  if (!strncmp("STORED", a, 6) && (cas = strtoull(a + 7, NULL, 10)) != -1) {
    return cas;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_cas_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1177 <get_cas_value+0x57>
mov    -0x10(%rbp),%rdi
add    $0x7,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoull@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1177 <get_cas_value+0x57>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <get_cas_value+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cas_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1156 <get_cas_value+0x36>
add    $0x7,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoull@plt>
cmp    $0xffffffff,%eax
je     1156 <get_cas_value+0x36>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"STORED\00"
define i32 @get_cas_value(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strncmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i32 6)
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 7
%11 = call i32 @strtoull(i8* %10, i32* null, i32 10)
store i32 %11, i32* %4
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %16
15: ; preds = %8, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"STORED\00"
define i32 @get_cas_value(i8* %0) {
%2 = tail call i32 @strncmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 6)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 7
%6 = tail call i32 @strtoull(i8* nocapture %5, i32* null, i32 10)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ runUnitTests();
int main(int argc, char *argv[]) {
  runUnitTests();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <runUnitTests@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @runUnitTests()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @runUnitTests()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void Port_End(void) { return; }


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

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

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

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