xunge/DecIR huggingface dataset:
/* Variables and functions */
float runpath(int /*<<< orphan*/, int, int, int, int, int /*<<< orphan*/);
float pathlen(int x1, int y1, int x2, int y2) {
  return runpath(0, x1, y1, x2, y2, 0);
}


x86 assembly (clang, -O0):
<pathlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1030 <runpath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathlen>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
xor    %r9d,%r9d
jmp    1030 <runpath@plt>

LLVM IR (-O0):
define float @pathlen(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 float @runpath(i32 0, i32 %9, i32 %10, i32 %11, i32 %12, i32 0)
ret float %13
}

LLVM IR (-O2):
define float @pathlen(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call float @runpath(i32 0, i32 %0, i32 %1, i32 %2, i32 %3, i32 0)
ret float %5
}
/* Variables and functions */
int g_waitchild();
int /*<<< orphan*/ g_writeln(char *, int);
void child_sig(int sig_num) {
  int pid;
  g_writeln("got SIGCHLD(%d)", sig_num);
  pid = g_waitchild();
  if (pid > 0) {
    g_writeln("child %d exited", pid);
  }
}


x86 assembly (clang, -O0):
<child_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <g_writeln@plt>
mov    $0x0,%al
call   1040 <g_waitchild@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115d <child_sig+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <g_writeln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_sig>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <g_writeln@plt>
xor    %eax,%eax
call   1040 <g_waitchild@plt>
test   %eax,%eax
jle    1149 <child_sig+0x29>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <g_writeln@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"got SIGCHLD(%d)\00"
@.str.1 = [16 x i8] c"child %d exited\00"
define void @child_sig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @g_writeln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @g_waitchild()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @g_writeln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"got SIGCHLD(%d)\00"
@.str.1 = [16 x i8] c"child %d exited\00"
define void @child_sig(i32 %0) {
%2 = tail call i32 @g_writeln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @g_waitchild()
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @g_writeln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %7
7: ; preds = %5, %1
ret void
}
int nisplusserver_del(const char *ifname, const int ifindex,
                      const char *addrPlain) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @nisplusserver_del(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ qlen;

/* Variables and functions */
int /*<<< orphan*/ SOL_TCP;
int /*<<< orphan*/ TCP_FASTOPEN;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void socket_pre_listen(int fd) {
  int qlen = 5;
  assert(!setsockopt(fd, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen)));
}


