xunge/DecIR huggingface dataset:
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *);
void tinyrl_vt100_erase_line_end(struct tinyrl *this) {
  tinyrl_printf(this, "\x1b[0K");
}


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

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

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[0K\00"
define void @tinyrl_vt100_erase_line_end(%struct.tinyrl* %0) {
%2 = alloca %struct.tinyrl*
store %struct.tinyrl* %0, %struct.tinyrl** %2
%3 = load %struct.tinyrl*, %struct.tinyrl** %2
%4 = call i32 @tinyrl_printf(%struct.tinyrl* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[0K\00"
define void @tinyrl_vt100_erase_line_end(%struct.tinyrl* %0) {
%2 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int __test() {
  int x = 3;
  switch (x) {
  case 1:
    return 4;
  case 2:
    return 5;
  case 17:
    return 6;
  case 5:
    return 7;
  default:
    return 1337;
  }
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x10,%eax
ja     1164 <__test+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    116b <__test+0x6b>
movl   $0x5,-0x4(%rbp)
jmp    116b <__test+0x6b>
movl   $0x6,-0x4(%rbp)
jmp    116b <__test+0x6b>
movl   $0x7,-0x4(%rbp)
jmp    116b <__test+0x6b>
movl   $0x539,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %5
i32 17, label %6
i32 5, label %7
]
4: ; preds = %0
store i32 4, i32* %1
br label %9
5: ; preds = %0
store i32 5, i32* %1
br label %9
6: ; preds = %0
store i32 6, i32* %1
br label %9
7: ; preds = %0
store i32 7, i32* %1
br label %9
8: ; preds = %0
store i32 1337, i32* %1
br label %9
9: ; preds = %8, %7, %6, %5, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 1337
}
/* Variables and functions */
int /*<<< orphan*/ fn1(int);
void fn3() { fn1(267); }


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

x86 assembly (clang, -O2):
<fn3>:
mov    $0x10b,%edi
jmp    1030 <fn1@plt>

LLVM IR (-O0):
define void @fn3() {
%1 = call i32 @fn1(i32 267)
ret void
}

LLVM IR (-O2):
define void @fn3() {
%1 = tail call i32 @fn1(i32 267)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga_putc(char);
void vga_write(char *str) {
  int i = 0;
  while (str[i] != 0x00) {
    vga_putc(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<vga_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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     1157 <vga_write+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <vga_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <vga_write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <vga_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <vga_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <vga_write+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @vga_write(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 %21
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @vga_putc(i8 signext %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @vga_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @vga_putc(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int magicValue() { return 156; }


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

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

LLVM IR (-O0):
define i32 @magicValue() {
ret i32 156
}

LLVM IR (-O2):
define i32 @magicValue() {
ret i32 156
}
/* Variables and functions */
int /*<<< orphan*/ Centaurus_write_gpio(int, int, unsigned long);
void Centaurus_Power_Up(void) {
  unsigned long off_data = 0x01000000;
  Centaurus_write_gpio(4, 0x00000400 + 0x08, off_data);
  return;
}


x86 assembly (clang, -O0):
<Centaurus_Power_Up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1000000,-0x8(%rbp)
01
mov    -0x8(%rbp),%rdx
mov    $0x4,%edi
mov    $0x408,%esi
call   1030 <Centaurus_write_gpio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Centaurus_Power_Up>:
mov    $0x1000000,%edx
mov    $0x4,%edi
mov    $0x408,%esi
jmp    1030 <Centaurus_write_gpio@plt>

LLVM IR (-O0):
define void @Centaurus_Power_Up() {
%1 = alloca i64
store i64 16777216, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @Centaurus_write_gpio(i32 4, i32 1032, i64 %2)
ret void
}

LLVM IR (-O2):
define void @Centaurus_Power_Up() {
%1 = tail call i32 @Centaurus_write_gpio(i32 4, i32 1032, i64 16777216)
ret void
}
int is_next_char(int c, const void *vpx, unsigned offset, unsigned length) {
  const char *px = (const char *)vpx;
  if (offset >= length)
    return 0;
  return px[offset] == c;
}


x86 assembly (clang, -O0):
<is_next_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jb     1131 <is_next_char+0x31>
movl   $0x0,-0x4(%rbp)
jmp    114a <is_next_char+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_next_char>:
xor    %eax,%eax
cmp    %ecx,%edx
jae    1113 <is_next_char+0x13>
mov    %edx,%eax
movsbl (%rsi,%rax,1),%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_next_char(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %2, %3
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %4, %6
%14 = phi i32 [ %12, %6 ], [ 0, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void osd_ext_clone_task_stop(void) {
  printk("-- osd_ext_clone depends on GE2D module!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"-- osd_ext_clone depends on GE2D module!\0A\00"
define void @osd_ext_clone_task_stop() {
%1 = call i32 @printk(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"-- osd_ext_clone depends on GE2D module!\0A\00"
define void @osd_ext_clone_task_stop() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
int iflog2(unsigned int a) {
  int x = 0;
  while (a >>= 1)
    ++x;
  return x;
}


x86 assembly (clang, -O0):
<iflog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <iflog2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <iflog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iflog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <iflog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <iflog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @iflog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void rw_default_handler(unsigned int sig, void *data, void *gdata) {
  printf("Received signal %u\n", sig);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Received signal %u\0A\00"
define void @rw_default_handler(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Received signal %u\0A\00"
define void @rw_default_handler(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void B_timerinterrupt() {}


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

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

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

LLVM IR (-O2):
define void @B_timerinterrupt() {
ret void
}
const char *build_date() { return "Mar 18 2022"; }


x86 assembly (clang, -O0):
<build_date>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_date>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ seatest_simple_test_result(int, char *, char const *,
                                              unsigned int);
void seatest_assert_false(int test, const char *function, unsigned int line) {
  seatest_simple_test_result(!test, "Should of been false", function, line);
}


x86 assembly (clang, -O0):
<seatest_assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xec2(%rip),%rsi
call   1030 <seatest_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seatest_assert_false>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <seatest_simple_test_result@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Should of been false\00"
define void @seatest_assert_false(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @seatest_simple_test_result(i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Should of been false\00"
define void @seatest_assert_false(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @seatest_simple_test_result(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const, char const *const);
void print_dec(const char *const name, const char *const val) {
  printf("   %-46s : constant         := %s;\n", name, val);
}


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

x86 assembly (clang, -O2):
<print_dec>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [36 x i8] c" %-46s : constant := %s;\0A\00"
define void @print_dec(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int yogrt_get_debug();
int iyogrt_get_debug__(void) { return yogrt_get_debug(); }


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

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

LLVM IR (-O0):
define i32 @iyogrt_get_debug__() {
%1 = call i32 (...) @yogrt_get_debug()
ret i32 %1
}

LLVM IR (-O2):
define i32 @iyogrt_get_debug__() {
%1 = tail call i32 (...) @yogrt_get_debug()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pg;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
do_recurse() {
  char pg[4096];
  memset(pg, 0xba, sizeof(pg));
  do_recurse();
}


x86 assembly (clang, -O0):
<do_recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
lea    -0x1010(%rbp),%rdi
mov    $0xba,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
call   1040 <do_recurse@plt>
mov    -0x4(%rbp),%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_recurse>:
sub    $0x1008,%rsp
mov    %rsp,%rdi
mov    $0xba,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
call   1040 <do_recurse@plt>
add    $0x1008,%rsp
ret

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

LLVM IR (-O2):
define i32 @do_recurse() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 186, i32 4096)
%4 = call i32 @do_recurse()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x7a() {
  Assert_real((isprint(122)),
              "/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_isprint.c",
              615, ("isprint should be 1 for z"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x7a>:
push   %rax
mov    $0x7a,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x267,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for z\00"
define void @t_isprint_0x7a() {
%1 = call i32 @isprint(i32 122)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for z\00"
define void @t_isprint_0x7a() {
%1 = tail call i32 @isprint(i32 122)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void squares(int v) {
  for (int i = 1; i < v + 1; i++) {
    printf("%d ", i * i);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<squares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1156 <squares+0x46>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <squares+0x12>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squares>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1162 <squares+0x42>
mov    %edi,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
imul   %ebx,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <squares+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @squares(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = 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 = [4 x i8] c"%d \00"
define void @squares(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 1, %1 ]
%7 = mul nsw i32 %6, %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i32 %6, 1
%10 = icmp eq i32 %6, %0
br i1 %10, label %3, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int mspack_sys_selftest_internal(int offt_size) {
  return (sizeof(off_t) == offt_size) ? (0) : (5);
}


x86 assembly (clang, -O0):
<mspack_sys_selftest_internal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
mov    $0x4,%edx
mov    $0x5,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mspack_sys_selftest_internal>:
xor    %eax,%eax
cmp    $0x4,%edi
setne  %al
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @mspack_sys_selftest_internal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp eq i64 4, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 5
ret i32 %7
}

LLVM IR (-O2):
define i32 @mspack_sys_selftest_internal(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = select i1 %2, i32 0, i32 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_evdev();
int /*<<< orphan*/ clear_uinput();
void clear_input() {
  clear_evdev();
  clear_uinput();
}


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

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

LLVM IR (-O0):
define void @clear_input() {
%1 = call i32 (...) @clear_evdev()
%2 = call i32 (...) @clear_uinput()
ret void
}

LLVM IR (-O2):
define void @clear_input() {
%1 = tail call i32 (...) @clear_evdev()
%2 = tail call i32 (...) @clear_uinput()
ret void
}
/* Variables and functions */
int daemon(int, int);
int os_daemon(int nochdir, int noclose) { return daemon(nochdir, noclose); }


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

x86 assembly (clang, -O2):
<os_daemon>:
jmp    1030 <daemon@plt>

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

LLVM IR (-O2):
define i32 @os_daemon(i32 %0, i32 %1) {
%3 = tail call i32 @daemon(i32 %0, i32 %1)
ret i32 %3
}
int check_instance() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_instance() {
ret i32 0
}
void exit_ext3_xattr(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_ext3_xattr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ naturalNums(int, int);
int /*<<< orphan*/ printf(char *, int);
void naturalNums_reccursive(int num, int max) {
  if (num <= max) {
    printf("%d\n", num);
    num++;
    naturalNums(num, max);
  }
}


x86 assembly (clang, -O0):
<naturalNums_reccursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115d <naturalNums_reccursive+0x3d>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <naturalNums@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalNums_reccursive>:
cmp    %esi,%edi
jle    1125 <naturalNums_reccursive+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <naturalNums@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @naturalNums_reccursive(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = add nsw i32 %0, 1
%7 = tail call i32 @naturalNums(i32 %6, i32 %1)
br label %8
8: ; preds = %4, %2
ret void
}
void *cmalloc(int size) {
  int i;
  char *p = malloc(size);
  for (i = 0; i < size; i++)
    p[i] = 0;
  return p;
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1155 <cmalloc+0x45>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <cmalloc+0x1f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
movslq %edi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1144 <cmalloc+0x24>
mov    %ebp,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @cmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int i_dim(int *, int *);
int intr_wrap_173(int p1, int p2) { return i_dim(&p1, &p2); }


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

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

LLVM IR (-O0):
define i32 @intr_wrap_173(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @i_dim(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_173(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @i_dim(i32* %3, i32* %4)
ret i32 %5
}
int first_unordered(int n[], int size) {
  for (int i = 1; i < size; i++) {
    if (n[i] < n[i - 1])
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<first_unordered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115d <first_unordered+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    114a <first_unordered+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <first_unordered+0x64>
jmp    114f <first_unordered+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <first_unordered+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_unordered>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jl     1132 <first_unordered+0x32>
mov    %esi,%r8d
mov    (%rdi),%esi
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%ecx
mov    (%rdi,%rdx,4),%esi
cmp    %ecx,%esi
jl     1133 <first_unordered+0x33>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1120 <first_unordered+0x20>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @first_unordered(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %7
7: ; preds = %4, %13
%8 = phi i32 [ %6, %4 ], [ %11, %13 ]
%9 = phi i64 [ 1, %4 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, %8
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %18, label %7
16: ; preds = %7
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %2
%19 = phi i32 [ -1, %2 ], [ %17, %16 ], [ -1, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ init_sysCx();
int /*<<< orphan*/ lose_sysCx();
int /*<<< orphan*/ testfn_LgTable();
int /*<<< orphan*/ testfn_stress_LgTable();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  init_sysCx();
  testfn_LgTable();
  testfn_stress_LgTable();
  lose_sysCx();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <init_sysCx@plt>
mov    $0x0,%al
call   1050 <testfn_LgTable@plt>
mov    $0x0,%al
call   1060 <testfn_stress_LgTable@plt>
mov    $0x0,%al
call   1040 <lose_sysCx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_sysCx@plt>
xor    %eax,%eax
call   1050 <testfn_LgTable@plt>
xor    %eax,%eax
call   1060 <testfn_stress_LgTable@plt>
xor    %eax,%eax
call   1040 <lose_sysCx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @init_sysCx()
%9 = call i32 (...) @testfn_LgTable()
%10 = call i32 (...) @testfn_stress_LgTable()
%11 = call i32 (...) @lose_sysCx()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_sysCx()
%4 = tail call i32 (...) @testfn_LgTable()
%5 = tail call i32 (...) @testfn_stress_LgTable()
%6 = tail call i32 (...) @lose_sysCx()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SIGNATURE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SIGNATURE_it;
void OCSP_SIGNATURE_free(OCSP_SIGNATURE *a) {
  ASN1_item_free((ASN1_VALUE *)a, &OCSP_SIGNATURE_it);
}


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

x86 assembly (clang, -O2):
<OCSP_SIGNATURE_free>:
mov    0x2ec1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@OCSP_SIGNATURE_it = global i32 0
define void @OCSP_SIGNATURE_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @OCSP_SIGNATURE_it)
ret void
}
nullproc(f, n) int n, f;
{}


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

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

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

LLVM IR (-O2):
define i32 @nullproc(i32 %0, i32 %1) {
ret i32 undef
}
int do_547() { return 547; }


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

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

LLVM IR (-O0):
define i32 @do_547() {
ret i32 547
}

LLVM IR (-O2):
define i32 @do_547() {
ret i32 547
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ const *, int);
int osal_is_directory(const wchar_t *_name) {
  char name[260 + 1];
  wcstombs(name, _name, 260);
  DIR *dir;
  dir = opendir(name);
  if (dir != NULL) {
    closedir(dir);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<osal_is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x104,%edx
call   1050 <wcstombs@plt>
lea    -0x120(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     118d <osal_is_directory+0x5d>
mov    -0x128(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1194 <osal_is_directory+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osal_is_directory>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x104,%edx
call   1050 <wcstombs@plt>
mov    %rbx,%rdi
call   1030 <opendir@plt>
test   %rax,%rax
je     1167 <osal_is_directory+0x37>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
jmp    1169 <osal_is_directory+0x39>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @osal_is_directory(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [261 x i8]
%5 = alloca i32*
store i32* %0, i32** %3
%6 = getelementptr inbounds [261 x i8], [261 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** %3
%8 = call i32 @wcstombs(i8* %6, i32* %7, i32 260)
%9 = getelementptr inbounds [261 x i8], [261 x i8]* %4, i64 0, i64 0
%10 = call i32* @opendir(i8* %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32*, i32** %5
%15 = call i32 @closedir(i32* %14)
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @osal_is_directory(i32* %0) {
%2 = alloca [261 x i8]
%3 = getelementptr inbounds [261 x i8], [261 x i8]* %2, i64 0, i64 0
%4 = call i32 @wcstombs(i8* %3, i32* %0, i32 260)
%5 = call i32* @opendir(i8* %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @closedir(i32* %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 1, %7 ], [ 0, %1 ]
ret i32 %10
}
int cstr_len(char *s) {
  char *r;
  if ((r = s)) {
    while ((*s)) {
      ++s;
    }
  }
  return (s - r);
}


x86 assembly (clang, -O0):
<cstr_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1142 <cstr_len+0x42>
jmp    111f <cstr_len+0x1f>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <cstr_len+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <cstr_len+0x1f>
jmp    1142 <cstr_len+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_len>:
test   %rdi,%rdi
je     1120 <cstr_len+0x20>
lea    -0x1(%rdi),%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rcx)
mov    %rax,%rcx
jne    1110 <cstr_len+0x10>
sub    %edi,%eax
ret
xor    %eax,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cstr_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
%10 = ptrtoint i8* %9 to i64
%11 = ptrtoint i8* %0 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_new_sockaddr() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_new_sockaddr"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_client_new_sockaddr>:
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_socket_client_new_sockaddr>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_sockaddr\00"
define i32 @pa_socket_client_new_sockaddr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Master Falindir\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hello Master Falindir\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Hello Master Falindir\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int clamp(int value, int min, int max) {
  return value < min ? min : (value > max ? max : value);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void do_something_init(void) { pr_alert("%s\n", __func__); }


x86 assembly (clang, -O0):
<do_something_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_alert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something_init>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
jmp    1030 <pr_alert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.do_something_init = [18 x i8] c"do_something_init\00"
define void @do_something_init() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_init, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@__func__.do_something_init = [18 x i8] c"do_something_init\00"
define void @do_something_init() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_init, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned long const *, int);
void oswp4(void *p, const unsigned long l) {
  const uint32_t tmp = l;
  memcpy(p, &tmp, 4);
}


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

x86 assembly (clang, -O2):
<oswp4>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @oswp4(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 %1, i64* %3
%5 = call i32 @memcpy(i8* %0, i64* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() {
  usleep(2000000);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @usleep(i32 2000000)
ret i32 0
}