xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ hubo_rt_remove_lockfile(char const *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void hubo_rt_daemon_close(const char *daemon_name, const char *lock_directory) {
  hubo_rt_remove_lockfile(daemon_name, lock_directory);
  fclose(stdout);
  fclose(stderr);
  syslog(LOG_NOTICE, "Terminated daemon %s gracefully", daemon_name);
}


x86 assembly (clang, -O0):
<hubo_rt_daemon_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <hubo_rt_remove_lockfile@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe83(%rip),%rsi
call   1050 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubo_rt_daemon_close>:
push   %rbx
mov    %rdi,%rbx
call   1040 <hubo_rt_remove_lockfile@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1050 <syslog@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@LOG_NOTICE = global i32 0
@.str = [32 x i8] c"Terminated daemon %s gracefully\00"
define void @hubo_rt_daemon_close(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @hubo_rt_remove_lockfile(i8* %5, i8* %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fclose(i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fclose(i32 %10)
%12 = load i32, i32* @LOG_NOTICE
%13 = load i8*, i8** %3
%14 = call i32 @syslog(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@LOG_NOTICE = global i32 0
@.str = [32 x i8] c"Terminated daemon %s gracefully\00"
define void @hubo_rt_daemon_close(i8* %0, i8* %1) {
%3 = tail call i32 @hubo_rt_remove_lockfile(i8* %0, i8* %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fclose(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fclose(i32 %6)
%8 = load i32, i32* @LOG_NOTICE
%9 = tail call i32 @syslog(i32 %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_3__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int _flags;
};
typedef TYPE_1__ ns_msg;
struct TYPE_5__ {
  int mask;
  int shift;
};

/* Variables and functions */
TYPE_3__ *_ns_flagdata;
int ns_msg_getflag(ns_msg handle, int flag) {
  return (((handle)._flags & _ns_flagdata[flag].mask) >>
          _ns_flagdata[flag].shift);
}


x86 assembly (clang, -O0):
<ns_msg_getflag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ecc(%rip),%rcx
mov    (%rcx),%rcx
movslq -0xc(%rbp),%rdx
and    (%rcx,%rdx,8),%eax
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%rcx
movslq -0xc(%rbp),%rdx
mov    0x4(%rcx,%rdx,8),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_msg_getflag>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
movslq %esi,%rdx
and    (%rcx,%rdx,8),%eax
mov    0x4(%rcx,%rdx,8),%cl
sar    %cl,%eax
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32 }
%struct.TYPE_4__ = type { i32 }
@_ns_flagdata = global %struct.TYPE_5__* null
define i32 @ns_msg_getflag(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_4__
%4 = alloca i32
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
store i32 %0, i32* %5
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.TYPE_5__*, %struct.TYPE_5__** @_ns_flagdata
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i64 %10
%12 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = and i32 %7, %13
%15 = load %struct.TYPE_5__*, %struct.TYPE_5__** @_ns_flagdata
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i64 %17
%19 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %18, i32 0, i32 1
%20 = load i32, i32* %19
%21 = ashr i32 %14, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32 }
@_ns_flagdata = global %struct.TYPE_5__* null
define i32 @ns_msg_getflag(i32 %0, i32 %1) {
%3 = load %struct.TYPE_5__*, %struct.TYPE_5__** @_ns_flagdata
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 %4, i32 0
%6 = load i32, i32* %5
%7 = and i32 %6, %0
%8 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 %4, i32 1
%9 = load i32, i32* %8
%10 = ashr i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ remove_comment(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  if (remove_comment(stdin, stdout) != 0) {
    printf("error: error when removing comments\n");
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
call   1030 <remove_comment@plt>
cmp    $0x0,%rax
je     116f <main+0x4f>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
call   1030 <remove_comment@plt>
test   %rax,%rax
je     1149 <main+0x29>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@.str = [37 x i8] c"error: error when removing comments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdin
%7 = load i32, i32* @stdout
%8 = call i64 @remove_comment(i32 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@str = [36 x i8] c"error: error when removing comments\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = load i32, i32* @stdout
%5 = tail call i64 @remove_comment(i32 %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %2, %7
ret i32 0
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
int /*<<< orphan*/ show(double);
double opr_show(struct lifo *stack) {
  double op = pop(stack);
  show(op);
  return op;
}


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

x86 assembly (clang, -O2):
<opr_show>:
push   %rax
call   1030 <pop@plt>
movsd  %xmm0,(%rsp)
call   1040 <show@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_show(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @show(double %6)
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_show(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call i32 @show(double %2)
ret double %2
}
void test_trap() { __asm__ __volatile__("int3\n\t"); }


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

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

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

LLVM IR (-O2):
define void @test_trap() {
tail call void asm sideeffect "int3\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *softwareVersion(void) { return "0.0.3"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.0.3\00"
define i8* @softwareVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.0.3\00"
define i8* @softwareVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void pcp_def_net_sock_metrics(void) {}


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

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

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

LLVM IR (-O2):
define void @pcp_def_net_sock_metrics() {
ret void
}
int is_kexec_file_load_implemented(void) {
  if (320 != 0xffffffff)
    return 1;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @is_kexec_file_load_implemented() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_kexec_file_load_implemented() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("Not supported on this platform\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Not supported on this platform\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Not supported on this platform\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct clientinfo {
  int dummy;
};

/* Variables and functions */
int child_setup(int, struct clientinfo *);
scalar_t__ stage_action(char *);
int inetd_connected(int sock, struct clientinfo *clntinfo) {
  if (stage_action("startsetup") < 0) {
    return -1;
  }
  return child_setup(sock, clntinfo);
}


x86 assembly (clang, -O0):
<inetd_connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <stage_action@plt>
cmp    $0x0,%rax
jge    1151 <inetd_connected+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <inetd_connected+0x40>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <child_setup@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inetd_connected>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <stage_action@plt>
test   %rax,%rax
js     1149 <inetd_connected+0x29>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <child_setup@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.clientinfo = type { i32 }
@.str = [11 x i8] c"startsetup\00"
define i32 @inetd_connected(i32 %0, %struct.clientinfo* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.clientinfo*
store i32 %0, i32* %4
store %struct.clientinfo* %1, %struct.clientinfo** %5
%6 = call i64 @stage_action(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load %struct.clientinfo*, %struct.clientinfo** %5
%12 = call i32 @child_setup(i32 %10, %struct.clientinfo* %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.clientinfo = type { i32 }
@.str = [11 x i8] c"startsetup\00"
define i32 @inetd_connected(i32 %0, %struct.clientinfo* %1) {
%3 = tail call i64 @stage_action(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @child_setup(i32 %0, %struct.clientinfo* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
void broker_adaptive_program_data(int type, int flags, int attr,
                                  int command_type, unsigned long modhattr,
                                  unsigned long modhattrs,
                                  unsigned long modsattr,
                                  unsigned long modsattrs,
                                  struct timeval *timestamp) {}


x86 assembly (clang, -O0):
<broker_adaptive_program_data>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define void @broker_adaptive_program_data(i32 %0, i32 %1, i32 %2, i32 %3, i64 %4, i64 %5, i64 %6, i64 %7, %struct.timeval* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca %struct.timeval*
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i64 %4, i64* %14
store i64 %5, i64* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
store %struct.timeval* %8, %struct.timeval** %18
ret void
}

LLVM IR (-O2):
%struct.timeval = type opaque
define void @broker_adaptive_program_data(i32 %0, i32 %1, i32 %2, i32 %3, i64 %4, i64 %5, i64 %6, i64 %7, %struct.timeval* nocapture %8) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
void CTRL_REGSB_BITSET_KXSD9_standby(unsigned char *data) {
  switch_off_bits(data, (0x40));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSB_BITSET_KXSD9_standby>:
mov    $0x40,%esi
jmp    1030 <switch_off_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSB_BITSET_KXSD9_standby(i8* %0) {
%2 = tail call i32 @switch_off_bits(i8* %0, i32 64)
ret void
}
OP(dd, c7) { op_c7(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c7()
ret i32 undef
}
void f17(a19_2, a19_3) const struct file *a19_2;
int a19_3;
{}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @f17(%struct.file* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, int /*<<< orphan*/ *, int);
int read_uint32(int fd, uint32_t *retval) {
  uint32_t val;
  int rc = 0;
  rc = read(fd, &val, 4);
  if (rc < 4) {
    perror("Error: read_uint32: ");
    return -1;
  }
  (*retval) = be32toh(val);
  return 0;
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    117c <read_uint32+0x4c>
lea    0xe95(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <read_uint32+0x63>
mov    -0x14(%rbp),%edi
call   1040 <be32toh@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmp    $0x3,%eax
jle    115f <read_uint32+0x2f>
mov    0xc(%rsp),%edi
call   1040 <be32toh@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
jmp    1159 <read_uint32+0x29>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Error: read_uint32: \00"
define i32 @read_uint32(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @read(i32 %0, i32* %3, i32 4)
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = tail call i32 @be32toh(i32 %10)
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ -1, %7 ], [ 0, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void _timeout(int val) {
  _exit(-1);
  if (val)
    return;
}


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

x86 assembly (clang, -O2):
<_timeout>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @_timeout(i32 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
int variable_test_bit(int nr, const volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit)
                       : "m"((*(volatile long *)addr)), "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<variable_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bt     %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variable_test_bit>:
bt     %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @variable_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @variable_test_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
void foo_1_2_2_2_1_2_2_2_1() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XQueryBestCursor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wr_cmd(char const *);
void wr_cmdl(const char *cmd) {
  wr_cmd(cmd);
  wr_cmd("\x0D\x0A");
}


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

x86 assembly (clang, -O2):
<wr_cmdl>:
push   %rax
call   1030 <wr_cmd@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <wr_cmd@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @wr_cmdl(i8* %0) {
%2 = tail call i32 @wr_cmd(i8* %0)
%3 = tail call i32 @wr_cmd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int write(int, char *, size_t);
int abfab(int fd, char *p, size_t i) {
  if ((fd < 0) || (p == NULL)) {
    return -1;
  }
  return (write(fd, p, i));
}


x86 assembly (clang, -O0):
<abfab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1138 <abfab+0x28>
cmpq   $0x0,-0x10(%rbp)
jne    1144 <abfab+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <abfab+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abfab>:
test   %edi,%edi
js     111e <abfab+0xe>
test   %rsi,%rsi
je     111e <abfab+0xe>
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @abfab(i32 %0, i8* %1, i64 %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
unsigned long long duration_to_loop_count(unsigned long long frequency,
                                          double duration) {
  return (unsigned long long)(frequency * duration);
}


x86 assembly (clang, -O0):
<duration_to_loop_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movaps 0xeec(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeeb(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<duration_to_loop_count>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xee7(%rip),%xmm2
cvttsd2si %xmm2,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @duration_to_loop_count(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%5 = load i64, i64* %3
%6 = uitofp i64 %5 to double
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = fptoui double %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @duration_to_loop_count(i64 %0, double %1) {
%3 = uitofp i64 %0 to double
%4 = fmul double %3, %1
%5 = fptoui double %4 to i64
ret i64 %5
}
const char *null_PCAP_LIB_VERSION(void) { return "stub/0.0"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"stub/0.0\00"
define i8* @null_PCAP_LIB_VERSION() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"stub/0.0\00"
define i8* @null_PCAP_LIB_VERSION() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void g_object_set_data_full() {}


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

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

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

LLVM IR (-O2):
define void @g_object_set_data_full() {
ret void
}
void complete(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<complete>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<complete>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.complete = [9 x i8] c"complete\00"
define void @complete() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.complete, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.complete = [9 x i8] c"complete\00"
define void @complete() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.complete, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ entab(char *, char *);
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  char entabbed_line[1000];
  while ((len = get_line(line, 1000)) > 0) {
    entab(entabbed_line, line);
    printf("%s", entabbed_line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x7e0(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1050 <entab@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1187 <main+0x57>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
lea    0xea1(%rip),%r15
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <entab@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_line(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @entab(i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_line(i8* %3, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @entab(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @get_line(i8* %3, i32 1000)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
unsigned int GrOffScreen24BPPColorTranslate(void *pvDisplayData,
                                            unsigned int ulValue) {
  return ulValue;
}


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

x86 assembly (clang, -O2):
<GrOffScreen24BPPColorTranslate>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @GrOffScreen24BPPColorTranslate(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_softstop(void) {
  l6480_send_cmd(0xB0, 1, 0, 0);
  return;
}


x86 assembly (clang, -O0):
<l6480_cmd_softstop>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_softstop>:
mov    $0xb0,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_softstop() {
%1 = call i32 @l6480_send_cmd(i32 176, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_softstop() {
%1 = tail call i32 @l6480_send_cmd(i32 176, i32 1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/"
               "include/h2o/memory.h"
               ":"
               "358"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/include/h2o/memory.h:358:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/include/h2o/memory.h:358:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  int i;
  unsigned long rgmiistatus;
  unsigned long rgmiibuf[256];
  unsigned long *rgmiistatusp = (unsigned long *)0x80001000;
  unsigned long *rgmiiop = (unsigned long *)0x80001400;
  unsigned long *rgmiiip = (unsigned long *)0x80001800;
  report_start();
  base_test();
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    $0x80001000,%eax
mov    %rax,-0x818(%rbp)
mov    $0x80001400,%eax
mov    %rax,-0x820(%rbp)
mov    $0x80001800,%eax
mov    %rax,-0x828(%rbp)
mov    $0x0,%al
call   1050 <report_start@plt>
mov    $0x0,%al
call   1040 <base_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <report_start@plt>
xor    %eax,%eax
call   1040 <base_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [256 x i64]
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* inttoptr (i64 2147487744 to i64*), i64** %4
store i64* inttoptr (i64 2147488768 to i64*), i64** %5
store i64* inttoptr (i64 2147489792 to i64*), i64** %6
%7 = call i32 (...) @report_start()
%8 = call i32 (...) @base_test()
%9 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 (...) @report_end()
ret i32 0
}
int add_one(const int *a) {
  int result;
  result = *a + 1;
  return (result);
}


x86 assembly (clang, -O0):
<add_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @add_one(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
ret i32 %3
}
int compare(const void *a, const void *b) {
  short int x = *(short int *)a;
  short int y = *(short int *)b;
  return x - y;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x14(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movswl (%rdi),%eax
movswl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i16*
%9 = load i16, i16* %8
store i16 %9, i16* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i16*
%12 = load i16, i16* %11
store i16 %12, i16* %6
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = sub nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = sext i16 %4 to i32
%8 = sext i16 %6 to i32
%9 = sub nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putstr_info(char const *s) {
  ft_putstr("\x1B[36m");
  ft_putstr(s);
  ft_putstr("\x1B[0m");
}


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

x86 assembly (clang, -O2):
<ft_putstr_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    %rbx,%rdi
call   1030 <ft_putstr@plt>
lea    0xed7(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putstr_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putstr_info(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void bytestream_put_byte(uint8_t **b, const unsigned int value) {
  do {
    ((uint8_t *)(*b))[0] = (value);
  } while (0);
  (*b) += 1;
}


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

x86 assembly (clang, -O2):
<bytestream_put_byte>:
mov    (%rdi),%rax
mov    %esi,(%rax)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bytestream_put_byte(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %6, i32* %9
br label %10
10: ; preds = %5
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32* %13, i32** %11
ret void
}

LLVM IR (-O2):
define void @bytestream_put_byte(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
store i32 %1, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32* %4, i32** %0
ret void
}
/* Variables and functions */
float get(char *);
int /*<<< orphan*/ printf(char *, float);
void multiply() {
  float firstNum = get("Enter your first number");
  float secondNum = get("Enter your second number");
  float result = firstNum * secondNum;
  printf("Result: %f", result);
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <get@plt>
movss  %xmm0,-0x4(%rbp)
lea    0xed8(%rip),%rdi
call   1040 <get@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <get@plt>
movss  %xmm0,0x4(%rsp)
lea    0xede(%rip),%rdi
call   1040 <get@plt>
mulss  0x4(%rsp),%xmm0
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Enter your first number\00"
@.str.1 = [25 x i8] c"Enter your second number\00"
@.str.2 = [11 x i8] c"Result: %f\00"
define void @multiply() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call float @get(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store float %4, float* %1
%5 = call float @get(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store float %5, float* %2
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fmul float %6, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %9)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter your first number\00"
@.str.1 = [25 x i8] c"Enter your second number\00"
@.str.2 = [11 x i8] c"Result: %f\00"
define void @multiply() {
%1 = tail call float @get(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call float @get(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = fmul float %1, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %3)
ret void
}
unsigned set_bit_val(unsigned val, unsigned pos, char to) {
  return (val & ~((unsigned)1 << pos)) | ((unsigned)to << pos);
}


x86 assembly (clang, -O0):
<set_bit_val>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_val>:
mov    %edx,%eax
mov    %esi,%ecx
btr    %esi,%edi
shl    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @set_bit_val(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
%11 = and i32 %7, %10
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
%16 = or i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @set_bit_val(i32 %0, i32 %1, i8 signext %2) {
%4 = shl nuw i32 1, %1
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = sext i8 %2 to i32
%8 = shl i32 %7, %1
%9 = or i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int zsock_socketpair(int, int, int, int *);
int socketpair(int family, int type, int proto, int sv[2]) {
  return zsock_socketpair(family, type, proto, sv);
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <zsock_socketpair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
jmp    1030 <zsock_socketpair@plt>

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

LLVM IR (-O2):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @zsock_socketpair(i32 %0, i32 %1, i32 %2, i32* %3)
ret i32 %5
}