xunge/DecIR huggingface dataset:
void background(int colour) { colour = colour; }


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

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

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

LLVM IR (-O2):
define void @background(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memexport_free() {
  printf("NOT IMPLEMENTED:"
         "pa_memexport_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_memexport_free\0A\00"
define i32 @pa_memexport_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_memexport_free\00"
define i32 @pa_memexport_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main(void) {
  char *p;
  printf("Enter address: ");
  scanf("%x", (int *)&p);
  printf("%s\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Enter address: \00"
@.str.1 = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i8** %1 to i32*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i8*, i8** %1
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
unsigned short t2(unsigned short x) { return ++x; }


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @t2(i16 zeroext %0) {
%2 = add i16 %0, 1
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ regcomp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ regerror(int /*<<< orphan*/, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ regexec(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
int main() {
  regcomp(NULL, NULL, 0);
  regexec(NULL, NULL, 0, NULL, 0);
  regerror(0, NULL, NULL, 0);
  regfree(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1040 <regcomp@plt>
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
mov    %rcx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
call   1060 <regexec@plt>
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %ecx,%edi
mov    %rdx,%rsi
call   1050 <regerror@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <regfree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <regcomp@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <regexec@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <regerror@plt>
xor    %edi,%edi
call   1030 <regfree@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @regcomp(i32* null, i32* null, i32 0)
%3 = call i32 @regexec(i32* null, i32* null, i32 0, i32* null, i32 0)
%4 = call i32 @regerror(i32 0, i32* null, i32* null, i32 0)
%5 = call i32 @regfree(i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @regcomp(i32* null, i32* null, i32 0)
%2 = tail call i32 @regexec(i32* null, i32* null, i32 0, i32* null, i32 0)
%3 = tail call i32 @regerror(i32 0, i32* null, i32* null, i32 0)
%4 = tail call i32 @regfree(i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void writeautom(int *p, int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf(" %2d", p[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<writeautom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <writeautom+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <writeautom+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeautom>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <writeautom+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <writeautom+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %2d\00"
define void @writeautom(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ OpenSSL_add_all_ciphers();
int /*<<< orphan*/ OpenSSL_add_all_digests();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void ssl_init() {
  SSL_load_error_strings();
  SSL_library_init();
  OpenSSL_add_all_digests();
  OpenSSL_add_all_algorithms();
  OpenSSL_add_all_ciphers();
}


x86 assembly (clang, -O0):
<ssl_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_digests@plt>
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1060 <OpenSSL_add_all_ciphers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_init>:
push   %rax
xor    %eax,%eax
call   1070 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_digests@plt>
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <OpenSSL_add_all_ciphers@plt>

LLVM IR (-O0):
define void @ssl_init() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @SSL_library_init()
%3 = call i32 (...) @OpenSSL_add_all_digests()
%4 = call i32 (...) @OpenSSL_add_all_algorithms()
%5 = call i32 (...) @OpenSSL_add_all_ciphers()
ret void
}

LLVM IR (-O2):
define void @ssl_init() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @OpenSSL_add_all_digests()
%4 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%5 = tail call i32 (...) @OpenSSL_add_all_ciphers()
ret void
}
int is_jmp(int opcode) { return opcode == 2 || opcode == 3; }


x86 assembly (clang, -O0):
<is_jmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_jmp+0x20>
cmpl   $0x3,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_jmp>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_jmp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 3
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_jmp(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct const_Multiarray_T {
  int dummy;
};
struct Multiarray_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_Multiarray_T(struct Multiarray_T const *);
void print_const_Multiarray_T(const struct const_Multiarray_T *const a) {
  print_Multiarray_T((const struct Multiarray_T *)a);
}


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

x86 assembly (clang, -O2):
<print_const_Multiarray_T>:
jmp    1030 <print_Multiarray_T@plt>

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

LLVM IR (-O2):
%struct.const_Multiarray_T = type { i32 }
%struct.Multiarray_T = type { i32 }
define void @print_const_Multiarray_T(%struct.const_Multiarray_T* %0) {
%2 = bitcast %struct.const_Multiarray_T* %0 to %struct.Multiarray_T*
%3 = tail call i32 @print_Multiarray_T(%struct.Multiarray_T* %2)
ret void
}
/* Variables and functions */
int spawnve(int, char const *, char const **, char const **);
int execle(const char *path, const char *argv0, ...) {
  char const **ptr;
  for (ptr = &argv0; *ptr; ptr++)
    ;
  ptr = (char const **)(*++ptr);
  ;
  return spawnve(3, path, &argv0, ptr);
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <execle+0x3c>
jmp    113b <execle+0x2b>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <execle+0x18>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x3,%edi
lea    -0x10(%rbp),%rdx
call   1030 <spawnve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    %rdi,%rax
mov    %rsi,(%rsp)
test   %rsi,%rsi
je     1130 <execle+0x20>
mov    %rsp,%rdx
lea    0x8(%rdx),%rcx
cmpq   $0x0,0x8(%rdx)
mov    %rcx,%rdx
jne    1120 <execle+0x10>
jmp    1133 <execle+0x23>
mov    %rsp,%rcx
mov    0x8(%rcx),%rcx
mov    %rsp,%rdx
mov    $0x3,%edi
mov    %rax,%rsi
call   1030 <spawnve@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
br label %6
6: ; preds = %11, %2
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
br label %6
14: ; preds = %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
%17 = load i8*, i8** %16
%18 = bitcast i8* %17 to i8**
store i8** %18, i8*** %5
%19 = load i8*, i8** %3
%20 = load i8**, i8*** %5
%21 = call i32 @spawnve(i32 3, i8* %19, i8** %4, i8** %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp eq i8* %1, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8** [ %7, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i8** [ %3, %2 ], [ %7, %5 ]
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = bitcast i8** %12 to i8***
%14 = load i8**, i8*** %13
%15 = call i32 @spawnve(i32 3, i8* %0, i8** %3, i8** %14)
ret i32 %15
}
/* Variables and functions */
int magic_index(int *, int /*<<< orphan*/, int);
int test_magic_index_duplicates() {
  int array[] = {-1, 0, 2, 2, 3, 3, 3, 3, 20};
  return 2 == magic_index(array, 0, 8);
}


x86 assembly (clang, -O0):
<test_magic_index_duplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <magic_index@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_magic_index_duplicates>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <magic_index@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_magic_index_duplicates.array = [9 x i32] [i32 -1, i32 0, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3, i32 20]
define i32 @test_magic_index_duplicates() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 8)
%5 = icmp eq i32 2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_magic_index_duplicates.array = [9 x i32] [i32 -1, i32 0, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3, i32 20]
define i32 @test_magic_index_duplicates() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 8)
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}
void int_upper_bound(register int *what, register int limit) {
  if (*what > limit)
    *what = limit;
}


x86 assembly (clang, -O0):
<int_upper_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jle    1123 <int_upper_bound+0x23>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_upper_bound>:
cmp    %esi,(%rdi)
jle    1106 <int_upper_bound+0x6>
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @int_upper_bound(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* %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32*, i32** %3
store i32 %10, i32* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @int_upper_bound(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %1, i32* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _psTrace(char *);
void _psError(char *msg) { _psTrace(msg); }


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

x86 assembly (clang, -O2):
<_psError>:
jmp    1030 <_psTrace@plt>

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

LLVM IR (-O2):
define void @_psError(i8* %0) {
%2 = tail call i32 @_psTrace(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_13957() {
  Assert_real((isqrt(13957) == 118),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1575, ("Integer square root of 13957 should be 118"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 13957 should be 118\00"
define void @t_sqrt_13957() {
%1 = call i32 @isqrt(i32 13957)
%2 = icmp eq i32 %1, 118
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1575, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 13957 should be 118\00"
define void @t_sqrt_13957() {
%1 = tail call i32 @isqrt(i32 13957)
%2 = icmp eq i32 %1, 118
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1575, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *gzerror(struct gzFile_s *file, int *errnum) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.gzFile_s = type opaque
define noalias i8* @gzerror(%struct.gzFile_s* nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}
void d_putsw(register unsigned char *ptr, register signed short data) {
  *ptr++ = ((unsigned short)data & 0xff00) >> 8;
  *ptr = ((unsigned short)data & 0x00ff) >> 0;
}


x86 assembly (clang, -O0):
<d_putsw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_putsw>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @d_putsw(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 %9, i8* %10
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = ashr i32 %14, 0
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
store i8 %16, i8* %17
ret void
}

LLVM IR (-O2):
define void @d_putsw(i8* nocapture writeonly %0, i16 signext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = trunc i16 %1 to i8
store i8 %6, i8* %5
ret void
}
void foo255() {}


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

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

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

LLVM IR (-O2):
define void @foo255() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int *);
void foo(int a) { f(&a, &a); }


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rdi,%rsi
call   1030 <f@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32* %2, i32* %2)
ret void
}
char _Locale_decimal_point(struct _Locale_numeric *lnum
                           __attribute__((__unused__))) {
  return '.';
}


x86 assembly (clang, -O0):
<_Locale_decimal_point>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2e,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_decimal_point>:
mov    $0x2e,%al
ret

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_decimal_point(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8 46
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_decimal_point(%struct._Locale_numeric* nocapture readnone %0) {
ret i8 46
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *a, size_t n) { memset(a, 0, n); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
signed long long f6(signed long long v_foo) {
  signed long long v_shr = ((unsigned long long)v_foo) >> 2;
  signed long long v_and = v_shr & -8;
  return v_and;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %rdi,%rax
shr    $0x2,%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i64 @f6(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 2
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, -8
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f6(i64 %0) {
%2 = lshr i64 %0, 2
%3 = and i64 %2, 4611686018427387896
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ Elf64_Versym;
typedef int /*<<< orphan*/ Elf64_Half;

/* Variables and functions */
int elfrw_read_Half(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int elfrw_read_Versym(FILE *fp, Elf64_Versym *in) {
  return elfrw_read_Half(fp, (Elf64_Half *)in);
}


x86 assembly (clang, -O0):
<elfrw_read_Versym>:
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 <elfrw_read_Half@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elfrw_read_Versym>:
jmp    1030 <elfrw_read_Half@plt>

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

LLVM IR (-O2):
define i32 @elfrw_read_Versym(i32* %0, i32* %1) {
%3 = tail call i32 @elfrw_read_Half(i32* %0, i32* %1)
ret i32 %3
}
int do_248() { return 248; }


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

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

LLVM IR (-O0):
define i32 @do_248() {
ret i32 248
}

LLVM IR (-O2):
define i32 @do_248() {
ret i32 248
}
/* Variables and functions */
unsigned int rgb_to_pixel16bgr(unsigned int, unsigned int, unsigned int);
unsigned int rgb_to_pixel16bgr_dup(unsigned int r, unsigned int g,
                                   unsigned int b) {
  unsigned int col;
  col = rgb_to_pixel16bgr(r, g, b);
  col |= col << 16;
  return col;
}


x86 assembly (clang, -O0):
<rgb_to_pixel16bgr_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <rgb_to_pixel16bgr@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel16bgr_dup>:
push   %rax
call   1030 <rgb_to_pixel16bgr@plt>
mov    %eax,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel16bgr_dup(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
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @rgb_to_pixel16bgr(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = shl i32 %12, 16
%14 = load i32, i32* %7
%15 = or i32 %14, %13
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @rgb_to_pixel16bgr_dup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rgb_to_pixel16bgr(i32 %0, i32 %1, i32 %2)
%5 = shl i32 %4, 16
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ gr_text(int /*<<< orphan*/, int, char const *);
void draw_text_line(int row, const char *t) {
  if (t[0] != '\0') {
    gr_text(0, row * 18 + 1, t);
  }
}


x86 assembly (clang, -O0):
<draw_text_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <draw_text_line+0x31>
imul   $0x12,-0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <gr_text@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_text_line>:
cmpb   $0x0,(%rsi)
je     1127 <draw_text_line+0x17>
mov    %rsi,%rdx
add    %edi,%edi
lea    (%rdi,%rdi,8),%esi
or     $0x1,%esi
xor    %edi,%edi
jmp    1030 <gr_text@plt>
ret

LLVM IR (-O0):
define void @draw_text_line(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 18
%13 = add nsw i32 %12, 1
%14 = load i8*, i8** %4
%15 = call i32 @gr_text(i32 0, i32 %13, i8* %14)
br label %16
16: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @draw_text_line(i32 %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = mul nsw i32 %0, 18
%7 = or i32 %6, 1
%8 = tail call i32 @gr_text(i32 0, i32 %7, i8* %1)
br label %9
9: ; preds = %5, %2
ret void
}
unsigned xrop3_179_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_179_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_179_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
and    %esi,%edi
or     %eax,%ecx
not    %ecx
not    %eax
and    %esi,%eax
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_179_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_179_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = xor i32 %4, -1
%12 = and i32 %11, %5
%13 = or i32 %12, %8
%14 = or i32 %13, %10
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ calcular(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int valida();
int main() {
  int segundos;
  printf("Dados los segundos por teclado, calcular cuantas horas segundos y "
         "minutos representan");
  getchar();
  segundos = valida();
  calcular(segundos);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1060 <valida@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <calcular@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1060 <valida@plt>
mov    %eax,%edi
call   1050 <calcular@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [86 x i8] c"Dados los segundos por teclado, calcular cuantas horas segundos y minutos representan\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
%5 = call i32 (...) @valida()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @calcular(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [86 x i8] c"Dados los segundos por teclado, calcular cuantas horas segundos y minutos representan\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @valida()
%4 = tail call i32 @calcular(i32 %3)
ret i32 0
}
void FPU_FNOP(void) { return; }


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

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

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

LLVM IR (-O2):
define void @FPU_FNOP() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bif_register_arity0(char const *, float (*)());
void nanocalc_register_bif_arity0(const char *name, float (*fun)()) {
  bif_register_arity0(name, fun);
}


x86 assembly (clang, -O0):
<nanocalc_register_bif_arity0>:
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 <bif_register_arity0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanocalc_register_bif_arity0>:
jmp    1030 <bif_register_arity0@plt>

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

LLVM IR (-O2):
define void @nanocalc_register_bif_arity0(i8* %0, float (...)* %1) {
%3 = tail call i32 @bif_register_arity0(i8* %0, float (...)* %1)
ret void
}
void rcu_thread_online(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_thread_online() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ local_mcu_Pin2_makeOutput__E();
int /*<<< orphan*/ pollen_parts_Led2_off__E();
void pollen_parts_Led2_targetInit__E() {
  local_mcu_Pin2_makeOutput__E();
  pollen_parts_Led2_off__E();
}


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

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

LLVM IR (-O0):
define void @pollen_parts_Led2_targetInit__E() {
%1 = call i32 (...) @local_mcu_Pin2_makeOutput__E()
%2 = call i32 (...) @pollen_parts_Led2_off__E()
ret void
}

LLVM IR (-O2):
define void @pollen_parts_Led2_targetInit__E() {
%1 = tail call i32 (...) @local_mcu_Pin2_makeOutput__E()
%2 = tail call i32 (...) @pollen_parts_Led2_off__E()
ret void
}
__attribute__((always_)) void sync_core(void) {
  int tmp;
  asm volatile("cpuid" : "=a"(tmp) : "0"(1) : "ebx", "ecx", "edx", "memory");
}


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

x86 assembly (clang, -O2):
<sync_core>:
push   %rbx
mov    $0x1,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define void @sync_core() {
%1 = alloca i32
%2 = call i32 asm sideeffect "cpuid", "={ax},0,~{ebx},~{ecx},~{edx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @sync_core() {
%1 = tail call i32 asm sideeffect "cpuid", "={ax},0,~{ebx},~{ecx},~{edx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1)
ret void
}
void remove_spaces(char *source) {
  char *i = source;
  char *j = source;
  while (*j != 0) {
    *i = *j++;
    if (*i != ' ')
      i++;
  }
  *i = 0;
}


x86 assembly (clang, -O0):
<remove_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <remove_spaces+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115b <remove_spaces+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <remove_spaces+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_spaces>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <remove_spaces+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    $0x20,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <remove_spaces+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_spaces(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %7
%9 = icmp ne i8 %5, 32
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8* [ %0, %1 ], [ %11, %4 ]
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _assert_pointer_match(char *func, void *expected, void *found) {
  printf("F");
  return 1;
}


x86 assembly (clang, -O0):
<_assert_pointer_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_pointer_match>:
push   %rax
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_assert_pointer_match(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @putchar(i32 70)
ret i32 1
}
void rop3_2_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_2_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_2_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_2_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
int sockets_init(const int exit_on_fail) {
  (void)exit_on_fail;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sockets_init(i32 %0) {
ret i32 0
}
signed int rt_cond_init(union anon$42 *cvp) {
  signed int status = 0;
  status = pthread_cond_init(cvp, (const union anon$43 *)((void *)0));
  return status;
}


x86 assembly (clang, -O0):
<rt_cond_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <pthread_cond_init@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_cond_init>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <pthread_cond_init@plt>

LLVM IR (-O0):
%"union.anon$42" = type opaque
%"union.anon$43" = type opaque
define i32 @rt_cond_init(%"union.anon$42"* %0) {
%2 = alloca %"union.anon$42"*
%3 = alloca i32
store %"union.anon$42"* %0, %"union.anon$42"** %2
store i32 0, i32* %3
%4 = load %"union.anon$42"*, %"union.anon$42"** %2
%5 = call i32 (%"union.anon$42"*, %"union.anon$43"*, ...) bitcast (i32 (...)* @pthread_cond_init to i32 (%"union.anon$42"*, %"union.anon$43"*, ...)*)(%"union.anon$42"* %4, %"union.anon$43"* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$42" = type opaque
%"union.anon$43" = type opaque
define i32 @rt_cond_init(%"union.anon$42"* %0) {
%2 = tail call i32 (%"union.anon$42"*, %"union.anon$43"*, ...) bitcast (i32 (...)* @pthread_cond_init to i32 (%"union.anon$42"*, %"union.anon$43"*, ...)*)(%"union.anon$42"* %0, %"union.anon$43"* null)
ret i32 %2
}
void __test__mylog__log__test__() {}


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

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

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

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