xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int main(void) {
  ((void)0);
  ((void)0);
  {
    uint32_t i, q;
    for (i = 0; i < 32; i++) {
      ((void)0);
      if (i & 0x1)
        ((void)0);
      q = 0;
      ((void)0);
      q = 1;
      ((void)0);
      ((void)0);
    }
  }
  ((void)0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    114c <main+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <main+0x30>
jmp    1130 <main+0x30>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct pt_time_cal {
  int dummy;
};
struct pt_packet_cbr {
  int dummy;
};
struct pt_config {
  int dummy;
};

/* Variables and functions */
int pt_tcal_header_cbr(struct pt_time_cal *, struct pt_packet_cbr const *,
                       struct pt_config const *);
int /*<<< orphan*/ pt_tcal_init(struct pt_time_cal *);
int pt_tcal_update_cbr(struct pt_time_cal *tcal,
                       const struct pt_packet_cbr *packet,
                       const struct pt_config *config) {
  pt_tcal_init(tcal);
  return pt_tcal_header_cbr(tcal, packet, config);
}


x86 assembly (clang, -O0):
<pt_tcal_update_cbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pt_tcal_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pt_tcal_header_cbr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_tcal_update_cbr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <pt_tcal_init@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pt_tcal_header_cbr@plt>

LLVM IR (-O0):
%struct.pt_time_cal = type { i32 }
%struct.pt_packet_cbr = type { i32 }
%struct.pt_config = type { i32 }
define i32 @pt_tcal_update_cbr(%struct.pt_time_cal* %0, %struct.pt_packet_cbr* %1, %struct.pt_config* %2) {
%4 = alloca %struct.pt_time_cal*
%5 = alloca %struct.pt_packet_cbr*
%6 = alloca %struct.pt_config*
store %struct.pt_time_cal* %0, %struct.pt_time_cal** %4
store %struct.pt_packet_cbr* %1, %struct.pt_packet_cbr** %5
store %struct.pt_config* %2, %struct.pt_config** %6
%7 = load %struct.pt_time_cal*, %struct.pt_time_cal** %4
%8 = call i32 @pt_tcal_init(%struct.pt_time_cal* %7)
%9 = load %struct.pt_time_cal*, %struct.pt_time_cal** %4
%10 = load %struct.pt_packet_cbr*, %struct.pt_packet_cbr** %5
%11 = load %struct.pt_config*, %struct.pt_config** %6
%12 = call i32 @pt_tcal_header_cbr(%struct.pt_time_cal* %9, %struct.pt_packet_cbr* %10, %struct.pt_config* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.pt_time_cal = type { i32 }
%struct.pt_packet_cbr = type { i32 }
%struct.pt_config = type { i32 }
define i32 @pt_tcal_update_cbr(%struct.pt_time_cal* %0, %struct.pt_packet_cbr* %1, %struct.pt_config* %2) {
%4 = tail call i32 @pt_tcal_init(%struct.pt_time_cal* %0)
%5 = tail call i32 @pt_tcal_header_cbr(%struct.pt_time_cal* %0, %struct.pt_packet_cbr* %1, %struct.pt_config* %2)
ret i32 %5
}
int uart_close(int file __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uart_close(i32 %0) {
ret i32 0
}
void gentrunc_l_d() {}


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

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

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

LLVM IR (-O2):
define void @gentrunc_l_d() {
ret void
}
void pcp_print_net_edev_stats(struct activity *a, int curr) {}


x86 assembly (clang, -O0):
<pcp_print_net_edev_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_net_edev_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_edev_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cli_puts(char *);
void cli_putln(void) { cli_puts("\n"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @cli_putln() {
%1 = tail call i32 @cli_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int plus_42(int x) { return x + 42; }


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

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

LLVM IR (-O0):
define i32 @plus_42(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 42
ret i32 %4
}

LLVM IR (-O2):
define i32 @plus_42(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
void collect_supportsave_data() {
  printf("%s() is called ...\n", __FUNCTION__);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s() is called ...\0A\00"
@__FUNCTION__.collect_supportsave_data = [25 x i8] c"collect_supportsave_data\00"
define void @collect_supportsave_data() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.collect_supportsave_data, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s() is called ...\0A\00"
@__FUNCTION__.collect_supportsave_data = [25 x i8] c"collect_supportsave_data\00"
define void @collect_supportsave_data() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.collect_supportsave_data, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int err_out(const char *msg) {
  perror(msg);
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @err_out(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void md_exit(int status) { exit(status); }


x86 assembly (clang, -O0):
<md_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<md_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @md_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int READ_SHORT();
int READ_WORD(void) { return READ_SHORT(); }


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

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

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

LLVM IR (-O2):
define i32 @READ_WORD() {
%1 = tail call i32 (...) @READ_SHORT()
ret i32 %1
}
void pnx833x_gpio_select_function_alt(unsigned int pin) {
  if (pin < 32)
    do {
      ((*((volatile unsigned long *)((0xa0000000ul + 0x17E00000ul) +
                                     0xF014))) |= (1 << (pin)));
    } while (0);
  else
    do {
      ((*((volatile unsigned long *)((0xa0000000ul + 0x17E00000ul) +
                                     0xF068))) |= (1 << (pin & 31)));
    } while (0);
}


x86 assembly (clang, -O0):
<pnx833x_gpio_select_function_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jae    113a <pnx833x_gpio_select_function_alt+0x3a>
jmp    1116 <pnx833x_gpio_select_function_alt+0x16>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    $0xb7e0f014,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xb7e0f014,%eax
mov    %rcx,(%rax)
jmp    1166 <pnx833x_gpio_select_function_alt+0x66>
jmp    113f <pnx833x_gpio_select_function_alt+0x3f>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    $0xb7e0f068,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xb7e0f068,%eax
mov    %rcx,(%rax)
jmp    1166 <pnx833x_gpio_select_function_alt+0x66>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnx833x_gpio_select_function_alt>:
mov    %edi,%ecx
mov    $0xb7e0f014,%eax
lea    0x54(%rax),%rdx
cmp    $0x20,%edi
cmovb  %rax,%rdx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,(%rdx)
ret

LLVM IR (-O0):
define void @pnx833x_gpio_select_function_alt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %5, label %13
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
%10 = load volatile i64, i64* inttoptr (i64 3084972052 to i64*)
%11 = or i64 %10, %9
store volatile i64 %11, i64* inttoptr (i64 3084972052 to i64*)
br label %12
12: ; preds = %6
br label %22
13: ; preds = %1
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = and i32 %15, 31
%17 = shl i32 1, %16
%18 = sext i32 %17 to i64
%19 = load volatile i64, i64* inttoptr (i64 3084972136 to i64*)
%20 = or i64 %19, %18
store volatile i64 %20, i64* inttoptr (i64 3084972136 to i64*)
br label %21
21: ; preds = %14
br label %22
22: ; preds = %21, %12
ret void
}

LLVM IR (-O2):
define void @pnx833x_gpio_select_function_alt(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = and i32 %0, 31
%4 = select i1 %2, i64* inttoptr (i64 3084972052 to i64*), i64* inttoptr (i64 3084972136 to i64*)
%5 = shl nuw i32 1, %3
%6 = sext i32 %5 to i64
%7 = load volatile i64, i64* %4
%8 = or i64 %7, %6
store volatile i64 %8, i64* %4
ret void
}
int INHERENT_link() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_link() {
ret i32 0
}
int Fibonacci_rec(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return (Fibonacci_rec(n - 1) + Fibonacci_rec(n - 2));
}


x86 assembly (clang, -O0):
<Fibonacci_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <Fibonacci_rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <Fibonacci_rec+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <Fibonacci_rec+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <Fibonacci_rec+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Fibonacci_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <Fibonacci_rec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonacci_rec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <Fibonacci_rec+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <Fibonacci_rec@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <Fibonacci_rec+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Fibonacci_rec(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @Fibonacci_rec(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void zone_span_writeunlock(struct zone *zone) {}


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define void @zone_span_writeunlock(%struct.zone* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *buf, const char *fmt, va_list args) {
  return vsnprintf(buf, ((int)(~0U >> 1)), fmt, args);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7fffffff,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x7fffffff,%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsnprintf(i8* %7, i32 2147483647, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 2147483647, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct sysinfo {
  size_t totalram;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
size_t totalRAM() {
  struct sysinfo info;
  sysinfo(&info);
  return info.totalram;
}


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

x86 assembly (clang, -O2):
<totalRAM>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64 }
define i64 @totalRAM() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
%struct.sysinfo = type { i64 }
define i64 @totalRAM() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int shmget(int /*<<< orphan*/, unsigned int, int);
int ipc_shm_init(unsigned int u32key, unsigned int size) {
  int shmid = 0;
  key_t key = (key_t)u32key;
  shmid = shmget(key, size, IPC_CREAT | 0666);
  return shmid;
}


x86 assembly (clang, -O0):
<ipc_shm_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
call   1030 <shmget@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_shm_init>:
mov    0x2ec9(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
jmp    1030 <shmget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @ipc_shm_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %3
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* @IPC_CREAT
%11 = or i32 %10, 438
%12 = call i32 @shmget(i32 %8, i32 %9, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @ipc_shm_init(i32 %0, i32 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 438
%5 = tail call i32 @shmget(i32 %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *sp = s;
  while (n--) {
    if (*sp == (unsigned char)c)
      return (void *)sp;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1157 <memchr+0x57>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1152 <memchr+0x52>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <memchr+0x5f>
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
mov    %rdi,%rax
add    $0x1,%rdx
nopw   0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%rdx
je     111c <memchr+0x1c>
cmp    %sil,(%rax)
jne    1110 <memchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %8, %3
%6 = phi i64 [ %2, %3 ], [ %9, %8 ]
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = add i64 %6, -1
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, %4
br i1 %11, label %12, label %5
12: ; preds = %5, %8
%13 = phi i8* [ %0, %8 ], [ null, %5 ]
ret i8* %13
}
/* Variables and functions */
int EINVAL;
int crypt_backend_rng(char *buffer, size_t length, int quality, int fips) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<crypt_backend_rng>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec5(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_backend_rng>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @crypt_backend_rng(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @crypt_backend_rng(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main() {
  PASS("dlopen-init-up");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"dlopen-init-up\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PASS(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"dlopen-init-up\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @PASS(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void put_str(int32_t *n) { printf("%s", (char *)n); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @put_str(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void FreeFont(struct TextFont *f) {}


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

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

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

LLVM IR (-O2):
%struct.TextFont = type opaque
define void @FreeFont(%struct.TextFont* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getMedian(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int a[] = {1, 3, 5, 7, 9};
  int b[] = {2, 4, 6, 8, 10};
  printf("%lf\n", getMedian(a, 5, b, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rdx
mov    $0x5,%ecx
mov    %ecx,%esi
call   1040 <getMedian@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef0(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rdx
mov    $0x5,%esi
mov    $0x5,%ecx
call   1040 <getMedian@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
@__const.main.b = [5 x i32] [i32 2, i32 4, i32 6, i32 8, i32 10]
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i32]* %6 to i8*
%9 = bitcast [5 x i32]* %7 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%12 = call i32 @getMedian(i32* %10, i32 5, i32* %11, i32 5)
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
@__const.main.b = [5 x i32] [i32 2, i32 4, i32 6, i32 8, i32 10]
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = bitcast [5 x i32]* %3 to i8*
%6 = bitcast [5 x i32]* %4 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%9 = call i32 @getMedian(i32* %7, i32 5, i32* %8, i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void put_u32(uint8_t *ptr, uint32_t val) { memcpy(ptr, &val, sizeof(val)); }


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

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

LLVM IR (-O0):
define void @put_u32(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @put_u32(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_session(void *c, const char **ret) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_creds_get_session>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_session(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_session(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ XBEE_UART_UartStop();
void XBEE_UART_ScbModeStop(void) { XBEE_UART_UartStop(); }


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

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

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

LLVM IR (-O2):
define void @XBEE_UART_ScbModeStop() {
%1 = tail call i32 (...) @XBEE_UART_UartStop()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_crude_tracker(int verbose) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(624, &verbose, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_crude_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x270,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_crude_tracker>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x270,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @quaddobl_crude_tracker(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 624, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xunmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xunmap_type(void *_p, int _v) {
  ((XEvent *)_p)->xunmap.type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xunmap_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xunmap_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xunmap_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xunmap_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ printf(char *, char *);
char *showdate();
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
void quit_handler() {
  printf("Interrupted %s\n", showdate());
  signal(SIGQUIT, quit_handler);
}


x86 assembly (clang, -O0):
<quit_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <showdate@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rsi
call   1050 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit_handler>:
push   %rax
xor    %eax,%eax
call   1040 <showdate@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rsi
pop    %rax
jmp    1050 <signal@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Interrupted %s\0A\00"
@SIGQUIT = global i32 0
define void @quit_handler() {
%1 = call i8* (...) @showdate()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i32, i32* @SIGQUIT
%4 = call i32 @signal(i32 %3, void (...)* bitcast (void ()* @quit_handler to void (...)*))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Interrupted %s\0A\00"
@SIGQUIT = global i32 0
define void @quit_handler() {
%1 = tail call i8* (...) @showdate()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i32, i32* @SIGQUIT
%4 = tail call i32 @signal(i32 %3, void (...)* bitcast (void ()* @quit_handler to void (...)*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ valid_bo(long, int, int /*<<< orphan*/);
unsigned long insert_bo(unsigned long insn, long value, int dialect,
                        const char **errmsg) {
  if (!valid_bo(value, dialect, 0))
    *errmsg = ("invalid conditional option");
  return insn | ((value & 0x1f) << 21);
}


x86 assembly (clang, -O0):
<insert_bo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <valid_bo@plt>
cmp    $0x0,%eax
jne    114c <insert_bo+0x3c>
mov    -0x20(%rbp),%rax
lea    0xeb7(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x15,%rcx
or     %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bo>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
xor    %edx,%edx
call   1030 <valid_bo@plt>
test   %eax,%eax
jne    1138 <insert_bo+0x28>
lea    0xecb(%rip),%rax
mov    %rax,(%r15)
and    $0x1f,%ebx
shl    $0x15,%rbx
or     %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"invalid conditional option\00"
define i64 @insert_bo(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %6
%10 = load i32, i32* %7
%11 = call i32 @valid_bo(i64 %9, i32 %10, i32 0)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = load i8**, i8*** %8
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %14
br label %15
15: ; preds = %13, %4
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = and i64 %17, 31
%19 = shl i64 %18, 21
%20 = or i64 %16, %19
ret i64 %20
}

LLVM IR (-O2):
@.str = [27 x i8] c"invalid conditional option\00"
define i64 @insert_bo(i64 %0, i64 %1, i32 %2, i8** nocapture writeonly %3) {
%5 = tail call i32 @valid_bo(i64 %1, i32 %2, i32 0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %3
br label %8
8: ; preds = %7, %4
%9 = shl i64 %1, 21
%10 = and i64 %9, 65011712
%11 = or i64 %10, %0
ret i64 %11
}
double average(double input[100]) {
  int i;
  double sum;
  sum = 0;
  for (i = 0; i < 100; i++) {
    sum += input[i];
  }
  return sum / (double)100;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1146 <average+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <average+0x17>
movsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
xorpd  %xmm0,%xmm0
mov    $0x4,%eax
nopl   0x0(%rax)
addsd  -0x20(%rdi,%rax,8),%xmm0
addsd  -0x18(%rdi,%rax,8),%xmm0
addsd  -0x10(%rdi,%rax,8),%xmm0
addsd  -0x8(%rdi,%rax,8),%xmm0
addsd  (%rdi,%rax,8),%xmm0
add    $0x5,%rax
cmp    $0x68,%rax
jne    1110 <average+0x10>
divsd  0xec1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @average(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load double*, double** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fadd double %14, %13
store double %15, double* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load double, double* %4
%21 = fdiv double %20, 1.000000e+02
ret double %21
}

LLVM IR (-O2):
define double @average(double* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %24, %2 ]
%4 = phi double [ 0.000000e+00, %1 ], [ %23, %2 ]
%5 = getelementptr inbounds double, double* %0, i64 %3
%6 = load double, double* %5
%7 = fadd double %4, %6
%8 = add nuw nsw i64 %3, 1
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = fadd double %7, %10
%12 = add nuw nsw i64 %3, 2
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = fadd double %11, %14
%16 = add nuw nsw i64 %3, 3
%17 = getelementptr inbounds double, double* %0, i64 %16
%18 = load double, double* %17
%19 = fadd double %15, %18
%20 = add nuw nsw i64 %3, 4
%21 = getelementptr inbounds double, double* %0, i64 %20
%22 = load double, double* %21
%23 = fadd double %19, %22
%24 = add nuw nsw i64 %3, 5
%25 = icmp eq i64 %24, 100
br i1 %25, label %26, label %2
26: ; preds = %2
%27 = fdiv double %23, 1.000000e+02
ret double %27
}
void init_little_field_exchange(_Complex double *w) { return; }


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

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

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

LLVM IR (-O2):
define void @init_little_field_exchange({ double, double }* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void __attribute__((noreturn)) alarm_handler(int sig) {
  (void)sig;
  printf("Bye!\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [5 x i8] c"Bye!\00"
define void @alarm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
void *query_sym_concat(char const *, char *);
void *rtti_func_ptr(const char *func_name) {
  return query_sym_concat(func_name, "");
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @rtti_func_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @query_sym_concat(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @rtti_func_ptr(i8* %0) {
%2 = tail call i8* @query_sym_concat(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int getegid() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @getegid() {
ret i32 0
}
int test(void) {
  char c[(5 < sizeof(int) ? sizeof(int) : 5)]
      __attribute__((aligned)) = {1, 2, 3, 4};
  return *(int *)c;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xef1(%rip),%al
mov    %al,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test.c = [5 x i8] c"\01\02\03\04\00"
define i32 @test() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
ret i32 67305985
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_47() {
  Assert_real((isqrt(47) == 6),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              240, ("Integer square root of 47 should be 6"));
}


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

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

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

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 47 should be 6\00"
define void @t_sqrt_47() {
%1 = tail call i32 @isqrt(i32 47)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  int /*<<< orphan*/ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void p_operate(int semid, ushort semnum) {
  struct sembuf thesops;
  thesops.sem_num = semnum;
  thesops.sem_op = -1;
  thesops.sem_flg = SEM_UNDO;
  semop(semid, &thesops, 1);
}


x86 assembly (clang, -O0):
<p_operate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_operate>:
sub    $0x18,%rsp
mov    %esi,0x10(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @p_operate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 -1, i32* %8
%9 = load i32, i32* @SEM_UNDO
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = call i32 @semop(i32 %11, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @p_operate(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 -1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}