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

/* Variables and functions */
int unlink(char const *);
int32_t mz_os_unlink(const char *path) {
  if (unlink(path) == -1)
    return (-107);
  return (0);
}


x86 assembly (clang, -O0):
<mz_os_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    113a <mz_os_unlink+0x2a>
movl   $0xffffff95,-0x4(%rbp)
jmp    1141 <mz_os_unlink+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_os_unlink>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
mov    $0xffffff95,%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mz_os_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = select i1 %3, i32 -107, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *mymalloc(size_t n) {
  void *p;
  if ((p = malloc(n))) {
    return p;
  } else {
    fprintf(stderr, "Virtual memory exhausted\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <mymalloc+0x2d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<mymalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <mymalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
ret i8* %8
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
int HelpItem147(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem147() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writemem65816(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ zeropagex();
void stzZpx8(void) { writemem65816(zeropagex(), 0); }


x86 assembly (clang, -O0):
<stzZpx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zeropagex@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <writemem65816@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stzZpx8>:
push   %rax
xor    %eax,%eax
call   1030 <zeropagex@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <writemem65816@plt>

LLVM IR (-O0):
define void @stzZpx8() {
%1 = call i32 (...) @zeropagex()
%2 = call i32 @writemem65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzZpx8() {
%1 = tail call i32 (...) @zeropagex()
%2 = tail call i32 @writemem65816(i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ GEN_DNS;
int set_altname(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
                int /*<<< orphan*/);
int set_altname_dns(X509 *crt, const char *name) {
  return set_altname(crt, GEN_DNS, name, 0);
}


x86 assembly (clang, -O0):
<set_altname_dns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <set_altname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_altname_dns>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <set_altname@plt>

LLVM IR (-O0):
@GEN_DNS = global i32 0
define i32 @set_altname_dns(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 i32, i32* @GEN_DNS
%7 = load i8*, i8** %4
%8 = call i32 @set_altname(i32* %5, i32 %6, i8* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@GEN_DNS = global i32 0
define i32 @set_altname_dns(i32* %0, i8* %1) {
%3 = load i32, i32* @GEN_DNS
%4 = tail call i32 @set_altname(i32* %0, i32 %3, i8* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void color_on(int attr, int fg) {
  char command[13];
  sprintf(command, "%c[%d;%dm", 0x1B, attr, fg + 30);
  printf("%s", command);
}


x86 assembly (clang, -O0):
<color_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x15(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
add    $0x1e,%r8d
lea    0xebc(%rip),%rsi
mov    $0x1b,%edx
call   1040 <sprintf@plt>
lea    -0x15(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_on>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0x1e(%rsi),%r8d
lea    0xece(%rip),%rsi
lea    0x3(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1b,%edx
call   1040 <sprintf@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @color_on(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [13 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 30
%10 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7, i32 %9)
%11 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%dm\00"
@.str.1 = [3 x i8] c"%s\00"
define void @color_on(i32 %0, i32 %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 30
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(void *, unsigned long, int, int /*<<< orphan*/ *);
int FileSave(char *filename, void *data, unsigned long size) {
  FILE *f = fopen(filename, "wt");
  if (f == NULL)
    return 0;
  fwrite(data, size, 1, f);
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<FileSave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116f <FileSave+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1195 <FileSave+0x65>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileSave>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1173 <FileSave+0x43>
mov    %rax,%rbx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    1175 <FileSave+0x45>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"wt\00"
define i32 @FileSave(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
struct ctrl_command {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_error(char *);
void cmd_set_crypt_out_key(struct ctrl_command *cmd) {
  send_error("can't set encryption key - no OpenSSL support!");
}


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

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

LLVM IR (-O0):
%struct.ctrl_command = type { i32 }
@.str = [47 x i8] c"can't set encryption key - no OpenSSL support!\00"
define void @cmd_set_crypt_out_key(%struct.ctrl_command* %0) {
%2 = alloca %struct.ctrl_command*
store %struct.ctrl_command* %0, %struct.ctrl_command** %2
%3 = call i32 @send_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ctrl_command = type { i32 }
@.str = [47 x i8] c"can't set encryption key - no OpenSSL support!\00"
define void @cmd_set_crypt_out_key(%struct.ctrl_command* nocapture readnone %0) {
%2 = tail call i32 @send_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int _close(int file) {
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EBADF
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = load i32, i32* @EBADF
store i32 %2, i32* @errno
ret i32 -1
}
void AO_nop_full(void) { ; }


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

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

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

LLVM IR (-O2):
define void @AO_nop_full() {
ret void
}
/* Variables and functions */
int LZ4_compress64kCtx(int /*<<< orphan*/ *, char const *, char *, int, int);
int LZ4_compressCtx(int /*<<< orphan*/ *, char const *, char *, int, int);
int LZ4_compress_limitedOutput(const char *source, char *dest, int isize,
                               int maxOutputSize) {
  if (isize < (int)((1 << 16) + ((8 + 4) - 1)))
    return LZ4_compress64kCtx(NULL, source, dest, isize, maxOutputSize);
  return LZ4_compressCtx(NULL, source, dest, isize, maxOutputSize);
}


x86 assembly (clang, -O0):
<LZ4_compress_limitedOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x1000b,-0x1c(%rbp)
jge    1163 <LZ4_compress_limitedOutput+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
call   1030 <LZ4_compress64kCtx@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <LZ4_compress_limitedOutput+0x5e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <LZ4_compressCtx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress_limitedOutput>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
cmp    $0x1000a,%ecx
jg     113a <LZ4_compress_limitedOutput+0x1a>
jmp    1030 <LZ4_compress64kCtx@plt>
jmp    1040 <LZ4_compressCtx@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compress_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, 65547
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @LZ4_compress64kCtx(i32* null, i8* %0, i8* %1, i32 %2, i32 %3)
br label %10
8: ; preds = %4
%9 = tail call i32 @LZ4_compressCtx(i32* null, i8* %0, i8* %1, i32 %2, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
void userfaultfd_remove(struct vm_area_struct *vma,
                        struct vm_area_struct **prev, unsigned long start,
                        unsigned long end) {}


x86 assembly (clang, -O0):
<userfaultfd_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @userfaultfd_remove(%struct.vm_area_struct* %0, %struct.vm_area_struct** %1, i64 %2, i64 %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca %struct.vm_area_struct**
%7 = alloca i64
%8 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store %struct.vm_area_struct** %1, %struct.vm_area_struct*** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @userfaultfd_remove(%struct.vm_area_struct* nocapture %0, %struct.vm_area_struct** nocapture %1, i64 %2, i64 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2qcr(int, float *, float *, float *);
void s2qcr_(int *idx, float *r, float *g, float *b) { s2qcr(*idx, r, g, b); }


x86 assembly (clang, -O0):
<s2qcr_>:
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
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <s2qcr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2qcr_>:
mov    (%rdi),%edi
jmp    1030 <s2qcr@plt>

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

LLVM IR (-O2):
define void @s2qcr_(i32* nocapture %0, float* %1, float* %2, float* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @s2qcr(i32 %5, float* %1, float* %2, float* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ SPI_Read(int);
int /*<<< orphan*/ SPI_Write(int, int);
void close(uint8_t sock) {
  if (sock != 0)
    return;
  SPI_Write(0x0401, 0x10);
  while (SPI_Read(0x0401))
    ;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <close+0x1c>
jmp    1164 <close+0x44>
mov    $0x401,%edi
mov    $0x10,%esi
call   1040 <SPI_Write@plt>
mov    $0x401,%edi
call   1030 <SPI_Read@plt>
cmp    $0x0,%rax
je     1164 <close+0x44>
jmp    114b <close+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
test   %rdi,%rdi
jne    114f <close+0x2f>
mov    $0x401,%edi
mov    $0x10,%esi
call   1040 <SPI_Write@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x401,%edi
call   1030 <SPI_Read@plt>
test   %rax,%rax
jne    1140 <close+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @close(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = call i32 @SPI_Write(i32 1025, i32 16)
br label %8
8: ; preds = %11, %6
%9 = call i64 @SPI_Read(i32 1025)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %5, %8
ret void
}

LLVM IR (-O2):
define void @close(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i32 @SPI_Write(i32 1025, i32 16)
br label %5
5: ; preds = %5, %3
%6 = tail call i64 @SPI_Read(i32 1025)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %5
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_B(int, int);
int CMP_HOST_REG_B(int dst_reg, int src_reg) {
  SUB_HOST_REG_B(dst_reg, src_reg);
  return dst_reg;
}


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

x86 assembly (clang, -O2):
<CMP_HOST_REG_B>:
push   %rbx
mov    %edi,%ebx
call   1030 <SUB_HOST_REG_B@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CMP_HOST_REG_B(i32 returned %0, i32 %1) {
%3 = tail call i32 @SUB_HOST_REG_B(i32 %0, i32 %1)
ret i32 %0
}
void hmd_ortho() {}


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

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

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

LLVM IR (-O2):
define void @hmd_ortho() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_init3(void) {
  printf("main_init3"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"main_init3\0A\00"
define void @main_init3() {
%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"main_init3\00"
define void @main_init3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int a(int n) { return n * 2; }


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

x86 assembly (clang, -O2):
<a>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
ret i32 %4
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void RGB24ToYRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB24ToYRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ test_fd();
int /*<<< orphan*/ test_fd_special();
int /*<<< orphan*/ test_fp();
int /*<<< orphan*/ test_socket();
int /*<<< orphan*/ unlink(char *);
int main() {
  test_fd();
  test_socket();
  test_fd_special();
  test_fp();
  sleep(1);
  unlink("file_out");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_fd@plt>
mov    $0x0,%al
call   1080 <test_socket@plt>
mov    $0x0,%al
call   1040 <test_fd_special@plt>
mov    $0x0,%al
call   1050 <test_fp@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
lea    0xe64(%rip),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_fd@plt>
xor    %eax,%eax
call   1080 <test_socket@plt>
xor    %eax,%eax
call   1040 <test_fd_special@plt>
xor    %eax,%eax
call   1050 <test_fp@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
lea    0xe72(%rip),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"file_out\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_fd()
%3 = call i32 (...) @test_socket()
%4 = call i32 (...) @test_fd_special()
%5 = call i32 (...) @test_fp()
%6 = call i32 @sleep(i32 1)
%7 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"file_out\00"
define i32 @main() {
%1 = tail call i32 (...) @test_fd()
%2 = tail call i32 (...) @test_socket()
%3 = tail call i32 (...) @test_fd_special()
%4 = tail call i32 (...) @test_fp()
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ rotate_x(int);
int remote_move(int x, int y) {
  printf("remote move x=%d, y=%d\n", x, y);
  rotate_x(x);
}


x86 assembly (clang, -O0):
<remote_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <rotate_x@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_move>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ebx
lea    0xed4(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <rotate_x@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"remote move x=%d, y=%d\0A\00"
define i32 @remote_move(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 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @rotate_x(i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"remote move x=%d, y=%d\0A\00"
define i32 @remote_move(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @rotate_x(i32 %0)
ret i32 undef
}
int execv() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @execv() {
ret i32 -1
}
char *unquote(as)
register char *as;
{
  register char *s;
  if ((s = as) != 0)
    while (*s)
      *s++ &= ~0200;
  return (as);
}


x86 assembly (clang, -O0):
<unquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1150 <unquote+0x50>
jmp    111f <unquote+0x1f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <unquote+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%ecx
and    $0xffffff7f,%ecx
mov    %cl,(%rax)
jmp    111f <unquote+0x1f>
jmp    1150 <unquote+0x50>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unquote>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1131 <unquote+0x31>
mov    (%rax),%cl
test   %cl,%cl
je     1131 <unquote+0x31>
lea    0x1(%rax),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
and    $0x7f,%cl
mov    %cl,-0x1(%rdx)
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <unquote+0x20>
ret

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

LLVM IR (-O2):
define i8* @unquote(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = and i8 %7, 127
store i8 %10, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ xs2lpc(int, int);
void xs2lpc_(int *masterid, int *slaveid) { xs2lpc(*masterid, *slaveid); }


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

x86 assembly (clang, -O2):
<xs2lpc_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <xs2lpc@plt>

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

LLVM IR (-O2):
define void @xs2lpc_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @xs2lpc(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, World\n");
  printf("Good Morning");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
@.str.1 = [13 x i8] c"Good Morning\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"Good Morning\00"
@str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double atof(char *);
int numcmp(char *n1, char *n2) {
  double f1, f2;
  f1 = atof(n1);
  f2 = atof(n2);
  if (f1 < f2) {
    return -1;
  } else if (f1 > f2) {
    return 0;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <numcmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <numcmp+0x68>
movl   $0x0,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
seta   %al
neg    %eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Git world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello Git world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int func2(void) {
  func1();
  return 1;
}


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

x86 assembly (clang, -O2):
<func2>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func2() {
%1 = call i32 (...) @func1()
ret i32 1
}

LLVM IR (-O2):
define i32 @func2() {
%1 = tail call i32 (...) @func1()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ a_fetch_or(int volatile *, int);
void a_or(volatile int *p, int v) { a_fetch_or(p, v); }


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

x86 assembly (clang, -O2):
<a_or>:
jmp    1030 <a_fetch_or@plt>

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

LLVM IR (-O2):
define void @a_or(i32* %0, i32 %1) {
%3 = tail call i32 @a_fetch_or(i32* %0, i32 %1)
ret void
}
_Noreturn void __SIG_ERR(int sig) { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<__SIG_ERR>:
ud2

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

LLVM IR (-O2):
define void @__SIG_ERR(i32 %0) {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *argv0) {
  fprintf(stdout, "%s <obj filename>\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"%s <obj filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"%s <obj filename>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ shared_f();
int main(void) {
  shared_f();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <shared_f@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <shared_f@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @shared_f()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @shared_f()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", access("/tmp/catchWish", F_OK));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
call   1040 <access@plt>
mov    %eax,%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    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
call   1040 <access@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [15 x i8] c"/tmp/catchWish\00"
@F_OK = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @F_OK
%3 = call i32 @access(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [15 x i8] c"/tmp/catchWish\00"
@F_OK = global i32 0
define i32 @main() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int m) {
  int i;
  for (i = 0; i < m; i++)
    printf("-");
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbx
test   %edi,%edi
jle    112f <indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 45)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int config_close(FILE *fp) {
  fclose(fp);
  return 0;
}


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

x86 assembly (clang, -O2):
<config_close>:
push   %rax
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @config_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  printf("Hello\x21\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@.str.2 = [8 x i8] c"Hello!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
cmp(a, b) char *a, *b;
{
  register char *ra, *rb;
  ra = a - 1;
  rb = b - 1;
  while (*++ra == *++rb)
    if (*ra == '\0')
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl 0x1(%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jne    1173 <cmp+0x73>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116e <cmp+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    117a <cmp+0x7a>
jmp    1124 <cmp+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <cmp+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <cmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -1
%4 = getelementptr inbounds i8, i8* %1, i64 -1
br label %5
5: ; preds = %13, %2
%6 = phi i8* [ %3, %2 ], [ %8, %13 ]
%7 = phi i8* [ %4, %2 ], [ %10, %13 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = icmp eq i8 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %13
%16 = phi i32 [ 0, %13 ], [ 1, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void my_entry(const char *text) { printf("%s: 1\n", text); }


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

x86 assembly (clang, -O2):
<my_entry>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s: 1\0A\00"
define void @my_entry(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}