xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_file(FILE *fp) {
  if (fp == NULL) {
    fprintf(stderr, "Can't open file\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_file+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file>:
test   %rdi,%rdi
je     1126 <check_file+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Can't open file\0A\00"
define void @check_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Can't open file\0A\00"
define void @check_file(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fancy_printing(char *);
int main(void) {
  fancy_printing("Hello old classic world\n");
  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 <fancy_printing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"Hello old classic world\0A\00"
define i32 @main() {
%1 = tail call i32 @fancy_printing(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int poll_one(int, int /*<<< orphan*/, int);
int recv_wait(int fd, int timeout_ms) {
  return poll_one(fd, POLLIN, timeout_ms);
}


x86 assembly (clang, -O0):
<recv_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <poll_one@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_wait>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <poll_one@plt>

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

LLVM IR (-O2):
@POLLIN = global i32 0
define i32 @recv_wait(i32 %0, i32 %1) {
%3 = load i32, i32* @POLLIN
%4 = tail call i32 @poll_one(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
void X509_REQ_get_extension_nids(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_get_extension_nids() {
ret void
}
void ast_unregister_file_version(const char *file) {}


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

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

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

LLVM IR (-O2):
define void @ast_unregister_file_version(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ supprimerSuite(char);
void supprimeCaractere(char *ligne, char caractere) {
  char *saut = strchr(ligne, caractere);
  if (saut)
    *saut = 0;
  else
    supprimerSuite(caractere);
}


x86 assembly (clang, -O0):
<supprimeCaractere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115a <supprimeCaractere+0x3a>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1163 <supprimeCaractere+0x43>
movsbl -0x9(%rbp),%edi
call   1040 <supprimerSuite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supprimeCaractere>:
push   %rbx
mov    %esi,%ebx
call   1030 <strchr@plt>
test   %rax,%rax
je     1132 <supprimeCaractere+0x12>
movb   $0x0,(%rax)
pop    %rbx
ret
movsbl %bl,%edi
pop    %rbx
jmp    1040 <supprimerSuite@plt>

LLVM IR (-O0):
define void @supprimeCaractere(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @strchr(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
store i8 0, i8* %12
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = call i32 @supprimerSuite(i8 signext %14)
br label %16
16: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
define void @supprimeCaractere(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = tail call i32 @supprimerSuite(i8 signext %1)
br label %8
8: ; preds = %6, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_syntax(void) {
  printf("Usage: blzpack [options] <infile> <outfile>\n"
         "\n"
         "Options:\n"
         "  -d, --decompress  Decompress\n"
         "  -c, --checksum    Use checksums if present\n"
         "  -h, --help        Print this help and exit\n"
         "  -v, --version     Print version and exit\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [220 x i8] c"Usage: blzpack [options] <infile> <outfile>\0A\0AOptions:\0A -d, --decompress Decompress\0A -c, --checksum Use checksums if present\0A -h, --help Print this help and exit\0A -v, --version Print version and exit\0A\0A\00"
define void @print_syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [219 x i8] c"Usage: blzpack [options] <infile> <outfile>\0A\0AOptions:\0A -d, --decompress Decompress\0A -c, --checksum Use checksums if present\0A -h, --help Print this help and exit\0A -v, --version Print version and exit\0A\00"
define void @print_syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([219 x i8], [219 x i8]* @str, i64 0, i64 0))
ret void
}
void tftpgetusage(s) char *s;
{
  printf("usage: %s host:file host:file ... file, or\n", s);
  printf("       %s file file ... file if connected\n", s);
}


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

x86 assembly (clang, -O2):
<tftpgetusage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"usage: %s host:file host:file ... file, or\0A\00"
@.str.1 = [43 x i8] c" %s file file ... file if connected\0A\00"
define void @tftpgetusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"usage: %s host:file host:file ... file, or\0A\00"
@.str.1 = [43 x i8] c" %s file file ... file if connected\0A\00"
define void @tftpgetusage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int get_codon_idx(char *s, int idx[]) {
  return ((25 * idx[*s]) + (5 * idx[*(s + 1)]) + idx[*(s + 2)]);
}


x86 assembly (clang, -O0):
<get_codon_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
imul   $0x19,(%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
movsbq 0x1(%rdx),%rdx
imul   $0x5,(%rcx,%rdx,4),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
movsbq 0x2(%rdx),%rdx
add    (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_codon_idx>:
movsbq (%rdi),%rax
mov    (%rsi,%rax,4),%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%ecx
movsbq 0x1(%rdi),%rax
mov    (%rsi,%rax,4),%eax
lea    (%rax,%rax,4),%eax
add    %ecx,%eax
movsbq 0x2(%rdi),%rcx
add    (%rsi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @get_codon_idx(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 = load i8, i8* %6
%8 = sext i8 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = mul nsw i32 25, %10
%12 = load i32*, i32** %4
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i64
%17 = getelementptr inbounds i32, i32* %12, i64 %16
%18 = load i32, i32* %17
%19 = mul nsw i32 5, %18
%20 = add nsw i32 %11, %19
%21 = load i32*, i32** %4
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i64
%26 = getelementptr inbounds i32, i32* %21, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %20, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_codon_idx(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 25
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 5
%14 = add nsw i32 %13, %7
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i64
%18 = getelementptr inbounds i32, i32* %1, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %14, %19
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ ror8addr(int /*<<< orphan*/);
int /*<<< orphan*/ zeropagex();
void rorZpx8(void) { ror8addr(zeropagex()); }


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

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

LLVM IR (-O0):
define void @rorZpx8() {
%1 = call i32 (...) @zeropagex()
%2 = call i32 @ror8addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rorZpx8() {
%1 = tail call i32 (...) @zeropagex()
%2 = tail call i32 @ror8addr(i32 %1)
ret void
}
__attribute__((always_)) int is_mem_section_removable(unsigned long pfn,
                                                      unsigned long nr_pages) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @is_mem_section_removable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @is_mem_section_removable(i64 %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int input;
  do {
    scanf("%d", &input);
    if (input != 42) {
      printf("%d\n", input);
    }
  } while (input != 42);
  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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x14(%rbp)
je     115f <main+0x3f>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x44>
cmpl   $0x2a,-0x14(%rbp)
jne    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xec7(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     1163 <main+0x43>
mov    %r15,%rdi
call   1030 <printf@plt>
cmpl   $0x2a,0xc(%rsp)
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
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
br label %7
7: ; preds = %15, %2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 42
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 42
br i1 %17, label %7, label %18
18: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %9, %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 42
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 42
br i1 %12, label %13, label %5
13: ; preds = %5, %9
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int cha_getopt(char **, char *, int /*<<< orphan*/ *);
int cha_getopt_chasen(char **argv, FILE *fp) {
  return cha_getopt(argv, "i:sP:D:RabmpdvfecMo:F:L:l:jr:w:O:ChV", fp);
}


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

x86 assembly (clang, -O2):
<cha_getopt_chasen>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <cha_getopt@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"i:sP:D:RabmpdvfecMo:F:L:l:jr:w:O:ChV\00"
define i32 @cha_getopt_chasen(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 @cha_getopt(i8** %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [37 x i8] c"i:sP:D:RabmpdvfecMo:F:L:l:jr:w:O:ChV\00"
define i32 @cha_getopt_chasen(i8** %0, i32* %1) {
%3 = tail call i32 @cha_getopt(i8** %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 %3
}
/* Variables and functions */
long round(long double value) {
  long intpart;
  intpart = value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpll -0x28(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fsubrp %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb6(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1167 <round+0x67>
jmp    115b <round+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
fldt   0x8(%rsp)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fld    %st(0)
fistpll -0x10(%rsp)
fldcw  -0x14(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
fsubrp %st,%st(1)
flds   0xec5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @round(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i64
store i64 %5, i64* %3
%6 = load x86_fp80, x86_fp80* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to x86_fp80
%9 = fsub x86_fp80 %6, %8
store x86_fp80 %9, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %2
%11 = fcmp oge x86_fp80 %10, 0xK3FFE8000000000000000
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @round(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp oge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
unsigned int dk_bb_get_unused_bits_num(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @dk_bb_get_unused_bits_num() {
ret i32 7
}

LLVM IR (-O2):
define i32 @dk_bb_get_unused_bits_num() {
ret i32 7
}
int my_method() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @my_method() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void sysex_auth(char a, char b) { printf("sysex_auth %d %d\n", a, b); }


x86 assembly (clang, -O0):
<sysex_auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysex_auth>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"sysex_auth %d %d\0A\00"
define void @sysex_auth(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
void *fz_malloc_array_no_throw(void *, unsigned int, unsigned int);
void *zalloc(void *opaque, unsigned int items, unsigned int size) {
  return fz_malloc_array_no_throw(opaque, items, size);
}


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

x86 assembly (clang, -O2):
<zalloc>:
jmp    1030 <fz_malloc_array_no_throw@plt>

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

LLVM IR (-O2):
define i8* @zalloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @fz_malloc_array_no_throw(i8* %0, i32 %1, i32 %2)
ret i8* %4
}
void enable_term_resizing() {}


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

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

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

LLVM IR (-O2):
define void @enable_term_resizing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void mcparmerror_int(char *parm, char *val) {
  fprintf(
      stderr,
      "Error: Invalid value '%s' for integer parameter %s (mcparmerror_int)\n",
      val, parm);
}


x86 assembly (clang, -O0):
<mcparmerror_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcparmerror_int>:
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Error: Invalid value '%s' for integer parameter %s (mcparmerror_int)\0A\00"
define void @mcparmerror_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Error: Invalid value '%s' for integer parameter %s (mcparmerror_int)\0A\00"
define void @mcparmerror_int(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
int ttime() {}


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

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

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

LLVM IR (-O2):
define i32 @ttime() {
ret i32 undef
}
/* Variables and functions */
char *dtostrf_p(double, int, int, char *, char);
char *dtostrf(double floatVar, int minStringWidthIncDecimalPoint,
              int numDigitsAfterDecimal, char *outputBuffer) {
  return dtostrf_p(floatVar, minStringWidthIncDecimalPoint,
                   numDigitsAfterDecimal, outputBuffer, ' ');
}


x86 assembly (clang, -O0):
<dtostrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x20,%ecx
call   1030 <dtostrf_p@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtostrf>:
mov    $0x20,%ecx
jmp    1030 <dtostrf_p@plt>

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

LLVM IR (-O2):
define i8* @dtostrf(double %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i8* @dtostrf_p(double %0, i32 %1, i32 %2, i8* %3, i8 signext 32)
ret i8* %5
}
unsigned int parity(unsigned int n) {
  unsigned int parity = 0;
  while (n) {
    parity = !parity;
    n = n & (n - 1);
  }
  return parity;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <parity+0x3c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <parity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
xor    %eax,%eax
test   %edi,%edi
je     111c <parity+0x1c>
cs nopw 0x0(%rax,%rax,1)
xor    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <parity+0x10>
ret

LLVM IR (-O0):
define i32 @parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = sub i32 %13, 1
%15 = and i32 %12, %14
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = xor i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ get_memory_size();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  uint64_t total_memory = get_memory_size();
  printf("Total physical memory: %lu\n", total_memory);
  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    $0x0,%al
call   1040 <get_memory_size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"Total physical memory: %lu\0A\00"
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 (...) @get_memory_size()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Total physical memory: %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_memory_size()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *ri_mem_alloc(size_t byte) {
  void *p;
  assert(byte != 0);
  p = malloc(byte);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<ri_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ri_mem_alloc>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ri_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %2
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @ri_mem_alloc(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i8* %5
}
/* Variables and functions */
int GCD(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", GCD(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <GCD@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <GCD@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @GCD(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writenl();
int /*<<< orphan*/ writes(char const *);
void writesn(const char *s) {
  writes(s);
  writenl();
}


x86 assembly (clang, -O0):
<writesn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <writes@plt>
mov    $0x0,%al
call   1040 <writenl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writesn>:
push   %rax
call   1030 <writes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <writenl@plt>

LLVM IR (-O0):
define void @writesn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @writes(i8* %3)
%5 = call i32 (...) @writenl()
ret void
}

LLVM IR (-O2):
define void @writesn(i8* %0) {
%2 = tail call i32 @writes(i8* %0)
%3 = tail call i32 (...) @writenl()
ret void
}
int addOK(int x, int y) {
  int sum = x + y;
  int a = x >> 31;
  return !!(a ^ y >> 31) | !(a ^ sum >> 31);
}


x86 assembly (clang, -O0):
<addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
sar    $0x1f,%edx
xor    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOK>:
lea    (%rsi,%rdi,1),%eax
sar    $0x1f,%edi
sar    $0x1f,%esi
cmp    %esi,%edi
setne  %cl
sar    $0x1f,%eax
cmp    %eax,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = ashr i32 %13, 31
%15 = xor i32 %12, %14
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = ashr i32 %21, 31
%23 = xor i32 %20, %22
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
%27 = or i32 %19, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @addOK(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %0, 31
%5 = ashr i32 %1, 31
%6 = icmp ne i32 %4, %5
%7 = ashr i32 %3, 31
%8 = icmp eq i32 %4, %7
%9 = or i1 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
size_t get_bits_of_int_v1(void) {
  int zen_of_life[] = {42, 0};
  return ((void *)(zen_of_life + 1) - (void *)zen_of_life) * 8;
}


x86 assembly (clang, -O0):
<get_bits_of_int_v1>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
add    $0x4,%rax
lea    -0x8(%rbp),%rcx
sub    %rcx,%rax
shl    $0x3,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.get_bits_of_int_v1.zen_of_life = [2 x i32] [i32 42, i32 0]
define i64 @get_bits_of_int_v1() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%7 = bitcast i32* %6 to i8*
%8 = ptrtoint i8* %5 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = mul nsw i64 %10, 8
ret i64 %11
}

LLVM IR (-O2):
define i64 @get_bits_of_int_v1() {
ret i64 32
}
double calcFP(double Pressure) {
  double Pstd = 29.53;
  double FP = 0;
  FP = (Pressure - Pstd) / (Pstd);
  return FP;
}


x86 assembly (clang, -O0):
<calcFP>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcFP>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcFP(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 2.953000e+01, double* %3
store double 0.000000e+00, double* %4
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = load double, double* %3
%9 = fdiv double %7, %8
store double %9, double* %4
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
define double @calcFP(double %0) {
%2 = fadd double %0, -2.953000e+01
%3 = fdiv double %2, 2.953000e+01
ret double %3
}
/* Variables and functions */
char **write_in_memory(char *, int, int);
char **ft_split_whitespaces(char *str) {
  char **result;
  int from;
  int to;
  from = 0;
  to = 0;
  result = write_in_memory(str, to, from);
  return (result);
}


x86 assembly (clang, -O0):
<ft_split_whitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <write_in_memory@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_split_whitespaces>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <write_in_memory@plt>

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

LLVM IR (-O2):
define i8** @ft_split_whitespaces(i8* %0) {
%2 = tail call i8** @write_in_memory(i8* %0, i32 0, i32 0)
ret i8** %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ logTo(int /*<<< orphan*/ *);
int /*<<< orphan*/ setLogThreshold(int);
void initLogging(int logLevel, FILE *logFile) {
  setLogThreshold(logLevel);
  logTo(logFile);
}


x86 assembly (clang, -O0):
<initLogging>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <setLogThreshold@plt>
mov    -0x10(%rbp),%rdi
call   1040 <logTo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initLogging>:
push   %rbx
mov    %rsi,%rbx
call   1030 <setLogThreshold@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <logTo@plt>

LLVM IR (-O0):
define void @initLogging(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 = call i32 @setLogThreshold(i32 %5)
%7 = load i32*, i32** %4
%8 = call i32 @logTo(i32* %7)
ret void
}

LLVM IR (-O2):
define void @initLogging(i32 %0, i32* %1) {
%3 = tail call i32 @setLogThreshold(i32 %0)
%4 = tail call i32 @logTo(i32* %1)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t rc_nanos_since_boot() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ((uint64_t)ts.tv_sec * 1000000000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<rc_nanos_since_boot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_nanos_since_boot>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @rc_nanos_since_boot() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @rc_nanos_since_boot() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ManualControlCommandHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void ManualControlCommandUpdated() {
  UAVObjUpdated(ManualControlCommandHandle());
}


x86 assembly (clang, -O0):
<ManualControlCommandUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ManualControlCommandHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ManualControlCommandUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <ManualControlCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @ManualControlCommandUpdated() {
%1 = call i32 (...) @ManualControlCommandHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ManualControlCommandUpdated() {
%1 = tail call i32 (...) @ManualControlCommandHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int speed_mod_to_gb(int s) { return (s * 60) / 50; }


x86 assembly (clang, -O0):
<speed_mod_to_gb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<speed_mod_to_gb>:
imul   $0x3c,%edi,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @speed_mod_to_gb(i32 %0) {
%2 = mul nsw i32 %0, 60
%3 = sdiv i32 %2, 50
ret i32 %3
}
/* Variables and functions */
void *default_alloc(void *, size_t const, char const *, unsigned int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
void *default_calloc(void *data, size_t nbelmts, size_t size,
                     const char *filename, unsigned int fileline) {
  void *mem = NULL;
  const size_t alloc_size = nbelmts * size;
  mem = default_alloc(data, alloc_size, filename, fileline);
  if (mem)
    memset(mem, 0, alloc_size);
  return mem;
}


x86 assembly (clang, -O0):
<default_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <default_alloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1183 <default_calloc+0x63>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdx,%rbx
mov    %rbx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1030 <default_alloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114e <default_calloc+0x2e>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @default_calloc(i8* %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = mul i64 %2, %1
%7 = tail call i8* @default_alloc(i8* %0, i64 %6, i8* %3, i32 %4)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @memset(i8* %7, i32 0, i64 %6)
br label %11
11: ; preds = %9, %5
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctrl_a(void) { printf("Hey, you pressed CTRL a! \n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hey, you pressed CTRL a! \0A\00"
define void @ctrl_a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Hey, you pressed CTRL a! \00"
define void @ctrl_a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double drand48();
double f0() { return drand48(); }


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

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

LLVM IR (-O0):
define double @f0() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @f0() {
%1 = tail call double (...) @drand48()
ret double %1
}