x86 assembly (clang, -O0):
<socket_pre_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_pre_listen>:
push   %rax
movl   $0x5,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_TCP = global i32 0
@TCP_FASTOPEN = global i32 0
define void @socket_pre_listen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_TCP
%6 = load i32, i32* @TCP_FASTOPEN
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@SOL_TCP = global i32 0
@TCP_FASTOPEN = global i32 0
define void @socket_pre_listen(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%4 = load i32, i32* @SOL_TCP
%5 = load i32, i32* @TCP_FASTOPEN
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
char const *getenv(char const *);
const char *c_getenv(const char *variable) { return getenv(variable); }


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

x86 assembly (clang, -O2):
<c_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @c_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_yajl_end_map(void *ctx) {
  printf("map close '}'\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"map close '}'\0A\00"
define i32 @test_yajl_end_map(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [14 x i8] c"map close '}'\00"
define i32 @test_yajl_end_map(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void gtk_widget_realize() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_realize() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int emu8k_inw(int, void *);
uint8_t emu8k_inb(uint16_t addr, void *p) {
  if (addr & 1)
    return emu8k_inw(addr & ~1, p) >> 1;
  return emu8k_inw(addr, p) & 0xff;
}


x86 assembly (clang, -O0):
<emu8k_inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1148 <emu8k_inb+0x38>
mov    -0x8(%rbp),%edi
and    $0xfffffffe,%edi
mov    -0x10(%rbp),%rsi
call   1030 <emu8k_inw@plt>
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <emu8k_inb+0x4c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <emu8k_inw@plt>
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu8k_inb>:
push   %rax
test   $0x1,%dil
jne    1121 <emu8k_inb+0x11>
call   1030 <emu8k_inw@plt>
movzbl %al,%eax
pop    %rcx
ret
and    $0xfffffffe,%edi
call   1030 <emu8k_inw@plt>
sar    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @emu8k_inb(i32 %0, i8* %1) {
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = and i32 %0, -2
%7 = tail call i32 @emu8k_inw(i32 %6, i8* %1)
%8 = ashr i32 %7, 1
br label %12
9: ; preds = %2
%10 = tail call i32 @emu8k_inw(i32 %0, i8* %1)
%11 = and i32 %10, 255
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %8, %5 ], [ %11, %9 ]
ret i32 %13
}
void ikt_read(void) {}


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

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

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

LLVM IR (-O2):
define void @ikt_read() {
ret void
}
int maxInt(int a, int b) {
  if (b > a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<maxInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxInt+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <maxInt+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxInt>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void tegra_dvfs_add_relationships(struct dvfs_relationship *rels, int n) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void timer_list_close(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<timer_list_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @timer_list_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) void softboundmpx_rewinddir(DIR *dirp) {
  rewinddir(dirp);
}


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

x86 assembly (clang, -O2):
<softboundmpx_rewinddir>:
jmp    1030 <rewinddir@plt>

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

LLVM IR (-O2):
define weak void @softboundmpx_rewinddir(i32* %0) {
%2 = tail call i32 @rewinddir(i32* %0)
ret void
}
void DoNothing() {}


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

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

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

LLVM IR (-O2):
define void @DoNothing() {
ret void
}
int acquire_one_block(struct noacq_workspace *ws, unsigned char *buffer,
                      int maxsize) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.noacq_workspace = type opaque
define i32 @acquire_one_block(%struct.noacq_workspace* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inter_config_read(char const *);
int /*<<< orphan*/ inter_guild_init();
int /*<<< orphan*/ inter_party_init();
int /*<<< orphan*/ inter_pet_init();
int /*<<< orphan*/ inter_storage_init();
int inter_init(const char *file) {
  inter_config_read(file);
  inter_storage_init();
  inter_party_init();
  inter_guild_init();
  inter_pet_init();
  return 0;
}


x86 assembly (clang, -O0):
<inter_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <inter_config_read@plt>
mov    $0x0,%al
call   1040 <inter_storage_init@plt>
mov    $0x0,%al
call   1030 <inter_party_init@plt>
mov    $0x0,%al
call   1050 <inter_guild_init@plt>
mov    $0x0,%al
call   1070 <inter_pet_init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_init>:
push   %rax
call   1060 <inter_config_read@plt>
xor    %eax,%eax
call   1040 <inter_storage_init@plt>
xor    %eax,%eax
call   1030 <inter_party_init@plt>
xor    %eax,%eax
call   1050 <inter_guild_init@plt>
xor    %eax,%eax
call   1070 <inter_pet_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @inter_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @inter_config_read(i8* %3)
%5 = call i32 (...) @inter_storage_init()
%6 = call i32 (...) @inter_party_init()
%7 = call i32 (...) @inter_guild_init()
%8 = call i32 (...) @inter_pet_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @inter_init(i8* %0) {
%2 = tail call i32 @inter_config_read(i8* %0)
%3 = tail call i32 (...) @inter_storage_init()
%4 = tail call i32 (...) @inter_party_init()
%5 = tail call i32 (...) @inter_guild_init()
%6 = tail call i32 (...) @inter_pet_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
void checkfzero(double farg) {
  if (farg == 0.0)
    xlfail("division by zero");
}


x86 assembly (clang, -O0):
<checkfzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1141 <checkfzero+0x31>
jp     1141 <checkfzero+0x31>
lea    0xec4(%rip),%rdi
call   1030 <xlfail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfzero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1128 <checkfzero+0x18>
jp     1128 <checkfzero+0x18>
lea    0xedd(%rip),%rdi
jmp    1030 <xlfail@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"division by zero\00"
define void @checkfzero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"division by zero\00"
define void @checkfzero(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double tanh(double);
double TangenteHiperbolico(double x) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &x);
  return (tanh(x));
}


x86 assembly (clang, -O0):
<TangenteHiperbolico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TangenteHiperbolico>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <tanh@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @TangenteHiperbolico(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @tanh(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @TangenteHiperbolico(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @tanh(double %6)
ret double %7
}
void test_ar_1_SHRT(void *d, short n) {
  if (n == 0x7fff - 1)
    n = 0x7fff - 2;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_1_SHRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x7ffe,%eax
jne    1138 <test_ar_1_SHRT+0x28>
movw   $0x7ffd,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movswq -0xa(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_1_SHRT>:
cmp    $0x7ffe,%esi
mov    $0x7ffd,%eax
cmovne %esi,%eax
movslq %eax,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test_ar_1_SHRT(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = icmp eq i32 %6, 32766
br i1 %7, label %8, label %9
8: ; preds = %2
store i16 32765, i16* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i16, i16* %4
%12 = sext i16 %11 to i64
ret void
}

LLVM IR (-O2):
define void @test_ar_1_SHRT(i8* nocapture writeonly %0, i16 signext %1) {
%3 = icmp eq i16 %1, 32766
%4 = select i1 %3, i16 32765, i16 %1
%5 = sext i16 %4 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %5, i1 false)
ret void
}
int get_cores(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @get_cores() {
ret i32 5
}

LLVM IR (-O2):
define i32 @get_cores() {
ret i32 5
}
double Q_et(double Q_et_convection, double Q_et_gradp, double Q_et_heatflux,
            double Q_et_time, double Q_et_viscous) {
  return Q_et_convection + Q_et_gradp + Q_et_heatflux + Q_et_time +
         Q_et_viscous;
}


x86 assembly (clang, -O0):
<Q_et>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_et>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @Q_et(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load double, double* %10
%19 = fadd double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @Q_et(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = fadd double %8, %4
ret double %9
}
void outb(unsigned char value, int port) {
  asm volatile("out"
               "b"
               " %"
               "b"
               "0, %w1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i32 %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ applyBlePatch();
void rf_patch_cpe_ble(void) { applyBlePatch(); }


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

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

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

LLVM IR (-O2):
define void @rf_patch_cpe_ble() {
%1 = tail call i32 (...) @applyBlePatch()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t isPowerPixel(uint8_t x, uint8_t y) {
  if ((x == 3) || (x == 28)) {
    if ((y == 6) || (y == 26)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isPowerPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     111e <isPowerPixel+0x1e>
cmpl   $0x1c,-0x8(%rbp)
jne    1143 <isPowerPixel+0x43>
cmpl   $0x6,-0xc(%rbp)
je     1132 <isPowerPixel+0x32>
cmpl   $0x1a,-0xc(%rbp)
jne    113e <isPowerPixel+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    114a <isPowerPixel+0x4a>
jmp    1143 <isPowerPixel+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerPixel>:
cmp    $0x1c,%edi
je     110c <isPowerPixel+0xc>
xor    %eax,%eax
cmp    $0x3,%edi
jne    111d <isPowerPixel+0x1d>
cmp    $0x1a,%esi
sete   %al
cmp    $0x6,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isPowerPixel(i32 %0, i32 %1) {
switch i32 %0, label %8 [
i32 28, label %3
i32 3, label %3
]
3: ; preds = %2, %2
%4 = icmp eq i32 %1, 26
%5 = icmp eq i32 %1, 6
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %3
%9 = phi i32 [ %7, %3 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
size_t gcspy_getTime() {}


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

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

LLVM IR (-O0):
define i64 @gcspy_getTime() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @gcspy_getTime() {
ret i64 undef
}
__attribute__((always_)) unsigned int hw_bitClear(unsigned int n, int bit) {
  return (n & ~(1U << bit));
}


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

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

LLVM IR (-O0):
define i32 @hw_bitClear(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @hw_bitClear(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void select_init(void) {
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<select_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_init>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @select_init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_FLAT
%4 = call i32 @glShadeModel(i32 %3)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @select_init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_FLAT
%4 = tail call i32 @glShadeModel(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ all_fast_tests(int /*<<< orphan*/);
int /*<<< orphan*/ curvesigs_slow_test(int /*<<< orphan*/, int);
int /*<<< orphan*/ vxeddsa_slow_test(int /*<<< orphan*/, int);
int /*<<< orphan*/ xeddsa_slow_test(int /*<<< orphan*/, int);
int /*<<< orphan*/ xeddsa_to_curvesigs_slow_test(int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  all_fast_tests(0);
  curvesigs_slow_test(0, 10000);
  xeddsa_slow_test(0, 10000);
  xeddsa_to_curvesigs_slow_test(0, 10000);
  vxeddsa_slow_test(0, 10000000);
  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)
xor    %edi,%edi
call   1070 <all_fast_tests@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1040 <curvesigs_slow_test@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1050 <xeddsa_slow_test@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1030 <xeddsa_to_curvesigs_slow_test@plt>
xor    %edi,%edi
mov    $0x989680,%esi
call   1060 <vxeddsa_slow_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1070 <all_fast_tests@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1040 <curvesigs_slow_test@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1050 <xeddsa_slow_test@plt>
xor    %edi,%edi
mov    $0x2710,%esi
call   1030 <xeddsa_to_curvesigs_slow_test@plt>
xor    %edi,%edi
mov    $0x989680,%esi
call   1060 <vxeddsa_slow_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @all_fast_tests(i32 0)
%7 = call i32 @curvesigs_slow_test(i32 0, i32 10000)
%8 = call i32 @xeddsa_slow_test(i32 0, i32 10000)
%9 = call i32 @xeddsa_to_curvesigs_slow_test(i32 0, i32 10000)
%10 = call i32 @vxeddsa_slow_test(i32 0, i32 10000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @all_fast_tests(i32 0)
%4 = tail call i32 @curvesigs_slow_test(i32 0, i32 10000)
%5 = tail call i32 @xeddsa_slow_test(i32 0, i32 10000)
%6 = tail call i32 @xeddsa_to_curvesigs_slow_test(i32 0, i32 10000)
%7 = tail call i32 @vxeddsa_slow_test(i32 0, i32 10000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int days_since_epoch(int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
uint8_t datetime_day_of_week(uint16_t year, uint8_t month, uint8_t day) {
  return (uint8_t)((days_since_epoch(year, month, day) % 7) + 1);
}


x86 assembly (clang, -O0):
<datetime_day_of_week>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <days_since_epoch@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<datetime_day_of_week>:
push   %rax
call   1030 <days_since_epoch@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @datetime_day_of_week(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @days_since_epoch(i32 %7, i32 %8, i32 %9)
%11 = srem i32 %10, 7
%12 = add nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @datetime_day_of_week(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @days_since_epoch(i32 %0, i32 %1, i32 %2)
%5 = srem i32 %4, 7
%6 = add nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
int ft_putchar_fd(int c, int fd) {
  write(fd, &c, 1);
  return (c);
}


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

x86 assembly (clang, -O2):
<ft_putchar_fd>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%eax
mov    %edi,%ebx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_putchar_fd(i32 returned %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @write(i32 %1, i32* %3, i32 1)
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  void *(*)(), int /*<<< orphan*/);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void *fork_stuff() {
  pthread_t fork_thread, f2;
  pthread_create(&fork_thread, NULL, fork_stuff, 0);
  pthread_create(&f2, NULL, fork_stuff, 0);
  while (1) {
    pthread_join(fork_thread, NULL);
  }
}


x86 assembly (clang, -O0):
<fork_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    0x2eb1(%rip),%rdx
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    0x2e9b(%rip),%rdx
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
jmp    1154 <fork_stuff+0x34>

x86 assembly (clang, -O2):
<fork_stuff>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
lea    0xc(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
xchg   %ax,%ax
mov    0x8(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_join@plt>
jmp    1150 <fork_stuff+0x30>

LLVM IR (-O0):
define i8* @fork_stuff() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @pthread_create(i32* %1, i32* null, i8* (...)* bitcast (i8* ()* @fork_stuff to i8* (...)*), i32 0)
%4 = call i32 @pthread_create(i32* %2, i32* null, i8* (...)* bitcast (i8* ()* @fork_stuff to i8* (...)*), i32 0)
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @pthread_join(i32 %6, i32* null)
br label %5
}

LLVM IR (-O2):
define noalias i8* @fork_stuff() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @pthread_create(i32* %1, i32* null, i8* (...)* bitcast (i8* ()* @fork_stuff to i8* (...)*), i32 0)
%6 = call i32 @pthread_create(i32* %2, i32* null, i8* (...)* bitcast (i8* ()* @fork_stuff to i8* (...)*), i32 0)
br label %7
7: ; preds = %7, %0
%8 = load i32, i32* %1
%9 = call i32 @pthread_join(i32 %8, i32* null)
br label %7
}
/* Type definitions */
struct DataMap {
  int dummy;
};

/* Variables and functions */
struct DataMap *DataMapReadBlock(int, int /*<<< orphan*/ *);
struct DataMap *DataMapRead(int fid) {
  return DataMapReadBlock(fid, NULL);
}


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

x86 assembly (clang, -O2):
<DataMapRead>:
xor    %esi,%esi
jmp    1030 <DataMapReadBlock@plt>

LLVM IR (-O0):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapRead(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.DataMap* @DataMapReadBlock(i32 %3, i32* null)
ret %struct.DataMap* %4
}

LLVM IR (-O2):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapRead(i32 %0) {
%2 = tail call %struct.DataMap* @DataMapReadBlock(i32 %0, i32* null)
ret %struct.DataMap* %2
}
/* Variables and functions */
int swap_atomic(int volatile *, int);
int test_and_set(volatile int *addr) {
  int old_value;
  old_value = swap_atomic(addr, 1);
  if (old_value == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test_and_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <swap_atomic@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1143 <test_and_set+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <test_and_set+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set>:
push   %rax
mov    $0x1,%esi
call   1030 <swap_atomic@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_and_set(i32* %0) {
%2 = tail call i32 @swap_atomic(i32* %0, i32 1)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ maxalloc(int, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc > 1) {
    maxalloc((int)strtol(argv[1], NULL, 0), 30);
  } else {
    maxalloc(4000, 30);
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1164 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,%edi
mov    $0x1e,%esi
call   1030 <maxalloc@plt>
jmp    1173 <main+0x53>
mov    $0xfa0,%edi
mov    $0x1e,%esi
call   1030 <maxalloc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0xfa0,%edi
cmp    $0x2,%eax
jl     113d <main+0x1d>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %rax,%rdi
mov    $0x1e,%esi
call   1030 <maxalloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strtol(i8* %11, i32* null, i32 0)
%13 = trunc i64 %12 to i32
%14 = call i32 @maxalloc(i32 %13, i32 30)
br label %17
15: ; preds = %2
%16 = call i32 @maxalloc(i32 4000, i32 30)
br label %17
17: ; preds = %15, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strtol(i8* nocapture %6, i32* null, i32 0)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 4000, %2 ]
%11 = tail call i32 @maxalloc(i32 %10, i32 30)
ret i32 0
}
int func4() {
#pragma critTer : 14 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 15 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func4() {
ret i32 0
}
int main(void) {
  int a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int execvpe(char const *, char *const *, char *const *);
int _execvpe(const char *path, char *const argv[], char *const envp[]) {
  return execvpe(path, argv, envp);
}


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

x86 assembly (clang, -O2):
<_execvpe>:
jmp    1030 <execvpe@plt>

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

LLVM IR (-O2):
define i32 @_execvpe(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @execvpe(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
int my_atoi(const char *s) {
  int ret = 0;
  while (*s) {
    if (*s < '0' || *s > '9')
      break;
    ret *= 10;
    ret += (*s - '0');
    s++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1169 <my_atoi+0x69>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     113c <my_atoi+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1141 <my_atoi+0x41>
jmp    1169 <my_atoi+0x69>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <my_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atoi>:
mov    (%rdi),%cl
lea    -0x3a(%rcx),%edx
xor    %eax,%eax
cmp    $0xf6,%dl
jb     113b <my_atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rdi
cmp    $0xf5,%dl
ja     1120 <my_atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -58
%16 = icmp ult i8 %15, -10
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_stripspace(struct strbuf *, int);
void stripspace(struct strbuf *buf, int skip_comments) {
  strbuf_stripspace(buf, skip_comments);
}


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

x86 assembly (clang, -O2):
<stripspace>:
jmp    1030 <strbuf_stripspace@plt>

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

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @stripspace(%struct.strbuf* %0, i32 %1) {
%3 = tail call i32 @strbuf_stripspace(%struct.strbuf* %0, i32 %1)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat stat_;
  if (-1 == stat(path, &stat_)) {
    return 0;
  }
  return S_ISDIR(stat_.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1154 <is_dir+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115f <is_dir+0x3f>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 -1, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}