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

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, size_t, void *, char const *, int);
void _mem_leak_cb(void *p, size_t s, const char *file, uint64_t line,
                  void *mem_userdata, void *cb_userdata) {
  printf("Memory leak size: %d, addr: %x. %s, %d.  \n", s, p, file, line);
  free(p);
}


x86 assembly (clang, -O0):
<_mem_leak_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mem_leak_cb>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Memory leak size: %d, addr: %x. %s, %d. \0A\00"
define void @_mem_leak_cb(i8* %0, i64 %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i64, i64* %8
%14 = load i8*, i8** %7
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %13, i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Memory leak size: %d, addr: %x. %s, %d. \0A\00"
define void @_mem_leak_cb(i8* %0, i64 %1, i8* %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %0, i8* %2, i32 %3)
%8 = tail call i32 @free(i8* %0)
ret void
}
void exit_data_1() {
#pragma omp target exit data map(from : var1)
}


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

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

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

LLVM IR (-O2):
define void @exit_data_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgetwd(char *);
int /*<<< orphan*/ iwrites(char *);
void pwd() {
  char wd[512];
  fgetwd(wd);
  iwrites(wd);
  iwrites("\n");
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
call   1040 <fgetwd@plt>
lea    -0x200(%rbp),%rdi
call   1030 <iwrites@plt>
lea    0xeb6(%rip),%rdi
call   1030 <iwrites@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <fgetwd@plt>
mov    %rbx,%rdi
call   1030 <iwrites@plt>
lea    0xebe(%rip),%rdi
call   1030 <iwrites@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @pwd() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @fgetwd(i8* %2)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 @iwrites(i8* %4)
%6 = call i32 @iwrites(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @pwd() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @fgetwd(i8* %2)
%4 = call i32 @iwrites(i8* %2)
%5 = call i32 @iwrites(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int enselftest(int verbose) { return (0); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @test45_Test8_pollen__run__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void visualize_clearScreen() {
  int n;
  for (n = 0; n < 10; n++) {
    (void)printf("\n\n\n\n\n\n\n\n\n\n");
  }
}


x86 assembly (clang, -O0):
<visualize_clearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <visualize_clearScreen+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <visualize_clearScreen+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visualize_clearScreen>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @visualize_clearScreen() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @visualize_clearScreen() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ getuid();
bool CheckRoot(void) { return getuid() == 0; }


x86 assembly (clang, -O0):
<CheckRoot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckRoot>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CheckRoot() {
%1 = call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @CheckRoot() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int errno;
int execve(char *, char **, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void ex(char **cmd) {
  char **nargv = cmd;
  char *nargp[] = {NULL};
  if (execve(nargv[0], nargv, nargp) == -1) {
    fprintf(stderr, "[R] error in execve: %d\n", errno);
  }
}


x86 assembly (clang, -O0):
<ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <execve@plt>
cmp    $0xffffffff,%eax
jne    118f <ex+0x5f>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    0x2e57(%rip),%rax
mov    (%rax),%edx
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex>:
push   %rax
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    (%rdi),%rdi
mov    %rsp,%rdx
call   1030 <execve@plt>
cmp    $0xffffffff,%eax
je     113e <ex+0x1e>
pop    %rax
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"[R] error in execve: %d\0A\00"
@errno = global i32 0
define void @ex(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca [1 x i8*]
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
store i8** %5, i8*** %3
%6 = bitcast [1 x i8*]* %4 to i8*
%7 = load i8**, i8*** %3
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%12 = call i32 @execve(i8* %9, i8** %10, i8** %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load i32, i32* @stderr
%16 = load i32, i32* @errno
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"[R] error in execve: %d\0A\00"
@errno = global i32 0
define void @ex(i8** %0) {
%2 = alloca [1 x i8*]
%3 = bitcast [1 x i8*]* %2 to i8*
%4 = bitcast [1 x i8*]* %2 to i64*
store i64 0, i64* %4
%5 = load i8*, i8** %0
%6 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%7 = call i32 @execve(i8* %5, i8** %0, i8** %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* @errno
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %1
ret void
}
/* Variables and functions */
char *caesar_cipher(char *, unsigned long, int);
char *caesar_encode(char *string, unsigned long len, int rot) {
  return caesar_cipher(string, len, rot);
}


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

x86 assembly (clang, -O2):
<caesar_encode>:
jmp    1030 <caesar_cipher@plt>

LLVM IR (-O0):
define i8* @caesar_encode(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i8* @caesar_cipher(i8* %7, i64 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @caesar_encode(i8* %0, i64 %1, i32 %2) {
%4 = tail call i8* @caesar_cipher(i8* %0, i64 %1, i32 %2)
ret i8* %4
}
unsigned int to_intconvertor1(unsigned char array[]) {
  unsigned int n;
  n = array[0];
  return n;
}


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

x86 assembly (clang, -O2):
<to_intconvertor1>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @to_intconvertor1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @to_intconvertor1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgravity_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xgravity.send_event = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xgravity_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send_header(int, int /*<<< orphan*/, char *, int);
void ack_open_close(int fd, char *buts_name) {
  net_send_header(fd, 0, buts_name, 2);
}


x86 assembly (clang, -O0):
<ack_open_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
mov    $0x2,%ecx
call   1030 <net_send_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack_open_close>:
mov    %rsi,%rdx
xor    %esi,%esi
mov    $0x2,%ecx
jmp    1030 <net_send_header@plt>

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

LLVM IR (-O2):
define void @ack_open_close(i32 %0, i8* %1) {
%3 = tail call i32 @net_send_header(i32 %0, i32 0, i8* %1, i32 2)
ret void
}
/* Variables and functions */
int syscall(int, char const *, unsigned int);
int memfd_create(const char *name, unsigned int flags) {
  return syscall(319, name, flags);
}


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

x86 assembly (clang, -O2):
<memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x13f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @memfd_create(i8* %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
%7 = call i32 @syscall(i32 319, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 319, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void holamundo(void) {
  printf("Hola Mundo\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Hola Mundo\00"
define void @holamundo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ pipe(int *);
int main(int argc, char *argv[]) {
  int *filedes = malloc(2 * sizeof(int));
  pipe(filedes);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <pipe@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**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @malloc(i32 8)
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @pipe(i32* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 8)
%4 = tail call i32 @pipe(i32* %3)
ret i32 0
}
int new_resource_value(char *key) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @new_resource_value(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t strlen(char const *);
size_t strings_len(const char *value) {
  if (value == NULL) {
    return 0;
  } else {
    return strlen(value);
  }
}


x86 assembly (clang, -O0):
<strings_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strings_len+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <strings_len+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_len>:
test   %rdi,%rdi
je     111a <strings_len+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strings_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling,
                                 int *old_ceiling) {
  (void)mutex;
  (void)prioceiling;
  (void)old_ceiling;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_mutex_setprioceiling>:
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):
<pthread_mutex_setprioceiling>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pthread_mutex_setprioceiling(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
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_mutex_setprioceiling(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
long double tan(long double);
long double tanl(long double a1) { return tan(a1); }


x86 assembly (clang, -O0):
<tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanl>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @tan(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int l_ge(char *, char *, int, int);
int intr_wrap_601(char *s1, char *s2, int l1, int l2) {
  return l_ge(s1, s2, l1, l2);
}


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

x86 assembly (clang, -O2):
<intr_wrap_601>:
jmp    1030 <l_ge@plt>

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

LLVM IR (-O2):
define i32 @intr_wrap_601(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @l_ge(i8* %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *);
int /*<<< orphan*/ gcc(char *);
int /*<<< orphan*/ system(char *);
void compile(char *file, char *name) {
  copy(file);
  gcc(name);
  system("rm temp.c");
}


x86 assembly (clang, -O0):
<compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <copy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <gcc@plt>
lea    0xea7(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile>:
push   %rbx
mov    %rsi,%rbx
call   1050 <copy@plt>
mov    %rbx,%rdi
call   1040 <gcc@plt>
lea    0xeb8(%rip),%rdi
pop    %rbx
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"rm temp.c\00"
define void @compile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @copy(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @gcc(i8* %7)
%9 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"rm temp.c\00"
define void @compile(i8* %0, i8* %1) {
%3 = tail call i32 @copy(i8* %0)
%4 = tail call i32 @gcc(i8* %1)
%5 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_selectznz(uintptr_t, uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p434_selectznz(uint64_t out1[7], uint8_t arg1, const uint64_t arg2[7],
                         const uint64_t arg3[7]) {
  internal_fiat_p434_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_p434_selectznz>:
jmp    1030 <internal_fiat_p434_selectznz@plt>

LLVM IR (-O0):
define void @fiat_p434_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_p434_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_p434_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct addrinfo {
  scalar_t__ ai_addr;
};

/* Variables and functions */
struct addrinfo *getAddrInfo(char *, char *, int);
struct sockaddr_in *creerSockAddr(char *name, char *port, int type) {
  struct addrinfo *res;
  res = getAddrInfo(name, port, type);
  return ((struct sockaddr_in *)res->ai_addr);
}


x86 assembly (clang, -O0):
<creerSockAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <getAddrInfo@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creerSockAddr>:
push   %rax
call   1030 <getAddrInfo@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64 }
define %struct.sockaddr_in* @creerSockAddr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.addrinfo*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call %struct.addrinfo* @getAddrInfo(i8* %8, i8* %9, i32 %10)
store %struct.addrinfo* %11, %struct.addrinfo** %7
%12 = load %struct.addrinfo*, %struct.addrinfo** %7
%13 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to %struct.sockaddr_in*
ret %struct.sockaddr_in* %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64 }
define %struct.sockaddr_in* @creerSockAddr(i8* %0, i8* %1, i32 %2) {
%4 = tail call %struct.addrinfo* @getAddrInfo(i8* %0, i8* %1, i32 %2)
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.sockaddr_in*
ret %struct.sockaddr_in* %7
}
float Sleef_cosf_u10(float x) { return __builtin_cosf(x); }


x86 assembly (clang, -O0):
<Sleef_cosf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_cosf_u10>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @Sleef_cosf_u10(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
const char *Range_Name(void) { return "Range"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Range\00"
define i8* @Range_Name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void ptrace_sandbox_permit_listen(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_listen(%struct.pt_sandbox* nocapture %0) {
ret void
}
int test_reverseBytes(int x) {
  union U {
    int result;
    char byte[4];
  };
  union U u;
  int temp;
  u.result = x;
  temp = u.byte[0];
  u.byte[0] = u.byte[3];
  u.byte[3] = temp;
  temp = u.byte[1];
  u.byte[1] = u.byte[2];
  u.byte[2] = temp;
  return u.result;
}


x86 assembly (clang, -O0):
<test_reverseBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
movsbl -0x7(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x6(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverseBytes>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
%union.U = type { i32 }
define i32 @test_reverseBytes(i32 %0) {
%2 = alloca i32
%3 = alloca %union.U
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.U* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.U* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %4
%11 = bitcast %union.U* %3 to [4 x i8]*
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 3
%13 = load i8, i8* %12
%14 = bitcast %union.U* %3 to [4 x i8]*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = bitcast %union.U* %3 to [4 x i8]*
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 3
store i8 %17, i8* %19
%20 = bitcast %union.U* %3 to [4 x i8]*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %20, i64 0, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
store i32 %23, i32* %4
%24 = bitcast %union.U* %3 to [4 x i8]*
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 2
%26 = load i8, i8* %25
%27 = bitcast %union.U* %3 to [4 x i8]*
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %27, i64 0, i64 1
store i8 %26, i8* %28
%29 = load i32, i32* %4
%30 = trunc i32 %29 to i8
%31 = bitcast %union.U* %3 to [4 x i8]*
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %31, i64 0, i64 2
store i8 %30, i8* %32
%33 = bitcast %union.U* %3 to i32*
%34 = load i32, i32* %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @test_reverseBytes(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void prefposition_(a, b, c, d) int *a, *b, *c, *d;
{ prefposition((long)*a, (long)*b, (long)*c, (long)*d); }


x86 assembly (clang, -O0):
<prefposition_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
mov    -0x18(%rbp),%rax
movslq (%rax),%rdx
mov    -0x20(%rbp),%rax
movslq (%rax),%rcx
mov    $0x0,%al
call   1030 <prefposition@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefposition_>:
movslq (%rdi),%rdi
movslq (%rsi),%rsi
movslq (%rdx),%rdx
movslq (%rcx),%rcx
xor    %eax,%eax
jmp    1030 <prefposition@plt>

LLVM IR (-O0):
define void @prefposition_(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* %9
%11 = sext i32 %10 to i64
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = load i32*, i32** %7
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = call i32 (i64, i64, i64, i64, ...) bitcast (i32 (...)* @prefposition to i32 (i64, i64, i64, i64, ...)*)(i64 %11, i64 %14, i64 %17, i64 %20)
ret void
}

LLVM IR (-O2):
define void @prefposition_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = sext i32 %5 to i64
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = tail call i32 (i64, i64, i64, i64, ...) bitcast (i32 (...)* @prefposition to i32 (i64, i64, i64, i64, ...)*)(i64 %6, i64 %8, i64 %10, i64 %12)
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  int i = 0;
  while (*s) {
    i++;
    s++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
double coef(int n) {
  double t;
  if (n == 0) {
    return 0;
  }
  t = 1.0 / n;
  if (n % 2 == 0) {
    t = -t;
  }
  return t;
}


x86 assembly (clang, -O0):
<coef>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <coef+0x1e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <coef+0x73>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xed5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <coef+0x69>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coef>:
test   %edi,%edi
je     1123 <coef+0x23>
cvtsi2sd %edi,%xmm1
movsd  0xef0(%rip),%xmm0
divsd  %xmm1,%xmm0
test   $0x1,%dil
jne    1122 <coef+0x22>
xorpd  0xeee(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @coef(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fdiv double 1.000000e+00, %10
store double %11, double* %4
%12 = load i32, i32* %3
%13 = srem i32 %12, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load double, double* %4
%17 = fneg double %16
store double %17, double* %4
br label %18
18: ; preds = %15, %8
%19 = load double, double* %4
store double %19, double* %2
br label %20
20: ; preds = %18, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @coef(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = fdiv double 1.000000e+00, %4
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
%8 = fneg double %5
%9 = select i1 %7, double %8, double %5
br label %10
10: ; preds = %1, %3
%11 = phi double [ %9, %3 ], [ 0.000000e+00, %1 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void nasm_free(void *q) {
  if (q) {
    free(q);
  }
}


x86 assembly (clang, -O0):
<nasm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <nasm_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_free>:
test   %rdi,%rdi
je     111a <nasm_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @nasm_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @nasm_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2CM_I2CStop();
void I2CM_ScbModeStop(void) { I2CM_I2CStop(); }


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

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

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

LLVM IR (-O2):
define void @I2CM_ScbModeStop() {
%1 = tail call i32 (...) @I2CM_I2CStop()
ret void
}
double Wave_xx(double x) {
  return (12 * x * x - 2 + 12 * x - 40 * x * x * x) / 0.14;
}


x86 assembly (clang, -O0):
<Wave_xx>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wave_xx>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xeec(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
divsd  0xed8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Wave_xx(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.200000e+01, %3
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -2.000000e+00)
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double 1.200000e+01, double %7, double %6)
%9 = load double, double* %2
%10 = fmul double 4.000000e+01, %9
%11 = load double, double* %2
%12 = fmul double %10, %11
%13 = load double, double* %2
%14 = fneg double %12
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double %8)
%16 = fdiv double %15, 1.400000e-01
ret double %16
}

LLVM IR (-O2):
define double @Wave_xx(double %0) {
%2 = fmul double %0, 1.200000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -2.000000e+00)
%4 = tail call double @llvm.fmuladd.f64(double %0, double 1.200000e+01, double %3)
%5 = fmul double %0, -4.000000e+01
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %4)
%8 = fdiv double %7, 1.400000e-01
ret double %8
}
void local_strreverse(char *begin, char *end) {
  char aux;
  while (end > begin)
    aux = *end, *end-- = *begin, *begin++ = aux;
}


x86 assembly (clang, -O0):
<local_strreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <local_strreverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <local_strreverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_strreverse>:
cmp    %rdi,%rsi
jbe    112c <local_strreverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <local_strreverse+0x10>
ret

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

LLVM IR (-O2):
define void @local_strreverse(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void mystrcat(char *firstString, char *secondString) {
  while (*firstString)
    firstString++;
  while (*secondString) {
    *firstString = *secondString;
    secondString++;
    firstString++;
  }
  *firstString = '\0';
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <mystrcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcat+0xc>
jmp    112f <mystrcat+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <mystrcat+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <mystrcat+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <mystrcat>
mov    (%rsi),%al
test   %al,%al
je     1136 <mystrcat+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <mystrcat+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define void @mystrcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = phi i8* [ %16, %11 ], [ %4, %8 ]
store i8 %12, i8* %14
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
sigset_t get_sigset() {
  sigset_t set;
  sigemptyset(&set);
  sigaddset(&set, SIGINT);
  sigaddset(&set, SIGUSR1);
  return set;
}


x86 assembly (clang, -O0):
<get_sigset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1040 <sigaddset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1040 <sigaddset@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sigset>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <sigaddset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <sigaddset@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
define i32 @get_sigset() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGINT
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIGUSR1
%6 = call i32 @sigaddset(i32* %1, i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
define i32 @get_sigset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGINT
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}