xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("hello world!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ escape_inv(char *, char *);
int /*<<< orphan*/ getlinee(char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  char line[100];
  char line_vis[200];
  while (1) {
    printf("Enter line\n");
    getlinee(line, 100);
    escape(line_vis, line);
    escape_inv(line, line_vis);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getlinee@plt>
lea    -0x140(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <escape@plt>
lea    -0x70(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1040 <escape_inv@plt>
jmp    1152 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x140,%rsp
lea    0xead(%rip),%r14
mov    %rsp,%rbx
lea    0x70(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getlinee@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <escape@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <escape_inv@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"Enter line\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [200 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @getlinee(i8* %6, i32 100)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @escape(i8* %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%13 = call i32 @escape_inv(i8* %11, i8* %12)
br label %4
}

LLVM IR (-O2):
@str = [11 x i8] c"Enter line\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %5, %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%7 = call i32 @getlinee(i8* %3, i32 100)
%8 = call i32 @escape(i8* %4, i8* %3)
%9 = call i32 @escape_inv(i8* %3, i8* %4)
br label %5
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  fork();
  if (fork()) {
    printf(".");
  }
  printf(".");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     113e <main+0x1e>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = call i64 (...) @fork()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @putchar(i32 46)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @putchar(i32 46)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ iscntrl(int);
void uninitvar_iscntrl(void) {
  int i;
  (void)iscntrl(i);
}


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

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

LLVM IR (-O0):
define void @uninitvar_iscntrl() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iscntrl(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iscntrl() {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_emit_interfaces_removed_strv(void *bus, const char *path,
                                    char **interfaces) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_emit_interfaces_removed_strv(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int test_imm_0Auint8_mem(unsigned char *val) {
  return ((*val) & (0x0A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Auint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Auint8_mem>:
testb  $0xa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Auint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 10
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_0Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 10
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gll_weights_order2_square(double *out_1923134116974207604) {
  out_1923134116974207604[0] = 0.333333333333333;
  out_1923134116974207604[1] = 1.33333333333333;
  out_1923134116974207604[2] = 0.333333333333333;
}


x86 assembly (clang, -O0):
<gll_weights_order2_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_weights_order2_square>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movabs $0x3fd555555555554f,%rax
55 d5 3f
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @gll_weights_order2_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 0x3FD555555555554F, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0x3FF5555555555546, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 0x3FD555555555554F, double* %8
ret void
}

LLVM IR (-O2):
define void @gll_weights_order2_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0x3FD555555555554F, double 0x3FF5555555555546>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
store double 0x3FD555555555554F, double* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ chr8init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg4init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg4setBank7(scalar_t__);
int /*<<< orphan*/ printf(char *);
void m31init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
             uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  prg4init(prgROMin, prgROMsizeIn);
  prg4setBank7(prgROMsizeIn - 0x1000);
  (void)prgRAMin;
  (void)prgRAMsizeIn;
  chr8init(chrROMin, chrROMsizeIn);
  printf("Mapper 31 inited\n");
}


x86 assembly (clang, -O0):
<m31init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <prg4init@plt>
mov    -0x10(%rbp),%rdi
sub    $0x1000,%rdi
call   1060 <prg4setBank7@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <chr8init@plt>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m31init>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%rbx
call   1050 <prg4init@plt>
add    $0xfffffffffffff000,%rbx
mov    %rbx,%rdi
call   1060 <prg4setBank7@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <chr8init@plt>
lea    0xe8c(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Mapper 31 inited\0A\00"
define void @m31init(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i64
store i32* %0, i32** %7
store i64 %1, i64* %8
store i32* %2, i32** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i64 %5, i64* %12
%13 = load i32*, i32** %7
%14 = load i64, i64* %8
%15 = call i32 @prg4init(i32* %13, i64 %14)
%16 = load i64, i64* %8
%17 = sub nsw i64 %16, 4096
%18 = call i32 @prg4setBank7(i64 %17)
%19 = load i32*, i32** %9
%20 = load i64, i64* %10
%21 = load i32*, i32** %11
%22 = load i64, i64* %12
%23 = call i32 @chr8init(i32* %21, i64 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Mapper 31 inited\00"
define void @m31init(i32* %0, i64 %1, i32* nocapture readnone %2, i64 %3, i32* %4, i64 %5) {
%7 = tail call i32 @prg4init(i32* %0, i64 %1)
%8 = add nsw i64 %1, -4096
%9 = tail call i32 @prg4setBank7(i64 %8)
%10 = tail call i32 @chr8init(i32* %4, i64 %5)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void tcp_set_nonblocking(unsigned int *sockfd) {}


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

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

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

LLVM IR (-O2):
define void @tcp_set_nonblocking(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t EPIIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile unsigned long *)(ui32Base + 0x00000218))));
  } else {
    return ((*((volatile unsigned long *)(ui32Base + 0x00000214))));
  }
}


x86 assembly (clang, -O0):
<EPIIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1129 <EPIIntStatus+0x29>
mov    -0x10(%rbp),%rax
mov    0x218(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <EPIIntStatus+0x38>
mov    -0x10(%rbp),%rax
mov    0x214(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x214(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @EPIIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 532, i64 536
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_noarg(int /*<<< orphan*/, char *, int);
void print_invalid(uint16_t op, int index) {
  print_noarg(op, "INVALID", index);
}


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

x86 assembly (clang, -O2):
<print_invalid>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <print_noarg@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"INVALID\00"
define void @print_invalid(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 @print_noarg(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"INVALID\00"
define void @print_invalid(i32 %0, i32 %1) {
%3 = tail call i32 @print_noarg(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void g_queue_push_tail_link() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_push_tail_link() {
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_data_device_send_leave(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 2);
}


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

x86 assembly (clang, -O2):
<wl_data_device_send_leave>:
mov    $0x2,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_leave(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 2)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_leave(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void printGenes(char *search, int n) {
  int i = 0;
  while (i < n) {
    printf("i: %d - search: %c\n", i, search[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<printGenes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <printGenes+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebc(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printGenes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printGenes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <printGenes+0x38>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printGenes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"i: %d - search: %c\0A\00"
define void @printGenes(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
void BIO_method_type(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_method_type() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int vsnprintf_internal(char *, int /*<<< orphan*/, char const *,
                       int /*<<< orphan*/);
int vsnprintf(char *buffer, uint32_t size, const char *string, va_list argp) {
  int result;
  result = vsnprintf_internal(buffer, size, string, argp);
  return result;
}


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

x86 assembly (clang, -O2):
<vsnprintf>:
jmp    1030 <vsnprintf_internal@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vsnprintf_internal(i8* %10, i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @vsnprintf_internal(i8* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ listen(int, int);
void Listen(int fd, int backlog) {
  if (listen(fd, backlog) < 0)
    err_sys("listen error");
}


x86 assembly (clang, -O0):
<Listen>:
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   1040 <listen@plt>
cmp    $0x0,%rax
jge    114f <Listen+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
test   %rax,%rax
js     112d <Listen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"listen error\00"
define void @Listen(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 i64 @listen(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x18() {
  Assert_real((isprint(24) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              125, ("isprint should be 0 for 0x18"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x18>:
push   %rax
mov    $0x18,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x7d,%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 = [29 x i8] c"isprint should be 0 for 0x18\00"
define void @t_isprint_0x18() {
%1 = call i64 @isprint(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x18\00"
define void @t_isprint_0x18() {
%1 = tail call i64 @isprint(i32 24)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printIncorrect() {
  printf("    ERROR: Incorrect usage. Please see `help` for proper usage.\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c" ERROR: Incorrect usage. Please see `help` for proper usage.\0A\00"
define void @printIncorrect() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c" ERROR: Incorrect usage. Please see `help` for proper usage.\00"
define void @printIncorrect() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
int f91(int N) {
  if (N > 100)
    return N - 10;
  return f91(f91(N + 11));
}


x86 assembly (clang, -O0):
<f91>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    1133 <f91+0x23>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <f91+0x38>
mov    -0x8(%rbp),%edi
add    $0xb,%edi
call   1030 <f91@plt>
mov    %eax,%edi
call   1030 <f91@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f91>:
push   %rax
mov    %edi,%eax
cmp    $0x64,%edi
jg     112f <f91+0x1f>
nopl   0x0(%rax,%rax,1)
add    $0xb,%eax
mov    %eax,%edi
call   1030 <f91@plt>
cmp    $0x64,%eax
jbe    1120 <f91+0x10>
add    $0xfffffff6,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f91(i32 %0) {
%2 = icmp sgt i32 %0, 100
br i1 %2, label %3, label %6
3: ; preds = %6, %1
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = add nsw i32 %4, -10
ret i32 %5
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = add nsw i32 %7, 11
%9 = tail call i32 @f91(i32 %8)
%10 = icmp ugt i32 %9, 100
br i1 %10, label %3, label %6
}
/* Type definitions */
struct catmc_atomic_uint_least32_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_uint_least32_t *);
void catmc_atomic_uint_least32_t_destroy(
    struct catmc_atomic_uint_least32_t *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_uint_least32_t_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.catmc_atomic_uint_least32_t = type { i32 }
define void @catmc_atomic_uint_least32_t_destroy(%struct.catmc_atomic_uint_least32_t* %0) {
%2 = alloca %struct.catmc_atomic_uint_least32_t*
store %struct.catmc_atomic_uint_least32_t* %0, %struct.catmc_atomic_uint_least32_t** %2
%3 = load %struct.catmc_atomic_uint_least32_t*, %struct.catmc_atomic_uint_least32_t** %2
%4 = call i32 @free(%struct.catmc_atomic_uint_least32_t* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_uint_least32_t = type { i32 }
define void @catmc_atomic_uint_least32_t_destroy(%struct.catmc_atomic_uint_least32_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_uint_least32_t* %0)
ret void
}
/* Variables and functions */
char *Key_GetBinding(int);
int /*<<< orphan*/ Q_strncpyz(char *, char *, int);
void Key_GetBindingBuf(int keynum, char *buf, int buflen) {
  char *value;
  value = Key_GetBinding(keynum);
  if (value) {
    Q_strncpyz(buf, value, buflen);
  } else {
    *buf = 0;
  }
}


x86 assembly (clang, -O0):
<Key_GetBindingBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Key_GetBinding@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115e <Key_GetBindingBuf+0x3e>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <Q_strncpyz@plt>
jmp    1165 <Key_GetBindingBuf+0x45>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key_GetBindingBuf>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <Key_GetBinding@plt>
test   %rax,%rax
je     1145 <Key_GetBindingBuf+0x25>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Q_strncpyz@plt>
movb   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Key_GetBindingBuf(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = call i8* @Key_GetBinding(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8*, i8** %7
%15 = load i32, i32* %6
%16 = call i32 @Q_strncpyz(i8* %13, i8* %14, i32 %15)
br label %19
17: ; preds = %3
%18 = load i8*, i8** %5
store i8 0, i8* %18
br label %19
19: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
define void @Key_GetBindingBuf(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @Key_GetBinding(i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @Q_strncpyz(i8* %1, i8* %4, i32 %2)
br label %9
8: ; preds = %3
store i8 0, i8* %1
br label %9
9: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ warning(char *);
void Free(void *memory) {
  if (memory != NULL)
    free(memory);
  else
    warning("Can't free memory block <NULL>.");
}


x86 assembly (clang, -O0):
<Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <Free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1151 <Free+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <warning@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free>:
test   %rdi,%rdi
je     112a <Free+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <warning@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Can't free memory block <NULL>.\00"
define void @Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 @warning(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Can't free memory block <NULL>.\00"
define void @Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @warning(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void _printf_time() {
  time_t timer;
  char buffer[26];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info);
  printf("[%s] ", buffer);
}


x86 assembly (clang, -O0):
<_printf_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1a,%esi
lea    0xe8e(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x20(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printf_time>:
push   %rbx
sub    $0x30,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1a,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe95(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.1 = [6 x i8] c"[%s] \00"
define void @_printf_time() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %3
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @strftime(i8* %6, i32 26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.1 = [6 x i8] c"[%s] \00"
define void @_printf_time() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ info(char *);
void sig_term(int signo __attribute__((unused))) {
  info("Recieved SIGTERM, shutting down\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<sig_term>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Recieved SIGTERM, shutting down\0A\00"
define void @sig_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @info(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Recieved SIGTERM, shutting down\0A\00"
define void @sig_term(i32 %0) {
%2 = tail call i32 @info(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int default_min_level(struct battery *b) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.battery = type opaque
define i32 @default_min_level(%struct.battery* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerP__1__VectorTimerX0__fired();
void Msp430TimerCommonP__VectorTimerB0__fired(void) {
  Msp430TimerP__1__VectorTimerX0__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCommonP__VectorTimerB0__fired() {
%1 = tail call i32 (...) @Msp430TimerP__1__VectorTimerX0__fired()
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
void target_idle(void) {
  struct timespec req;
  req.tv_sec = 0;
  req.tv_nsec = 1000000;
  nanosleep(&req, 0);
}


x86 assembly (clang, -O0):
<target_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0xf4240,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_idle>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0xf4240,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @target_idle() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 1000000, i32* %3
%4 = call i32 @nanosleep(%struct.timespec* %1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @target_idle() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1000000, i32* %4
%5 = call i32 @nanosleep(%struct.timespec* %1, i32 0)
ret void
}
double frexp(x, pw2)
double x;
int *pw2;
{
  union {
    double y;
    unsigned short sh[4];
  } u;
  int i;
  short *q;
  u.y = x;
  q = (short *)&u.sh[3];
  i = (*q >> 4) & 0x7ff;
  if (i != 0)
    goto ieeedon;
ieeedon:
  i -= 0x3fe;
  *pw2 = i;
  *q &= 0x800f;
  *q |= 0x3fe0;
  return (u.y);
}


x86 assembly (clang, -O0):
<frexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movswl (%rax),%eax
sar    $0x4,%eax
and    $0x7ff,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1144 <frexp+0x44>
jmp    1149 <frexp+0x49>
jmp    1149 <frexp+0x49>
mov    -0x1c(%rbp),%eax
sub    $0x3fe,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movswl (%rax),%ecx
and    $0x800f,%ecx
mov    %cx,(%rax)
mov    -0x28(%rbp),%rax
movswl (%rax),%ecx
or     $0x3fe0,%ecx
mov    %cx,(%rax)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexp>:
movq   %xmm0,%rax
movabs $0x800fffffffffffff,%rcx
ff 0f 80
and    %rax,%rcx
shr    $0x34,%rax
and    $0x7ff,%eax
add    $0xfffffc02,%eax
mov    %eax,(%rdi)
movabs $0x3fe0000000000000,%rax
or     %rcx,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @frexp(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca %union.anon
%6 = alloca i32
%7 = alloca i16*
store double %0, double* %3
store i32* %1, i32** %4
%8 = load double, double* %3
%9 = bitcast %union.anon* %5 to double*
store double %8, double* %9
%10 = bitcast %union.anon* %5 to [4 x i16]*
%11 = getelementptr inbounds [4 x i16], [4 x i16]* %10, i64 0, i64 3
store i16* %11, i16** %7
%12 = load i16*, i16** %7
%13 = load i16, i16* %12
%14 = sext i16 %13 to i32
%15 = ashr i32 %14, 4
%16 = and i32 %15, 2047
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %6
%23 = sub nsw i32 %22, 1022
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = load i32*, i32** %4
store i32 %24, i32* %25
%26 = load i16*, i16** %7
%27 = load i16, i16* %26
%28 = sext i16 %27 to i32
%29 = and i32 %28, 32783
%30 = trunc i32 %29 to i16
store i16 %30, i16* %26
%31 = load i16*, i16** %7
%32 = load i16, i16* %31
%33 = sext i16 %32 to i32
%34 = or i32 %33, 16352
%35 = trunc i32 %34 to i16
store i16 %35, i16* %31
%36 = bitcast %union.anon* %5 to double*
%37 = load double, double* %36
ret double %37
}

LLVM IR (-O2):
define double @frexp(double %0, i32* nocapture writeonly %1) {
%3 = bitcast double %0 to i64
%4 = lshr i64 %3, 52
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 2047
%7 = add nsw i32 %6, -1022
store i32 %7, i32* %1
%8 = and i64 %3, -9218868437227405313
%9 = or i64 %8, 4602678819172646912
%10 = bitcast i64 %9 to double
ret double %10
}
/* Variables and functions */
int toupper(char volatile);
int t_toupper(char ch) {
  volatile char xc = ch;
  return toupper(xc);
}


x86 assembly (clang, -O0):
<t_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
movsbl %al,%edi
call   1030 <toupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_toupper>:
mov    %dil,-0x1(%rsp)
movsbl -0x1(%rsp),%edi
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @t_toupper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
store volatile i8 %4, i8* %3
%5 = load volatile i8, i8* %3
%6 = call i32 @toupper(i8 signext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @t_toupper(i8 signext %0) {
%2 = alloca i8
store volatile i8 %0, i8* %2
%3 = load volatile i8, i8* %2
%4 = tail call i32 @toupper(i8 signext %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ osrand(int);
scalar_t__ time(int /*<<< orphan*/ *);
void init_random(int seed) {
  if (!seed)
    osrand((int)time(NULL));
  else
    osrand(seed);
}


x86 assembly (clang, -O0):
<init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114a <init_random+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,%edi
call   1040 <osrand@plt>
jmp    1152 <init_random+0x32>
mov    -0x4(%rbp),%edi
call   1040 <osrand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random>:
test   %edi,%edi
je     1129 <init_random+0x9>
jmp    1040 <osrand@plt>
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,%rdi
add    $0x8,%rsp
jmp    1040 <osrand@plt>

LLVM IR (-O0):
define void @init_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @osrand(i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @osrand(i32 %10)
br label %12
12: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @init_random(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @osrand(i32 %7)
ret void
}
/* Variables and functions */
double average(double, double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("average = %f\n\n", average(1.0, -1.6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1040 <average@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <average@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"average = %f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @average(double 1.000000e+00, double -1.600000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"average = %f\0A\0A\00"
define i32 @main() {
%1 = tail call double @average(double 1.000000e+00, double -1.600000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
__typeof__(calloc(1, (void *)1)) test_calloc_102(void) {
  return calloc(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_calloc_102>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_calloc_102>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @test_calloc_102() {
%1 = call i8* @calloc(i64 1, i64 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_calloc_102() {
%1 = tail call dereferenceable_or_null(1) i8* @calloc(i64 1, i64 1)
ret i8* %1
}
/* Variables and functions */
bool _is_digit(char ch) { return (ch >= '0') && (ch <= '9'); }


x86 assembly (clang, -O0):
<_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @_is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int test3(int x) { return x / 10 == -2; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
add    $0x1d,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp eq i32 %4, -2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = add i32 %0, 29
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}