xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free_string(char *);
char *ipv6_ipv4(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void ipv6_ipv4_c(char *userInput, char *buf) {
  char *result = ipv6_ipv4(userInput);
  strcpy(buf, result);
  free_string(result);
}


x86 assembly (clang, -O0):
<ipv6_ipv4_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ipv6_ipv4@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1050 <free_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_ipv4_c>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <ipv6_ipv4@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <free_string@plt>

LLVM IR (-O0):
define void @ipv6_ipv4_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @ipv6_ipv4(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free_string(i8* %11)
ret void
}

LLVM IR (-O2):
define void @ipv6_ipv4_c(i8* %0, i8* %1) {
%3 = tail call i8* @ipv6_ipv4(i8* %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
%5 = tail call i32 @free_string(i8* %3)
ret void
}
/* Type definitions */
struct grid_epbase {
  int dummy;
};

/* Variables and functions */
int grid_cipc_create(void *, struct grid_epbase **);
int grid_ipc_connect(void *hint, struct grid_epbase **epbase) {
  return grid_cipc_create(hint, epbase);
}


x86 assembly (clang, -O0):
<grid_ipc_connect>:
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   1030 <grid_cipc_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_ipc_connect>:
jmp    1030 <grid_cipc_create@plt>

LLVM IR (-O0):
%struct.grid_epbase = type { i32 }
define i32 @grid_ipc_connect(i8* %0, %struct.grid_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_epbase**
store i8* %0, i8** %3
store %struct.grid_epbase** %1, %struct.grid_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.grid_epbase**, %struct.grid_epbase*** %4
%7 = call i32 @grid_cipc_create(i8* %5, %struct.grid_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.grid_epbase = type { i32 }
define i32 @grid_ipc_connect(i8* %0, %struct.grid_epbase** %1) {
%3 = tail call i32 @grid_cipc_create(i8* %0, %struct.grid_epbase** %1)
ret i32 %3
}
void d2i_X509_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509_NAME() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int child_wait(int *pfdin, int *pfdout, int pid) {
  int stat;
  if (pfdin)
    close(*pfdin);
  if (pfdout)
    close(*pfdout);
  waitpid(pid, &stat, 0);
  return stat;
}


x86 assembly (clang, -O0):
<child_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <child_wait+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmpq   $0x0,-0x10(%rbp)
je     115f <child_wait+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_wait>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
test   %rdi,%rdi
je     1134 <child_wait+0x14>
mov    (%rdi),%edi
call   1030 <close@plt>
test   %rbx,%rbx
je     1140 <child_wait+0x20>
mov    (%rbx),%edi
call   1030 <close@plt>
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @child_wait(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %10, %3
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = call i32 @close(i32 %19)
br label %21
21: ; preds = %17, %14
%22 = load i32, i32* %6
%23 = call i32 @waitpid(i32 %22, i32* %7, i32 0)
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @child_wait(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i32* %0, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* %0
%9 = tail call i32 @close(i32 %8)
br label %10
10: ; preds = %7, %3
%11 = icmp eq i32* %1, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i32, i32* %1
%14 = tail call i32 @close(i32 %13)
br label %15
15: ; preds = %12, %10
%16 = call i32 @waitpid(i32 %2, i32* %4, i32 0)
%17 = load i32, i32* %4
ret i32 %17
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int,
                          struct sockaddr const *, int /*<<< orphan*/);
ssize_t txc_libc_sendto(int s, const void *buf, size_t len, int flags,
                        const struct sockaddr *to, socklen_t tolen) {
  return sendto(s, buf, len, flags, to, tolen);
}


x86 assembly (clang, -O0):
<txc_libc_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_sendto>:
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @txc_libc_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32, i32* %12
%19 = call i32 @sendto(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @txc_libc_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %7
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int statfs(char *, struct statfs *);
int main(void) {
  struct statfs buf;
  return statfs(".", &buf);
}


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

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

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.statfs
store i32 0, i32* %1
%3 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %2)
ret i32 %3
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
ret i32 %3
}
/* Variables and functions */
char *modifyServerUrl(char *, char *);
char *getServerDownloadUrl(char *serverUrl) {
  return modifyServerUrl(serverUrl, "random4000x4000.jpg");
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"random4000x4000.jpg\00"
define i8* @getServerDownloadUrl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @modifyServerUrl(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"random4000x4000.jpg\00"
define i8* @getServerDownloadUrl(i8* %0) {
%2 = tail call i8* @modifyServerUrl(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evbuffer_add_printf(struct evbuffer *, char *);
int get(struct evbuffer *ret_buf) {
  evbuffer_add_printf(ret_buf, "<!doctype html>\n<html "
                               "lang=zh>\n<head>\n\t<title>Dummy</title>\n</"
                               "head>\n<body>\n</body>\n</html>\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
@.str = [92 x i8] c"<!doctype html>\0A<html lang=zh>\0A<head>\0A\09<title>Dummy</title>\0A</head>\0A<body>\0A</body>\0A</html>\0A\00"
define i32 @get(%struct.evbuffer* %0) {
%2 = alloca %struct.evbuffer*
store %struct.evbuffer* %0, %struct.evbuffer** %2
%3 = load %struct.evbuffer*, %struct.evbuffer** %2
%4 = call i32 @evbuffer_add_printf(%struct.evbuffer* %3, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
@.str = [92 x i8] c"<!doctype html>\0A<html lang=zh>\0A<head>\0A\09<title>Dummy</title>\0A</head>\0A<body>\0A</body>\0A</html>\0A\00"
define i32 @get(%struct.evbuffer* %0) {
%2 = tail call i32 @evbuffer_add_printf(%struct.evbuffer* %0, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGPGRP;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ isatty(int);
pid_t tcgetpgrp(int fd) {
  pid_t pid;
  if (!isatty(fd))
    return -1;
  if (ioctl(fd, TIOCGPGRP, &pid) > 0)
    return pid;
  else
    return -1;
}


x86 assembly (clang, -O0):
<tcgetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
jne    1148 <tcgetpgrp+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <tcgetpgrp+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jle    1172 <tcgetpgrp+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <tcgetpgrp+0x59>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetpgrp>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1030 <isatty@plt>
test   %eax,%eax
je     1158 <tcgetpgrp+0x38>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1040 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jle    115d <tcgetpgrp+0x3d>
mov    0xc(%rsp),%eax
jmp    115d <tcgetpgrp+0x3d>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @isatty(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 -1, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* @TIOCGPGRP
%12 = call i64 @ioctl(i32 %10, i32 %11, i32* %4)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %17
16: ; preds = %9
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %14, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @isatty(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* @TIOCGPGRP
%8 = call i64 @ioctl(i32 %0, i32 %7, i32* %2)
%9 = icmp sgt i64 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct genevehdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ udp_hdr(struct sk_buff const *);
struct genevehdr *geneve_hdr(const struct sk_buff *skb) {
  return (struct genevehdr *)(udp_hdr(skb) + 1);
}


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

x86 assembly (clang, -O2):
<geneve_hdr>:
push   %rax
call   1030 <udp_hdr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.genevehdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.genevehdr* @geneve_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @udp_hdr(%struct.sk_buff* %3)
%5 = add nsw i64 %4, 1
%6 = inttoptr i64 %5 to %struct.genevehdr*
ret %struct.genevehdr* %6
}

LLVM IR (-O2):
%struct.genevehdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.genevehdr* @geneve_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @udp_hdr(%struct.sk_buff* %0)
%3 = add nsw i64 %2, 1
%4 = inttoptr i64 %3 to %struct.genevehdr*
ret %struct.genevehdr* %4
}
/* Variables and functions */
int /*<<< orphan*/ myFunction(int *, int, int /*<<< orphan*/);
int main() {
  int array[] = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33};
  myFunction((int *)array, 12, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1040 <myFunction@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <myFunction@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [12 x i32] [i32 72, i32 101, i32 108, i32 108, i32 111, i32 32, i32 87, i32 111, i32 114, i32 108, i32 100, i32 33]
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @myFunction(i32* %3, i32 12, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [12 x i32] [i32 72, i32 101, i32 108, i32 108, i32 111, i32 32, i32 87, i32 111, i32 114, i32 108, i32 100, i32 33]
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @myFunction(i32* %3, i32 12, i32 0)
ret i32 0
}
void debug_test(void) {
  unsigned i, sum;
  init_serial_gdb();
  asm("int $3");
  sum = 1;
  for (i = 1; i <= 100; i++) {
    sum += sum % i;
    printf("Current sum = %d\n", sum);
  }
}


x86 assembly (clang, -O0):
<debug_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init_serial_gdb@plt>
int3
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
ja     1175 <debug_test+0x55>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113e <debug_test+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_test>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <init_serial_gdb@plt>
int3
mov    $0x1,%ebx
lea    0xec8(%rip),%r14
mov    $0x1,%ebp
nopl   (%rax)
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
add    %edx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1140 <debug_test+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Current sum = %d\0A\00"
define void @debug_test() {
%1 = tail call i32 (...) @init_serial_gdb()
tail call void asm sideeffect "int $$3", "~{dirflag},~{fpsr},~{flags}"()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %6, %2 ]
%4 = phi i32 [ 1, %0 ], [ %8, %2 ]
%5 = urem i32 %3, %4
%6 = add i32 %5, %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 101
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ init_cmds;

/* Variables and functions */
int /*<<< orphan*/ i2c_setup();
int /*<<< orphan*/ i2c_write(unsigned char *, int);
int /*<<< orphan*/ usleep(int);
void wii_chuck_setup(void) {
  unsigned char init_cmds[] = {0x40, 0x00};
  i2c_setup();
  i2c_write(init_cmds, sizeof(init_cmds));
  usleep(240);
}


x86 assembly (clang, -O0):
<wii_chuck_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1040 <i2c_setup@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <i2c_write@plt>
mov    $0xf0,%edi
call   1050 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wii_chuck_setup>:
push   %rax
movw   $0x40,0x6(%rsp)
xor    %eax,%eax
call   1040 <i2c_setup@plt>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <i2c_write@plt>
mov    $0xf0,%edi
call   1050 <usleep@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.wii_chuck_setup.init_cmds = [2 x i8] c"@\00"
define void @wii_chuck_setup() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = call i32 (...) @i2c_setup()
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @i2c_write(i8* %4, i32 2)
%6 = call i32 @usleep(i32 240)
ret void
}

LLVM IR (-O2):
define void @wii_chuck_setup() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 64, i16* %1
%3 = tail call i32 (...) @i2c_setup()
%4 = call i32 @i2c_write(i8* %2, i32 2)
%5 = call i32 @usleep(i32 240)
ret void
}
min(a, b) {
  if (a < b)
    return (a);
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @min(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 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
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 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void XTextExtents() {}


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

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

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

LLVM IR (-O2):
define void @XTextExtents() {
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_v24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v24_8_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? c + ('a' - 'A') : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_pir();
void spr_write_pir(void *opaque, int sprn) { gen_op_store_pir(); }


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

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

LLVM IR (-O0):
define void @spr_write_pir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_pir()
ret void
}

LLVM IR (-O2):
define void @spr_write_pir(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_pir()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ symbol_debug_print(void *);
void symbol_dump__(const char *dontcare__, void *symbol, void *unused__) {
  symbol_debug_print(symbol);
}


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

x86 assembly (clang, -O2):
<symbol_dump__>:
mov    %rsi,%rdi
jmp    1030 <symbol_debug_print@plt>

LLVM IR (-O0):
define void @symbol_dump__(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** %5
%8 = call i32 @symbol_debug_print(i8* %7)
ret void
}

LLVM IR (-O2):
define void @symbol_dump__(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @symbol_debug_print(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ task_deassert_flag(int, int);
void task_deassert_used(int id) { task_deassert_flag(id, (1 << 0)); }


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

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

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

LLVM IR (-O2):
define void @task_deassert_used(i32 %0) {
%2 = tail call i32 @task_deassert_flag(i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int setFDNonBlocking(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  if (flags < 0) {
    return flags;
  }
  flags |= O_NONBLOCK;
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<setFDNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <setFDNonBlocking+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <setFDNonBlocking+0x5c>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setFDNonBlocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <setFDNonBlocking+0x33>
mov    0x2eba(%rip),%rcx
mov    (%rcx),%edx
or     %eax,%edx
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setFDNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* @O_NONBLOCK
%14 = load i32, i32* %4
%15 = or i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* @F_SETFL
%18 = load i32, i32* %4
%19 = call i32 @fcntl(i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %2
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setFDNonBlocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFL
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ %3, %1 ]
ret i32 %11
}
int rename(const char *oldpath, const char *newpath) {
  long __res;
  __asm__ volatile("int $0x80"
                   : "=a"(__res)
                   : "0"(38), "b"((long)(oldpath)), "c"((long)(newpath)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x26,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffff83,-0x20(%rbp)
jb     1133 <rename+0x33>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x26,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 38, i64 %7, i64 %9)
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp uge i64 %12, -125
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 -1, i64* %5
br label %15
15: ; preds = %14, %11
%16 = load i64, i64* %5
%17 = trunc i64 %16 to i32
br label %18
18: ; preds = %15
ret i32 %17
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 38, i64 %3, i64 %4)
%6 = icmp ugt i64 %5, -126
%7 = trunc i64 %5 to i32
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
void fcn6(int x) { x = (x * ((long)&x)) + (((long)&x) / 2) * 1337; }


x86 assembly (clang, -O0):
<fcn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
lea    -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   $0x539,%rcx,%rcx
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fcn6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = ptrtoint i32* %2 to i64
%6 = mul nsw i64 %4, %5
%7 = ptrtoint i32* %2 to i64
%8 = sdiv i64 %7, 2
%9 = mul nsw i64 %8, 1337
%10 = add nsw i64 %6, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
ret void
}

LLVM IR (-O2):
define void @fcn6(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input_array(int *, int);
int /*<<< orphan*/ insert_sort(int *, int);
int /*<<< orphan*/ output_array(int *, int);
int main(int argc, char const *argv[]) {
  int x[8];
  input_array(x, 8);
  insert_sort(x, 8);
  output_array(x, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <input_array@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1050 <insert_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <output_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <input_array@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <insert_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <output_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%8 = call i32 @input_array(i32* %7, i32 8)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%10 = call i32 @insert_sort(i32* %9, i32 8)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%12 = call i32 @output_array(i32* %11, i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @input_array(i32* %5, i32 8)
%7 = call i32 @insert_sort(i32* %5, i32 8)
%8 = call i32 @output_array(i32* %5, i32 8)
ret i32 0
}
int add_acl(int sock, int argc, char **argv) { return (0); }


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

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

LLVM IR (-O0):
define i32 @add_acl(i32 %0, i32 %1, i8** %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
ret i32 0
}

LLVM IR (-O2):
define i32 @add_acl(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long error;
};
typedef TYPE_1__ ERR_STRING_DATA;

/* Variables and functions */
unsigned long ERR_GET_FUNC(unsigned long);
unsigned long ERR_GET_LIB(unsigned long);
unsigned long err_hash(ERR_STRING_DATA *a) {
  unsigned long ret, l;
  l = a->error;
  ret = l ^ ERR_GET_LIB(l) ^ ERR_GET_FUNC(l);
  return (ret ^ ret % 19 * 13);
}


x86 assembly (clang, -O0):
<err_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ERR_GET_LIB@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ERR_GET_FUNC@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x13,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
imul   $0xd,%rdx,%rcx
xor    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_hash>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <ERR_GET_LIB@plt>
mov    %rax,%r14
xor    %rbx,%r14
mov    %rbx,%rdi
call   1040 <ERR_GET_FUNC@plt>
mov    %rax,%rcx
xor    %r14,%rcx
movabs $0xd79435e50d79435f,%rdx
35 94 d7
mov    %rcx,%rax
mul    %rdx
shr    $0x4,%rdx
lea    (%rdx,%rdx,8),%rax
lea    (%rdx,%rax,2),%rax
mov    %rcx,%rdx
sub    %rax,%rdx
lea    (%rdx,%rdx,2),%rax
lea    (%rdx,%rax,4),%rax
xor    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i64 @err_hash(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i64
%4 = alloca i64
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = load i64, i64* %4
%10 = call i64 @ERR_GET_LIB(i64 %9)
%11 = xor i64 %8, %10
%12 = load i64, i64* %4
%13 = call i64 @ERR_GET_FUNC(i64 %12)
%14 = xor i64 %11, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = load i64, i64* %3
%17 = urem i64 %16, 19
%18 = mul i64 %17, 13
%19 = xor i64 %15, %18
ret i64 %19
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i64 @err_hash(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = tail call i64 @ERR_GET_LIB(i64 %3)
%5 = xor i64 %4, %3
%6 = tail call i64 @ERR_GET_FUNC(i64 %3)
%7 = xor i64 %5, %6
%8 = urem i64 %7, 19
%9 = mul nuw nsw i64 %8, 13
%10 = xor i64 %9, %7
ret i64 %10
}
/* Variables and functions */
char *extract_variable_name_to_ptr(char *buf, size_t pos) {
  return (char *)buf + pos;
}


x86 assembly (clang, -O0):
<extract_variable_name_to_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_variable_name_to_ptr>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @extract_variable_name_to_ptr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @extract_variable_name_to_ptr(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int find_device_by_ifaddrs(struct device *);
int find_device_by_ioctl(struct device *);
int find_device_by_sysfs(struct device *);
int find_device(struct device *dev) {
  int rc;
  rc = find_device_by_ifaddrs(dev);
  if (rc >= 0)
    goto out;
  rc = find_device_by_sysfs(dev);
  if (rc >= 0)
    goto out;
  rc = find_device_by_ioctl(dev);
out:
  return rc;
}


x86 assembly (clang, -O0):
<find_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <find_device_by_ifaddrs@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1157 <find_device+0x27>
jmp    117e <find_device+0x4e>
mov    -0x8(%rbp),%rdi
call   1030 <find_device_by_sysfs@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1172 <find_device+0x42>
jmp    117e <find_device+0x4e>
mov    -0x8(%rbp),%rdi
call   1040 <find_device_by_ioctl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_device>:
push   %rbx
mov    %rdi,%rbx
call   1050 <find_device_by_ifaddrs@plt>
test   %eax,%eax
jns    1149 <find_device+0x19>
mov    %rbx,%rdi
call   1030 <find_device_by_sysfs@plt>
test   %eax,%eax
js     114b <find_device+0x1b>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <find_device_by_ioctl@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @find_device(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca i32
store %struct.device* %0, %struct.device** %2
%4 = load %struct.device*, %struct.device** %2
%5 = call i32 @find_device_by_ifaddrs(%struct.device* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %18
9: ; preds = %1
%10 = load %struct.device*, %struct.device** %2
%11 = call i32 @find_device_by_sysfs(%struct.device* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %18
15: ; preds = %9
%16 = load %struct.device*, %struct.device** %2
%17 = call i32 @find_device_by_ioctl(%struct.device* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %14, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @find_device(%struct.device* %0) {
%2 = tail call i32 @find_device_by_ifaddrs(%struct.device* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @find_device_by_sysfs(%struct.device* %0)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @find_device_by_ioctl(%struct.device* %0)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ %2, %1 ], [ %5, %4 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
struct file_handle {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, struct file_handle *, int *, int);
int name_to_handle_at(int fd, const char *name, struct file_handle *handle,
                      int *mnt_id, int flags) {
  return syscall(303, fd, name, handle, mnt_id, flags);
}


x86 assembly (clang, -O0):
<name_to_handle_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x12f,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_to_handle_at>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x12f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.file_handle = type { i32 }
define i32 @name_to_handle_at(i32 %0, i8* %1, %struct.file_handle* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.file_handle*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store %struct.file_handle* %2, %struct.file_handle** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load %struct.file_handle*, %struct.file_handle** %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 303, i32 %11, i8* %12, %struct.file_handle* %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.file_handle = type { i32 }
define i32 @name_to_handle_at(i32 %0, i8* %1, %struct.file_handle* %2, i32* %3, i32 %4) {
%6 = tail call i32 @syscall(i32 303, i32 %0, i8* %1, %struct.file_handle* %2, i32* %3, i32 %4)
ret i32 %6
}
void _a64_enable_interrupts() { __asm__ __volatile__("sti"); }


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

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

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

LLVM IR (-O2):
define void @_a64_enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int Bar8(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res;
  res = Bar8(6, 8, 0);
  printf("main: res = %d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <Bar8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <Bar8@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"main: res = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @Bar8(i32 6, i32 8, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"main: res = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Bar8(i32 6, i32 8, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
float gauss(float, float);
float LoG(float x, float sigma) {
  float x1 = gauss(x, sigma);
  return (x * x - 2 * sigma * sigma) / (sigma * sigma * sigma * sigma) * x1;
}


x86 assembly (clang, -O0):
<LoG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <gauss@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xeb8(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
mulss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoG>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <gauss@plt>
movss  0xed7(%rip),%xmm1
movss  (%rsp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm3,%xmm1
movss  0x4(%rsp),%xmm2
mulss  %xmm2,%xmm2
addss  %xmm1,%xmm2
movaps %xmm3,%xmm1
mulss  %xmm3,%xmm1
mulss  %xmm3,%xmm1
mulss  %xmm3,%xmm1
divss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @LoG(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @gauss(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %3
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fmul float 2.000000e+00, %11
%13 = load float, float* %4
%14 = fmul float %12, %13
%15 = fneg float %14
%16 = call float @llvm.fmuladd.f32(float %9, float %10, float %15)
%17 = load float, float* %4
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = load float, float* %4
%21 = fmul float %19, %20
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = fdiv float %16, %23
%25 = load float, float* %5
%26 = fmul float %24, %25
ret float %26
}

LLVM IR (-O2):
define float @LoG(float %0, float %1) {
%3 = tail call float @gauss(float %0, float %1)
%4 = fmul float %1, -2.000000e+00
%5 = fmul float %4, %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %5)
%7 = fmul float %1, %1
%8 = fmul float %7, %1
%9 = fmul float %8, %1
%10 = fdiv float %6, %9
%11 = fmul float %10, %3
ret float %11
}
void _PyPy_set_387controlword(unsigned short cw) {
  __asm__ __volatile__("fldcw %0" : : "m"(cw));
}


x86 assembly (clang, -O0):
<_PyPy_set_387controlword>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
fldcw  -0x2(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PyPy_set_387controlword>:
mov    %di,-0x2(%rsp)
fldcw  -0x2(%rsp)
ret

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

LLVM IR (-O2):
define void @_PyPy_set_387controlword(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int bar(void) {
  printf("bar rules!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [12 x i8] c"bar rules!\0A\00"
define i32 @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [11 x i8] c"bar rules!\00"
define i32 @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}