xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __NR_exit;
int /*<<< orphan*/ __NR_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, ...);
int _start() {
  syscall(__NR_write, 1, "hello world\n", 12);
  syscall(__NR_exit, 0);
  return (0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
lea    0xed7(%rip),%rdx
mov    $0xc,%ecx
mov    $0x0,%al
call   1030 <syscall@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rdx
mov    $0x1,%esi
mov    $0xc,%ecx
xor    %eax,%eax
call   1030 <syscall@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__NR_write = global i32 0
@.str = [13 x i8] c"hello world\0A\00"
@__NR_exit = global i32 0
define i32 @_start() {
%1 = load i32, i32* @__NR_write
%2 = call i32 (i32, i32, ...) @syscall(i32 %1, i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = load i32, i32* @__NR_exit
%4 = call i32 (i32, i32, ...) @syscall(i32 %3, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__NR_write = global i32 0
@.str = [13 x i8] c"hello world\0A\00"
@__NR_exit = global i32 0
define i32 @_start() {
%1 = load i32, i32* @__NR_write
%2 = tail call i32 (i32, i32, ...) @syscall(i32 %1, i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = load i32, i32* @__NR_exit
%4 = tail call i32 (i32, i32, ...) @syscall(i32 %3, i32 0)
ret i32 0
}
unsigned map_hash(const char *str) {
  unsigned hash = 5381;
  while (*str) {
    hash = ((hash << 5) + hash) ^ *str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<map_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <map_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <map_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <map_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <map_hash+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i32 @map_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 5
%11 = load i32, i32* %3
%12 = add i32 %10, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = xor i32 %12, %16
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @map_hash(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 i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int clock_gettime(int, struct timespec *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct timespec tp;
  if (clock_gettime(9999, &tp) == -1) {
    printf("Test PASSED\n");
    return 0;
  } else {
    printf("Test FAILED\n");
    return 1;
  }
  printf("This code should not be executed.\n");
  return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x270f,%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    115e <main+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1171 <main+0x51>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
mov    $0x270f,%edi
call   1040 <clock_gettime@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
setne  %bl
lea    0xec9(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [13 x i8] c"Test PASSED\0A\00"
@.str.1 = [13 x i8] c"Test FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = call i32 @clock_gettime(i32 9999, %struct.timespec* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@str = [12 x i8] c"Test FAILED\00"
@str.2 = [12 x i8] c"Test PASSED\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @clock_gettime(i32 9999, %struct.timespec* %1)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_err_hex32(unsigned int value) { __console_tx_hex32(3, value); }


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

x86 assembly (clang, -O2):
<print_err_hex32>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_err_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inverse(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmInverse(char *str) { printColor(inverse(str)); }


x86 assembly (clang, -O0):
<cmInverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <inverse@plt>
mov    %eax,%edi
call   1030 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmInverse>:
push   %rax
call   1040 <inverse@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmInverse(i8* %0) {
%2 = tail call i32 @inverse(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Variables and functions */
unsigned long millis();
void ota_update_loop() {
  static unsigned long last_ota_check = 0;
  if (millis() > last_ota_check + 10) {
    last_ota_check = millis();
  }
}


x86 assembly (clang, -O0):
<ota_update_loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <millis@plt>
mov    0x2f0e(%rip),%rcx
add    $0xa,%rcx
cmp    %rcx,%rax
jbe    113d <ota_update_loop+0x2d>
mov    $0x0,%al
call   1030 <millis@plt>
mov    %rax,0x2ef3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ota_update_loop>:
push   %rax
xor    %eax,%eax
call   1030 <millis@plt>
mov    0x2f11(%rip),%rcx
add    $0xa,%rcx
cmp    %rcx,%rax
jbe    1136 <ota_update_loop+0x26>
xor    %eax,%eax
call   1030 <millis@plt>
mov    %rax,0x2efa(%rip)
pop    %rax
ret

LLVM IR (-O0):
@ota_update_loop.last_ota_check = internal global i64 0
define void @ota_update_loop() {
%1 = call i64 (...) @millis()
%2 = load i64, i64* @ota_update_loop.last_ota_check
%3 = add i64 %2, 10
%4 = icmp ugt i64 %1, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i64 (...) @millis()
store i64 %6, i64* @ota_update_loop.last_ota_check
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@ota_update_loop.last_ota_check = internal unnamed_addr global i64 0
define void @ota_update_loop() {
%1 = tail call i64 (...) @millis()
%2 = load i64, i64* @ota_update_loop.last_ota_check
%3 = add i64 %2, 10
%4 = icmp ugt i64 %1, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i64 (...) @millis()
store i64 %6, i64* @ota_update_loop.last_ota_check
br label %7
7: ; preds = %5, %0
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ *strstr(int /*<<< orphan*/, char *);
int match_dev_name(const struct dirent *entry) {
  if (strstr(entry->d_name, "mtdblock") == NULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<match_dev_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
jne    1144 <match_dev_name+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114b <match_dev_name+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_dev_name>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [9 x i8] c"mtdblock\00"
define i32 @match_dev_name(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32* @strstr(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [9 x i8] c"mtdblock\00"
define i32 @match_dev_name(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32* @strstr(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
char __ocl_rotate_char(char src1, char src2) {
  char lshift = src2 & ((1 << 3) - 1);
  char overflow = (src1 >> (8 - lshift)) & ((((char)1) << lshift) - 1);
  return (src1 << lshift) | overflow;
}


x86 assembly (clang, -O0):
<__ocl_rotate_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%edx
mov    $0x8,%ecx
sub    %edx,%ecx
sar    %cl,%eax
movsbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %al,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%ecx
shl    %cl,%eax
movsbl -0x4(%rbp),%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_rotate_char>:
and    $0x7,%sil
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%edx
sar    %cl,%edx
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
and    %edx,%eax
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @__ocl_rotate_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = and i32 %8, 7
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = sub nsw i32 8, %14
%16 = ashr i32 %12, %15
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = shl i32 1, %18
%20 = sub nsw i32 %19, 1
%21 = and i32 %16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %6
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = shl i32 %24, %26
%28 = load i8, i8* %6
%29 = sext i8 %28 to i32
%30 = or i32 %27, %29
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define signext i8 @__ocl_rotate_char(i8 signext %0, i8 signext %1) {
%3 = and i8 %1, 7
%4 = sext i8 %0 to i32
%5 = zext i8 %3 to i32
%6 = sub nuw nsw i32 8, %5
%7 = ashr i32 %4, %6
%8 = shl nsw i32 -1, %5
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = shl nsw i32 %4, %5
%12 = or i32 %10, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}
/* Type definitions */
struct reader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ readerSkipExplicit(struct reader *, char const *,
                                      int /*<<< orphan*/);
void readerFind(struct reader *r, const char *find) {
  readerSkipExplicit(r, find, 0);
}


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

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

LLVM IR (-O0):
%struct.reader = type { i32 }
define void @readerFind(%struct.reader* %0, i8* %1) {
%3 = alloca %struct.reader*
%4 = alloca i8*
store %struct.reader* %0, %struct.reader** %3
store i8* %1, i8** %4
%5 = load %struct.reader*, %struct.reader** %3
%6 = load i8*, i8** %4
%7 = call i32 @readerSkipExplicit(%struct.reader* %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.reader = type { i32 }
define void @readerFind(%struct.reader* %0, i8* %1) {
%3 = tail call i32 @readerSkipExplicit(%struct.reader* %0, i8* %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
size_t PTRDIFF_MAX;
size_t SIZE_MAX;
int syscall(int, int /*<<< orphan*/, size_t, int);
int shmget(key_t key, size_t size, int flag) {
  if (size > PTRDIFF_MAX)
    size = SIZE_MAX;
  return syscall(307, key, size, flag);
}


x86 assembly (clang, -O0):
<shmget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jbe    1144 <shmget+0x34>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x133,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmget>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
cmp    %rdx,(%rax)
jae    112d <shmget+0x1d>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rdx
mov    $0x133,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@PTRDIFF_MAX = global i64 0
@SIZE_MAX = global i64 0
define i32 @shmget(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = load i64, i64* @PTRDIFF_MAX
%9 = icmp ugt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* @SIZE_MAX
store i64 %11, i64* %5
br label %12
12: ; preds = %10, %3
%13 = load i32, i32* %4
%14 = load i64, i64* %5
%15 = load i32, i32* %6
%16 = call i32 @syscall(i32 307, i32 %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@PTRDIFF_MAX = global i64 0
@SIZE_MAX = global i64 0
define i32 @shmget(i32 %0, i64 %1, i32 %2) {
%4 = load i64, i64* @PTRDIFF_MAX
%5 = icmp ult i64 %4, %1
%6 = load i64, i64* @SIZE_MAX
%7 = select i1 %5, i64 %6, i64 %1
%8 = tail call i32 @syscall(i32 307, i32 %0, i64 %7, i32 %2)
ret i32 %8
}
void sig_hand(int a) {}


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

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

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

LLVM IR (-O2):
define void @sig_hand(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tzset();
void rust_tzset() { tzset(); }


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

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

LLVM IR (-O0):
define void @rust_tzset() {
%1 = call i32 (...) @tzset()
ret void
}

LLVM IR (-O2):
define void @rust_tzset() {
%1 = tail call i32 (...) @tzset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void cprintarr(double *arr, int size) {
  for (int i = 0; i < size; i++) {
    printf("%lf ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<cprintarr>:
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    115b <cprintarr+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <cprintarr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprintarr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1159 <cprintarr+0x39>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <cprintarr+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"%lf \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @cprintarr(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %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 double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %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"%lf \00"
define void @cprintarr(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int cpuidle_register_governor(struct cpuidle_governor *gov) { return 0; }


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

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

LLVM IR (-O0):
%struct.cpuidle_governor = type opaque
define i32 @cpuidle_register_governor(%struct.cpuidle_governor* %0) {
%2 = alloca %struct.cpuidle_governor*
store %struct.cpuidle_governor* %0, %struct.cpuidle_governor** %2
ret i32 0
}

LLVM IR (-O2):
%struct.cpuidle_governor = type opaque
define i32 @cpuidle_register_governor(%struct.cpuidle_governor* nocapture readnone %0) {
ret i32 0
}
int s_socket_bsd_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @s_socket_bsd_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/ *);
void rpmlskip(FILE *fp, int l) {
  while (l-- > 0)
    (void)getc(fp);
}


x86 assembly (clang, -O0):
<rpmlskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1141 <rpmlskip+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
jmp    111f <rpmlskip+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmlskip>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <rpmlskip+0x20>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <getc@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <rpmlskip+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @rpmlskip(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @getc(i32* %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ UI;

/* Variables and functions */
int /*<<< orphan*/ *UI_new_method(int /*<<< orphan*/ *);
UI *UI_new(void) { return (UI_new_method(NULL)); }


x86 assembly (clang, -O0):
<UI_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <UI_new_method@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_new>:
xor    %edi,%edi
jmp    1030 <UI_new_method@plt>

LLVM IR (-O0):
define i32* @UI_new() {
%1 = call i32* @UI_new_method(i32* null)
ret i32* %1
}

LLVM IR (-O2):
define i32* @UI_new() {
%1 = tail call i32* @UI_new_method(i32* null)
ret i32* %1
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ clean_gui();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_intr(int signo) {
  if (signo == SIGINT) {
    clean_gui();
    endwin();
    exit(0);
  }
  return;
}


x86 assembly (clang, -O0):
<sig_intr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1162 <sig_intr+0x32>
mov    $0x0,%al
call   1030 <clean_gui@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_intr>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <sig_intr+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <clean_gui@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sig_intr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (...) @clean_gui()
%8 = call i32 (...) @endwin()
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sig_intr(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @clean_gui()
%6 = tail call i32 (...) @endwin()
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}
int weofread(cookie, buf, len) void *cookie;
char *buf;
int len;
{ return (0); }


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

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

LLVM IR (-O0):
define i32 @weofread(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @weofread(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int init_sim(struct ir_remote *remote, struct ir_ncode *code,
             int repeat_preset) {
  return 1;
}


x86 assembly (clang, -O0):
<init_sim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.ir_remote = type opaque
%struct.ir_ncode = type opaque
define i32 @init_sim(%struct.ir_remote* nocapture readnone %0, %struct.ir_ncode* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void p(int n) { printf("in p %d\n", n); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"in p %d\0A\00"
define void @p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"in p %d\0A\00"
define void @p(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_not() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          17, -1, ~0);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          18, -3, ~2);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          19, 0, ~-1);
  ;
}


x86 assembly (clang, -O0):
<test_not>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xecd(%rip),%rdi
mov    $0x12,%esi
mov    $0xfffffffd,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xeb5(%rip),%rdi
mov    $0x13,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x11,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
mov    $0xfffffffd,%edx
mov    $0xfffffffd,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_not() {
%1 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 17, i32 -1, i32 -1)
%2 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 18, i32 -3, i32 -3)
%3 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 19, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_not() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 17, i32 -1, i32 -1)
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 18, i32 -3, i32 -3)
%3 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 19, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main(void) {
  setuid(0);
  system("/usr/bin/mdutil -i off -a");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"/usr/bin/mdutil -i off -a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"/usr/bin/mdutil -i off -a\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float fminf(float, float);
void __hv_min_f(float bIn0, float bIn1, float *bOut) {
  *bOut = fminf(bIn0, bIn1);
}


x86 assembly (clang, -O0):
<__hv_min_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_min_f>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movss  %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @__hv_min_f(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call float @llvm.minnum.f32(float %7, float %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @__hv_min_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call float @llvm.minnum.f32(float %0, float %1)
store float %4, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x0e() {
  Assert_real((iscntrl(14)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              75, ("iscntrl should be 1 for 0x0e"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x0e>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x4b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x0e>:
push   %rax
mov    $0xe,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x4b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0e\00"
define void @t_iscntrl_0x0e() {
%1 = tail call i32 @iscntrl(i32 14)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long size(FILE *fp) {
  fseek(fp, 0L, SEEK_END);
  long sz = ftell(fp);
  fseek(fp, 0L, SEEK_SET);
  return sz;
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i64 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i64 0, i32 %5)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ UNUSED(unsigned long);
void Zip_Interrupt_Disable(unsigned long irq) {
  UNUSED(irq);
  return;
}


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

x86 assembly (clang, -O2):
<Zip_Interrupt_Disable>:
jmp    1030 <UNUSED@plt>

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

LLVM IR (-O2):
define void @Zip_Interrupt_Disable(i64 %0) {
%2 = tail call i32 @UNUSED(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
void s_copy_elems(void *t, size_t t_off, const void *s, size_t s_off, size_t n,
                  size_t e_size) {
  if (t && s)
    memcpy((char *)t + t_off * e_size, (const char *)s + s_off * e_size,
           n * e_size);
}


x86 assembly (clang, -O0):
<s_copy_elems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <s_copy_elems+0x64>
cmpq   $0x0,-0x18(%rbp)
je     1174 <s_copy_elems+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   -0x30(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
imul   -0x30(%rbp),%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
imul   -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_copy_elems>:
test   %rdi,%rdi
je     1137 <s_copy_elems+0x27>
test   %rdx,%rdx
je     1137 <s_copy_elems+0x27>
imul   %r9,%rsi
add    %rsi,%rdi
imul   %r9,%rcx
add    %rcx,%rdx
imul   %r9,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
jmp    1030 <memcpy@plt>
ret

LLVM IR (-O0):
define void @s_copy_elems(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %33
15: ; preds = %6
%16 = load i8*, i8** %9
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = load i8*, i8** %7
%20 = load i64, i64* %8
%21 = load i64, i64* %12
%22 = mul i64 %20, %21
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8*, i8** %9
%25 = load i64, i64* %10
%26 = load i64, i64* %12
%27 = mul i64 %25, %26
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i64, i64* %11
%30 = load i64, i64* %12
%31 = mul i64 %29, %30
%32 = call i32 @memcpy(i8* %23, i8* %28, i64 %31)
br label %33
33: ; preds = %18, %15, %6
ret void
}

LLVM IR (-O2):
define void @s_copy_elems(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4, i64 %5) {
%7 = icmp ne i8* %0, null
%8 = icmp ne i8* %2, null
%9 = and i1 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = mul i64 %5, %1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = mul i64 %5, %3
%14 = getelementptr inbounds i8, i8* %2, i64 %13
%15 = mul i64 %5, %4
%16 = tail call i32 @memcpy(i8* %12, i8* %14, i64 %15)
br label %17
17: ; preds = %10, %6
ret void
}
int utl_strlen(char *str) {
  int it;
  it = 0;
  while (str[it] != '\0')
    it++;
  return (it);
}


x86 assembly (clang, -O0):
<utl_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <utl_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <utl_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <utl_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @utl_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = 1 + 2 + 3;
  i = i + i;
  printf("i = %i\n", i);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"i = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
void test1_ArrayAssign_markUsed__E() {}


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

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

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

LLVM IR (-O2):
define void @test1_ArrayAssign_markUsed__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int mergeSortAndCountInversion(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Consider the array { 1, 5, 4, 2, 3 }.\n");
  int A[] = {1, 5, 4, 2, 3};
  printf("Its inversion count = %d.\n", mergeSortAndCountInversion(A, 5));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xf03(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xf00(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xefe(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <mergeSortAndCountInversion@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    0xeba(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1060 <mergeSortAndCountInversion@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Consider the array { 1, 5, 4, 2, 3 }.\0A\00"
@__const.main.A = [5 x i32] [i32 1, i32 5, i32 4, i32 2, i32 3]
@.str.1 = [27 x i8] c"Its inversion count = %d.\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @mergeSortAndCountInversion(i32* %4, i32 5)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [5 x i32] [i32 1, i32 5, i32 4, i32 2, i32 3]
@.str.1 = [27 x i8] c"Its inversion count = %d.\0A\00"
@str = [38 x i8] c"Consider the array { 1, 5, 4, 2, 3 }.\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @mergeSortAndCountInversion(i32* %4, i32 5)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
void XGetPointerControl() {}


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

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

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

LLVM IR (-O2):
define void @XGetPointerControl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_init(int);
void console_init(void) { serial_init(0x3f8); }


x86 assembly (clang, -O0):
<console_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f8,%edi
call   1030 <serial_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_init>:
mov    $0x3f8,%edi
jmp    1030 <serial_init@plt>

LLVM IR (-O0):
define void @console_init() {
%1 = call i32 @serial_init(i32 1016)
ret void
}

LLVM IR (-O2):
define void @console_init() {
%1 = tail call i32 @serial_init(i32 1016)
ret void
}