xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(char *, char **, int /*<<< orphan*/);
uint16_t numerate_string(char a[]) {
  char *ptr;
  return (uint16_t)strtol(a, &ptr, 0);
}


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

x86 assembly (clang, -O2):
<numerate_string>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @numerate_string(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 0)
ret i32 %4
}
int security_socket_getsockopt(struct socket *sock, int level, int optname) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.socket = type opaque
define i32 @security_socket_getsockopt(%struct.socket* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
void RTProcWaitNoResume(void) {}


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

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

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

LLVM IR (-O2):
define void @RTProcWaitNoResume() {
ret void
}
/* Variables and functions */
int execve(char *, char **, char **);
scalar_t__ inc_addr(void *, int);
int bad_execve(void *addr) {
  return execve((char *)addr, (char **)inc_addr(addr, 1),
                (char **)inc_addr(addr, 2));
}


x86 assembly (clang, -O0):
<bad_execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <inc_addr@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_execve>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <inc_addr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <execve@plt>

LLVM IR (-O0):
define i32 @bad_execve(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @inc_addr(i8* %4, i32 1)
%6 = inttoptr i64 %5 to i8**
%7 = load i8*, i8** %2
%8 = call i64 @inc_addr(i8* %7, i32 2)
%9 = inttoptr i64 %8 to i8**
%10 = call i32 @execve(i8* %3, i8** %6, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bad_execve(i8* %0) {
%2 = tail call i64 @inc_addr(i8* %0, i32 1)
%3 = inttoptr i64 %2 to i8**
%4 = tail call i64 @inc_addr(i8* %0, i32 2)
%5 = inttoptr i64 %4 to i8**
%6 = tail call i32 @execve(i8* %0, i8** %3, i8** %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(uint32_t *env) {
  printf("%s", *(char **)(env + 1));
  return;
}


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

x86 assembly (clang, -O2):
<print>:
mov    0x4(%rdi),%rsi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  srand((unsigned)time(NULL));
  while (1)
    printf("%d\n", rand() % 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x1f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    0xeaa(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rsi
imul   $0x51eb851f,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 100
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 100
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %4
}
void arithmetic(void) {
  int x = 0;
  x = x + 1;
  x = x - 1;
  x = x / 1;
  x = x * 1;
  x = +x;
  x = -x;
  x = x % 2;
  x++;
  x--;
  ++x;
  --x;
}


x86 assembly (clang, -O0):
<arithmetic>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @arithmetic() {
ret void
}
int count_digits(unsigned long i) {
  int digits;
  if (!i)
    return 1;
  for (digits = 0; i; digits++)
    i /= 10;
  return digits;
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <count_digits+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1157 <count_digits+0x57>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <count_digits+0x51>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <count_digits+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
test   %rdi,%rdi
je     1139 <count_digits+0x39>
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <count_digits+0x20>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @count_digits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_punpcklqdq128(int /*<<< orphan*/,
                                                int /*<<< orphan*/);
__m128i _mm_unpacklo_epi64(__m128i a, __m128i b) {
  return __builtin_ia32_punpcklqdq128(a, b);
}


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

x86 assembly (clang, -O2):
<_mm_unpacklo_epi64>:
jmp    1030 <__builtin_ia32_punpcklqdq128@plt>

LLVM IR (-O0):
define i32 @_mm_unpacklo_epi64(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 @__builtin_ia32_punpcklqdq128(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm_unpacklo_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_ia32_punpcklqdq128(i32 %0, i32 %1)
ret i32 %3
}
int is_prime(int number) {
  int i;
  for (i = 2; number % i != 0; i++) {
  }
  if (i == number) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1131 <is_prime+0x31>
jmp    1123 <is_prime+0x23>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1149 <is_prime+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x1,%ecx
test   %edx,%edx
jne    1110 <is_prime+0x10>
sub    %edi,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 2, %1 ], [ %6, %2 ]
%4 = srem i32 %0, %3
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = icmp eq i32 %3, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ dc_get_curr_cons();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
void c(int *p) {
  printf("### executing cons: %p --> val = %d\n", dc_get_curr_cons(), *p);
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dc_get_curr_cons@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dc_get_curr_cons@plt>
mov    (%rbx),%edx
lea    0xecc(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"### executing cons: %p --> val = %d\0A\00"
define void @c(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @dc_get_curr_cons()
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"### executing cons: %p --> val = %d\0A\00"
define void @c(i32* nocapture %0) {
%2 = tail call i32 (...) @dc_get_curr_cons()
%3 = load i32, i32* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ process_line();
int main() {
  while (process_line())
    ;
  printf("</ul>\n<!--#exec cmd=\"trailer\" -->\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <process_line@plt>
cmp    $0x0,%rax
je     1145 <main+0x25>
jmp    112f <main+0xf>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <process_line@plt>
test   %rax,%rax
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"</ul>\0A<!--#exec cmd=\22trailer\22 -->\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @process_line()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"</ul>\0A<!--#exec cmd=\22trailer\22 -->\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @process_line()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *dlsym(void *, char *);
void *findSymbol(void *dll_handle, char *name) {
  return dlsym(dll_handle, name);
}


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

x86 assembly (clang, -O2):
<findSymbol>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @findSymbol(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe6() {
  Assert_real((isgraph(230) == 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_isgraph.c",
              1155, ("isgraph should be 0 for 0xe6"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe6\00"
define void @t_isgraph_0xe6() {
%1 = call i64 @isgraph(i32 230)
%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 1155, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe6\00"
define void @t_isgraph_0xe6() {
%1 = tail call i64 @isgraph(i32 230)
%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 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mlwrite(char *);
int showversion(int f, int n) {
  mlwrite("emg 2.0");
  return (1);
}


x86 assembly (clang, -O0):
<showversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <mlwrite@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showversion>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <mlwrite@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"emg 2.0\00"
define i32 @showversion(i32 %0, i32 %1) {
%3 = tail call i32 @mlwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
struct country_st {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display_country_info(struct country_st *, char *);
void display_country_not_removed(struct country_st *country) {
  display_country_info(country, "not removed, record not found!");
}


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

x86 assembly (clang, -O2):
<display_country_not_removed>:
lea    0xee9(%rip),%rsi
jmp    1030 <display_country_info@plt>

LLVM IR (-O0):
%struct.country_st = type { i32 }
@.str = [31 x i8] c"not removed, record not found!\00"
define void @display_country_not_removed(%struct.country_st* %0) {
%2 = alloca %struct.country_st*
store %struct.country_st* %0, %struct.country_st** %2
%3 = load %struct.country_st*, %struct.country_st** %2
%4 = call i32 @display_country_info(%struct.country_st* %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.country_st = type { i32 }
@.str = [31 x i8] c"not removed, record not found!\00"
define void @display_country_not_removed(%struct.country_st* %0) {
%2 = tail call i32 @display_country_info(%struct.country_st* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int r2h_bits(int cmd) {
  unsigned int mask = (((cmd) > 0) ? (1 << ((cmd)-1)) : 0);
  if (cmd == 5) {
    mask |= ((((6) > 0) ? (1 << ((6) - 1)) : 0) |
             (((7) > 0) ? (1 << ((7) - 1)) : 0) |
             (((16) > 0) ? (1 << ((16) - 1)) : 0));
  }
  if (cmd == 2)
    mask |= (((13) > 0) ? (1 << ((13) - 1)) : 0);
  return (mask |= (((32) > 0) ? (1 << ((32) - 1)) : 0));
}


x86 assembly (clang, -O0):
<r2h_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1126 <r2h_bits+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    114b <r2h_bits+0x4b>
mov    -0x8(%rbp),%eax
or     $0x8060,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1160 <r2h_bits+0x60>
mov    -0x8(%rbp),%eax
or     $0x1000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2h_bits>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %ecx,%ecx
test   %edi,%edi
cmovg  %eax,%ecx
mov    %ecx,%edx
or     $0x8060,%edx
cmp    $0x5,%edi
cmovne %ecx,%edx
mov    %edx,%eax
or     $0x1000,%eax
cmp    $0x2,%edi
cmovne %edx,%eax
or     $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @r2h_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = or i32 %16, 32864
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = or i32 %22, 4096
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* %3
%26 = or i32 %25, -2147483648
store i32 %26, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @r2h_bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 %4, i32 0
%6 = icmp eq i32 %0, 5
%7 = or i32 %5, 32864
%8 = select i1 %6, i32 %7, i32 %5
%9 = icmp eq i32 %0, 2
%10 = or i32 %8, 4096
%11 = select i1 %9, i32 %10, i32 %8
%12 = or i32 %11, -2147483648
ret i32 %12
}
void delay(int data) {
  int count = data;
  while (count != 0) {
    count--;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <delay+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <delay+0xd>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
long scalar_product(int v1[], int v2[], int dim) {}


x86 assembly (clang, -O0):
<scalar_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @scalar_product(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i64 undef
}
int main(void) {
  int a[3];
  int b[2];
  &a[2] - &a[1];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x i32]
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%5 = ptrtoint i32* %3 to i64
%6 = ptrtoint i32* %4 to i64
%7 = sub i64 %5, %6
%8 = sdiv exact i64 %7, 4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fun(void) {
  int z = 1;
  char x = z + 1;
  ;
  x = x + 1;
  return x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fun() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ luaI_registerlocalvar(int /*<<< orphan*/, int);
void luaI_unregisterlocalvar(int line) { luaI_registerlocalvar(0, line); }


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

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

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

LLVM IR (-O2):
define void @luaI_unregisterlocalvar(i32 %0) {
%2 = tail call i32 @luaI_registerlocalvar(i32 0, i32 %0)
ret void
}
int ModuleFunction() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ModuleFunction() {
ret i32 1
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_set(int /*<<< orphan*/ *, int, void const *);
void *sk_OPENSSL_BLOCK_set(struct stack_st_OPENSSL_BLOCK *sk, int idx,
                           void *ptr) {
  return (void *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_BLOCK_set>:
jmp    1030 <OPENSSL_sk_set@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i8* @sk_OPENSSL_BLOCK_set(%struct.stack_st_OPENSSL_BLOCK* %0, i32 %1, i8* %2) {
%4 = alloca %struct.stack_st_OPENSSL_BLOCK*
%5 = alloca i32
%6 = alloca i8*
store %struct.stack_st_OPENSSL_BLOCK* %0, %struct.stack_st_OPENSSL_BLOCK** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.stack_st_OPENSSL_BLOCK*, %struct.stack_st_OPENSSL_BLOCK** %4
%8 = bitcast %struct.stack_st_OPENSSL_BLOCK* %7 to i32*
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i64 @OPENSSL_sk_set(i32* %8, i32 %9, i8* %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i8* @sk_OPENSSL_BLOCK_set(%struct.stack_st_OPENSSL_BLOCK* %0, i32 %1, i8* %2) {
%4 = getelementptr %struct.stack_st_OPENSSL_BLOCK, %struct.stack_st_OPENSSL_BLOCK* %0, i64 0, i32 0
%5 = tail call i64 @OPENSSL_sk_set(i32* %4, i32 %1, i8* %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int main(void) {
  void *p = (void *)0x87654321;
  int q[] = {1, 2, 3};
  free(p);
  free(q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x87654321,%eax
mov    %rax,-0x10(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x87654321,%edi
call   1030 <free@plt>
lea    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.q = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i32 @free(i32* inttoptr (i64 2271560481 to i32*))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @free(i32* %4)
ret i32 0
}
long cmm_version() { return 10100; }


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

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

LLVM IR (-O0):
define i64 @cmm_version() {
ret i64 10100
}

LLVM IR (-O2):
define i64 @cmm_version() {
ret i64 10100
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_andnot_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpeq_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_max_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i _mm_cmpgt_epu8(__m128i x, __m128i y) {
  return _mm_andnot_si128(_mm_cmpeq_epi8(x, y),
                          _mm_cmpeq_epi8(_mm_max_epu8(x, y), x));
}


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

x86 assembly (clang, -O2):
<_mm_cmpgt_epu8>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <_mm_cmpeq_epi8@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <_mm_max_epu8@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <_mm_cmpeq_epi8@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_mm_andnot_si128@plt>

LLVM IR (-O0):
define i32 @_mm_cmpgt_epu8(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 @_mm_cmpeq_epi8(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @_mm_max_epu8(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @_mm_cmpeq_epi8(i32 %10, i32 %11)
%13 = call i32 @_mm_andnot_si128(i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @_mm_cmpgt_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_epi8(i32 %0, i32 %1)
%4 = tail call i32 @_mm_max_epu8(i32 %0, i32 %1)
%5 = tail call i32 @_mm_cmpeq_epi8(i32 %4, i32 %0)
%6 = tail call i32 @_mm_andnot_si128(i32 %3, i32 %5)
ret i32 %6
}
int main(argc, argv)
int argc;
char **argv;
{ return top(argc); }


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    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <top@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <top@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 = load i32, i32* %4
%7 = call i32 (i32, ...) bitcast (i32 (...)* @top to i32 (i32, ...)*)(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @top to i32 (i32, ...)*)(i32 %0)
ret i32 %3
}
float _vector3_dot(float *v0, float *v1) {
  float d;
  d = v0[0] * v1[0];
  d += v0[1] * v1[1];
  d += v0[2] * v1[2];
  return d;
}


x86 assembly (clang, -O0):
<_vector3_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vector3_dot>:
movss  (%rdi),%xmm0
mulss  (%rsi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  0x4(%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_vector3_dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = fmul float %8, %11
store float %12, float* %5
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float, float* %5
%20 = call float @llvm.fmuladd.f32(float %15, float %18, float %19)
store float %20, float* %5
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 2
%26 = load float, float* %25
%27 = load float, float* %5
%28 = call float @llvm.fmuladd.f32(float %23, float %26, float %27)
store float %28, float* %5
%29 = load float, float* %5
ret float %29
}

LLVM IR (-O2):
define float @_vector3_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fmul float %3, %4
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = tail call float @llvm.fmuladd.f32(float %7, float %9, float %5)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
void SteamAPI_ISteamGameServer_GetGameplayStats(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_GetGameplayStats>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamGameServer_GetGameplayStats = [43 x i8] c"SteamAPI_ISteamGameServer_GetGameplayStats\00"
define void @SteamAPI_ISteamGameServer_GetGameplayStats(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamGameServer_GetGameplayStats, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamGameServer_GetGameplayStats = [43 x i8] c"SteamAPI_ISteamGameServer_GetGameplayStats\00"
define void @SteamAPI_ISteamGameServer_GetGameplayStats(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamGameServer_GetGameplayStats, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int /*<<< orphan*/);
void water_stop(void) {
  gpio_set(20, 0);
  gpio_set(21, 0);
}


x86 assembly (clang, -O0):
<water_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<water_stop>:
push   %rax
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x15,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <gpio_set@plt>

LLVM IR (-O0):
define void @water_stop() {
%1 = call i32 @gpio_set(i32 20, i32 0)
%2 = call i32 @gpio_set(i32 21, i32 0)
ret void
}

LLVM IR (-O2):
define void @water_stop() {
%1 = tail call i32 @gpio_set(i32 20, i32 0)
%2 = tail call i32 @gpio_set(i32 21, i32 0)
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int /*<<< orphan*/);
int isInteger(int *value, const char *string) {
  if (*string) {
    char *end;
    long l = strtol(string, &end, 0);
    if (!*end) {
      *value = l;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <isInteger+0x5a>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1165 <isInteger+0x55>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1171 <isInteger+0x61>
jmp    116a <isInteger+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInteger>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rsi)
je     1141 <isInteger+0x31>
mov    %rdi,%r14
mov    %rsp,%rax
xor    %ebx,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1143 <isInteger+0x33>
mov    %eax,(%r14)
mov    $0x1,%ebx
jmp    1143 <isInteger+0x33>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @isInteger(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = bitcast i8** %3 to i8*
%8 = call i64 @strtol(i8* %1, i8** %3, i32 0)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %6
br label %15
13: ; preds = %6
%14 = trunc i64 %8 to i32
store i32 %14, i32* %0
br label %15
15: ; preds = %2, %12, %13
%16 = phi i32 [ 1, %13 ], [ 0, %12 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(const void *e) {
  int *e_int = (int *)e;
  printf("%d, ", *e_int);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @printInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void hcx_dna_stop() {}


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

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

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

LLVM IR (-O2):
define void @hcx_dna_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_unsigned_long_compare(const void *p1,
                                                    const void *p2, size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_unsigned_long_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_unsigned_long_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_unsigned_long_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_unsigned_long_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/AlexaInga2/"
                 "holbertonschool-low_level_programming/refs/heads/master/"
                 "0x0C-preprocessor/2-main.c");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [184 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AlexaInga2/holbertonschool-low_level_programming/refs/heads/master/0x0C-preprocessor/2-main.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [184 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AlexaInga2/holbertonschool-low_level_programming/refs/heads/master/0x0C-preprocessor/2-main.c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}