xunge/DecIR huggingface dataset:
/* Variables and functions */
void *kmap_local_page(int /*<<< orphan*/);
int /*<<< orphan*/ pfn_to_page(unsigned long);
void *kmap_local_pfn(unsigned long pfn) {
  return kmap_local_page(pfn_to_page(pfn));
}


x86 assembly (clang, -O0):
<kmap_local_pfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pfn_to_page@plt>
mov    %eax,%edi
call   1030 <kmap_local_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmap_local_pfn>:
push   %rax
call   1040 <pfn_to_page@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <kmap_local_page@plt>

LLVM IR (-O0):
define i8* @kmap_local_pfn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @pfn_to_page(i64 %3)
%5 = call i8* @kmap_local_page(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @kmap_local_pfn(i64 %0) {
%2 = tail call i32 @pfn_to_page(i64 %0)
%3 = tail call i8* @kmap_local_page(i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u32x3_jenkins2v_u64(int /*<<< orphan*/, uintptr_t,
                                            int /*<<< orphan*/ *);
void rgph_u32x3_jenkins2v_f64(double value, uintptr_t seed, uint32_t *h) {
  rgph_u32x3_jenkins2v_u64(rgph_d2u64(value), seed, h);
}


x86 assembly (clang, -O0):
<rgph_u32x3_jenkins2v_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <rgph_u32x3_jenkins2v_u64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x3_jenkins2v_f64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rgph_u32x3_jenkins2v_u64@plt>

LLVM IR (-O0):
define void @rgph_u32x3_jenkins2v_f64(double %0, i64 %1, i32* %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca i32*
store double %0, double* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load double, double* %4
%8 = call i32 @rgph_d2u64(double %7)
%9 = load i64, i64* %5
%10 = load i32*, i32** %6
%11 = call i32 @rgph_u32x3_jenkins2v_u64(i32 %8, i64 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @rgph_u32x3_jenkins2v_f64(double %0, i64 %1, i32* %2) {
%4 = tail call i32 @rgph_d2u64(double %0)
%5 = tail call i32 @rgph_u32x3_jenkins2v_u64(i32 %4, i64 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
long O_NONBLOCK;
long fcntl(int, int /*<<< orphan*/, long);
void set_sock_nonblocking_mode(int sock) {
  long arg = fcntl(sock, F_GETFL, NULL);
  arg |= O_NONBLOCK;
  fcntl(sock, F_SETFL, arg);
}


x86 assembly (clang, -O0):
<set_sock_nonblocking_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <fcntl@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_nonblocking_mode>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @set_sock_nonblocking_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i64 @fcntl(i32 %4, i32 %5, i64 0)
store i64 %6, i64* %3
%7 = load i64, i64* @O_NONBLOCK
%8 = load i64, i64* %3
%9 = or i64 %8, %7
store i64 %9, i64* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i64, i64* %3
%13 = call i64 @fcntl(i32 %10, i32 %11, i64 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @set_sock_nonblocking_mode(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 @fcntl(i32 %0, i32 %2, i64 0)
%4 = load i64, i64* @O_NONBLOCK
%5 = or i64 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i64 @fcntl(i32 %0, i32 %6, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void c_intface__(int *i) { fprintf(stdout, "Df77IsF2C\n"); }


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

x86 assembly (clang, -O2):
<c_intface__>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [11 x i8] c"Df77IsF2C\0A\00"
define void @c_intface__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"Df77IsF2C\0A\00"
define void @c_intface__(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void gs_error(char *msg) {
  fprintf(stderr, "libgstats: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<gs_error>:
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    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"libgstats: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @gs_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"libgstats: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @gs_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ color_parse_mem(char const *, int /*<<< orphan*/,
                                   char const *, char *);
int /*<<< orphan*/ strlen(char const *);
void color_parse(const char *value, const char *var, char *dst) {
  color_parse_mem(value, strlen(value), var, dst);
}


x86 assembly (clang, -O0):
<color_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <color_parse_mem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_parse>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <color_parse_mem@plt>

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

LLVM IR (-O2):
define void @color_parse(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @color_parse_mem(i8* %0, i32 %4, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test();
main() { test(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 0
}
void yy_3_InlineContentChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_3_InlineContentChoice(i8* nocapture %0, i32 %1) {
ret void
}
unsigned int alarm(unsigned int seconds) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @alarm(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int copy_desc_to_desc(int, int);
int open(char *, int /*<<< orphan*/);
int copy_file_to_desc(char *path, int out_fd) {
  int in_fd = open(path, O_RDONLY);
  if (in_fd == -1)
    return -1;
  return copy_desc_to_desc(in_fd, out_fd);
}


x86 assembly (clang, -O0):
<copy_file_to_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    115a <copy_file_to_desc+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <copy_file_to_desc+0x48>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <copy_desc_to_desc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file_to_desc>:
push   %rbx
mov    %esi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     1140 <copy_file_to_desc+0x20>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <copy_desc_to_desc@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @copy_file_to_desc(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* @O_RDONLY
%9 = call i32 @open(i8* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = call i32 @copy_desc_to_desc(i32 %14, i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @copy_file_to_desc(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @copy_desc_to_desc(i32 %4, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putstr2(char *);
void error_write(int writethis) {
  if (writethis == -1) {
    my_putstr2("\nError : Your write doesn't work and return -1 ");
    my_putstr2("This is why the program have stopped of himself\n\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<error_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1157 <error_write+0x37>
lea    0xec4(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xee8(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_write>:
cmp    $0xffffffff,%edi
je     1126 <error_write+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xef6(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"\0AError : Your write doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @my_putstr2(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"\0AError : Your write doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_write(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_faces_fromfile(int /*<<< orphan*/, long);
void fgmvwrite_faces_fromfile_(char filnam[], long nfaces) {
  gmvwrite_faces_fromfile(fortchartoc(filnam), nfaces);
}


x86 assembly (clang, -O0):
<fgmvwrite_faces_fromfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <gmvwrite_faces_fromfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_faces_fromfile_>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <gmvwrite_faces_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_faces_fromfile_(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @fortchartoc(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @gmvwrite_faces_fromfile(i32 %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_faces_fromfile_(i8* %0, i64 %1) {
%3 = tail call i32 @fortchartoc(i8* %0)
%4 = tail call i32 @gmvwrite_faces_fromfile(i32 %3, i64 %1)
ret void
}
int width(int nesting) { return nesting * (2); }


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

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

LLVM IR (-O0):
define i32 @width(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 @width(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
unsigned char pullout_bit(unsigned char *key, int digit) {
  unsigned char mask, result;
  mask = 1 << (digit - 1);
  result = *key & mask;
  if (result > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pullout_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x15(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x16(%rbp)
movzbl -0x16(%rbp),%eax
cmp    $0x0,%eax
jle    1141 <pullout_bit+0x41>
movb   $0x1,-0x1(%rbp)
jmp    1145 <pullout_bit+0x45>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pullout_bit>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
test   %al,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @pullout_bit(i8* %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %2
store i8 1, i8* %3
br label %24
23: ; preds = %2
store i8 0, i8* %3
br label %24
24: ; preds = %23, %22
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @pullout_bit(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = load i8, i8* %0
%6 = trunc i32 %4 to i8
%7 = and i8 %5, %6
%8 = icmp ne i8 %7, 0
%9 = zext i1 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void info(const char *info_msg) {
  printf("%s: %s\n", "[\033[32mINFO\033[0m]", info_msg);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [16 x i8] c"[\1B[32mINFO\1B[0m]\00"
define void @info(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double random();
double uniformVar(void) { return random() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<uniformVar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniformVar>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @uniformVar() {
%1 = call double (...) @random()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @uniformVar() {
%1 = tail call double (...) @random()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ hardening_trigger(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int lib_interface(void) {
  printf("Hello world!\n");
  hardening_trigger(NULL, 0, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<lib_interface>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1040 <hardening_trigger@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_interface>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <hardening_trigger@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @lib_interface() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @hardening_trigger(i32* null, i32 0, i32* null)
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @lib_interface() {
%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 @hardening_trigger(i32* null, i32 0, i32* null)
ret i32 0
}
/* Variables and functions */
double __ocml_fma_rtz_f64(double, double, double);
double __fma_rz(double x, double y, double z) {
  return __ocml_fma_rtz_f64(x, y, z);
}


x86 assembly (clang, -O0):
<__fma_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <__ocml_fma_rtz_f64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fma_rz>:
jmp    1030 <__ocml_fma_rtz_f64@plt>

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

LLVM IR (-O2):
define double @__fma_rz(double %0, double %1, double %2) {
%4 = tail call double @__ocml_fma_rtz_f64(double %0, double %1, double %2)
ret double %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int strtoul(char const *, char **, int);
int HexStringToUint8(const char *string, uint8_t *value) {
  char *end;
  uint32_t large_value = strtoul(string, &end, 16);
  if (*end != '\0' || large_value > 0xff) {
    return 1;
  }
  *value = large_value;
  return 0;
}


x86 assembly (clang, -O0):
<HexStringToUint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1152 <HexStringToUint8+0x42>
cmpl   $0xff,-0x24(%rbp)
jle    115e <HexStringToUint8+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    116e <HexStringToUint8+0x5e>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexStringToUint8>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %eax,%ecx
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
mov    $0x1,%eax
jne    1144 <HexStringToUint8+0x34>
cmp    $0xff,%ecx
jg     1144 <HexStringToUint8+0x34>
mov    %ecx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @HexStringToUint8(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtoul(i8* %0, i8** %3, i32 16)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp sgt i32 %5, 255
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 %5, i32* %1
br label %12
12: ; preds = %2, %11
%13 = phi i32 [ 0, %11 ], [ 1, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(char const *prg) {
  fprintf(stderr,
          "use: %s [-h]  [-p <unix socket>] [-s <shm obj>] "
          "[-m <size in MB>] [-n <# of MSI vectors>]\n",
          prg);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"use: %s [-h] [-p <unix socket>] [-s <shm obj>] [-m <size in MB>] [-n <# of MSI vectors>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"use: %s [-h] [-p <unix socket>] [-s <shm obj>] [-m <size in MB>] [-n <# of MSI vectors>]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void SPI_SD_TX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_SD_TX_ISR() {
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int __string_decode_array_cleanup(char **s, uint32_t elements) {
  uint32_t element;
  for (element = 0; element < elements; ++element)
    free(s[element]);
  return 0;
}


x86 assembly (clang, -O0):
<__string_decode_array_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <__string_decode_array_cleanup+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <__string_decode_array_cleanup+0x18>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__string_decode_array_cleanup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <__string_decode_array_cleanup+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <__string_decode_array_cleanup+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @__string_decode_array_cleanup(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @free(i8* %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
scalar_t__ ft_atoull(char const *);
unsigned long ft_atoul(const char *str) {
  return ((unsigned long)ft_atoull(str));
}


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

x86 assembly (clang, -O2):
<ft_atoul>:
jmp    1030 <ft_atoull@plt>

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

LLVM IR (-O2):
define i64 @ft_atoul(i8* %0) {
%2 = tail call i64 @ft_atoull(i8* %0)
ret i64 %2
}
const char *i960_output_ldconst(void) { return "foo"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @i960_output_ldconst() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void RTLogRelDefaultInstance(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Test2\00"
define void @B11() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double bar(double);
double foo();
int main(void) {
  double i, k;
  double j = 42.0;
  i = foo();
  k = bar(j);
  return 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <bar@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2a,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
movsd  0xed0(%rip),%xmm0
call   1030 <bar@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 4.200000e+01, double* %4
%5 = call double (...) @foo()
store double %5, double* %2
%6 = load double, double* %4
%7 = call double @bar(double %6)
store double %7, double* %3
ret i32 42
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @foo()
%2 = tail call double @bar(double 4.200000e+01)
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ close_interface();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void int_handler(int signum) {
  close_interface();
  exit(0);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <close_interface@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
xor    %eax,%eax
call   1030 <close_interface@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @close_interface()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @int_handler(i32 %0) {
%2 = tail call i32 (...) @close_interface()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct ll {
  int dummy;
};

/* Variables and functions */
struct ll *ll_del(struct ll *);
struct ll *ll_burn(struct ll *head) {
  if (head)
    return (ll_burn(ll_del(head)));
  return (head);
}


x86 assembly (clang, -O0):
<ll_burn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <ll_burn+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <ll_del@plt>
mov    %rax,%rdi
call   1040 <ll_burn@plt>
mov    %rax,-0x8(%rbp)
jmp    1159 <ll_burn+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_burn>:
push   %rax
test   %rdi,%rdi
je     112d <ll_burn+0x1d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <ll_del@plt>
test   %rax,%rax
jne    1120 <ll_burn+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ll = type { i32 }
define %struct.ll* @ll_burn(%struct.ll* %0) {
%2 = alloca %struct.ll*
%3 = alloca %struct.ll*
store %struct.ll* %0, %struct.ll** %3
%4 = load %struct.ll*, %struct.ll** %3
%5 = icmp ne %struct.ll* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.ll*, %struct.ll** %3
%8 = call %struct.ll* @ll_del(%struct.ll* %7)
%9 = call %struct.ll* @ll_burn(%struct.ll* %8)
store %struct.ll* %9, %struct.ll** %2
br label %12
10: ; preds = %1
%11 = load %struct.ll*, %struct.ll** %3
store %struct.ll* %11, %struct.ll** %2
br label %12
12: ; preds = %10, %6
%13 = load %struct.ll*, %struct.ll** %2
ret %struct.ll* %13
}

LLVM IR (-O2):
%struct.ll = type { i32 }
define noalias %struct.ll* @ll_burn(%struct.ll* %0) {
%2 = icmp eq %struct.ll* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.ll* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.ll* @ll_del(%struct.ll* %4)
%6 = icmp eq %struct.ll* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret %struct.ll* null
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    write(1, &s[i], 1);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <ft_putstr+0x4d>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 1)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ liba_func();
int main(void) {
  liba_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @liba_func()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int component_type_new(void) {
  static uint32_t componentype = 1;
  return componentype++;
}


x86 assembly (clang, -O0):
<component_type_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_type_new>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@component_type_new.componentype = internal global i32 1
define i32 @component_type_new() {
%1 = load i32, i32* @component_type_new.componentype
%2 = add nsw i32 %1, 1
store i32 %2, i32* @component_type_new.componentype
ret i32 %1
}

LLVM IR (-O2):
@component_type_new.componentype = internal unnamed_addr global i32 1
define i32 @component_type_new() {
%1 = load i32, i32* @component_type_new.componentype
%2 = add nsw i32 %1, 1
store i32 %2, i32* @component_type_new.componentype
ret i32 %1
}
void code() {}


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

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

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

LLVM IR (-O2):
define void @code() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int);
void reset_cntl(int data) { to_gps(0x7f, data); }


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

x86 assembly (clang, -O2):
<reset_cntl>:
mov    %edi,%esi
mov    $0x7f,%edi
jmp    1030 <to_gps@plt>

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

LLVM IR (-O2):
define void @reset_cntl(i32 %0) {
%2 = tail call i32 @to_gps(i32 127, i32 %0)
ret void
}
/* Variables and functions */
int tanh(double);
double langevin_function(double x) { return 1. / tanh(x) - 1. / x; }


x86 assembly (clang, -O0):
<langevin_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<langevin_function>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
call   1030 <tanh@plt>
cvtsi2sd %eax,%xmm1
unpcklpd (%rsp),%xmm1
movapd 0xed2(%rip),%xmm0
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @langevin_function(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @tanh(double %3)
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
%7 = load double, double* %2
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @langevin_function(double %0) {
%2 = tail call i32 @tanh(double %0)
%3 = sitofp i32 %2 to double
%4 = insertelement <2 x double> poison, double %0, i64 1
%5 = insertelement <2 x double> %4, double %3, i64 0
%6 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %5
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%8 = fsub <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __checkint_uint64_mul_signed_unsigned(int /*<<< orphan*/,
                                                         int /*<<< orphan*/,
                                                         int /*<<< orphan*/ *);
__attribute__((always_)) uint64_t
__checkint_uint64_mul_unsigned_signed(uint64_t x, int64_t y, int32_t *err) {
  return __checkint_uint64_mul_signed_unsigned(y, x, err);
}


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

x86 assembly (clang, -O2):
<__checkint_uint64_mul_unsigned_signed>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <__checkint_uint64_mul_signed_unsigned@plt>

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

LLVM IR (-O2):
define i32 @__checkint_uint64_mul_unsigned_signed(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @__checkint_uint64_mul_signed_unsigned(i32 %1, i32 %0, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_event_connection_complete_get_connection_handle(const uint8_t *event) {
  return little_endian_read_16(event, 3);
}


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

x86 assembly (clang, -O2):
<hci_event_connection_complete_get_connection_handle>:
mov    $0x3,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_connection_complete_get_connection_handle(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int get(unsigned char, int);
int bitmapGet(unsigned char *bitmap, int pos) {
  return get(bitmap[pos / (8 * sizeof(unsigned char))],
             pos % (8 * sizeof(unsigned char)));
}


x86 assembly (clang, -O0):
<bitmapGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x3,%rcx
mov    (%rax,%rcx,1),%al
movslq -0xc(%rbp),%rcx
and    $0x7,%rcx
mov    %ecx,%esi
movzbl %al,%edi
call   1030 <get@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapGet>:
movslq %esi,%rsi
mov    %rsi,%rax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%edi
and    $0x7,%esi
jmp    1030 <get@plt>

LLVM IR (-O0):
define i32 @bitmapGet(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 = sext i32 %6 to i64
%8 = udiv i64 %7, 8
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 8
%14 = trunc i64 %13 to i32
%15 = call i32 @get(i8 zeroext %10, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitmapGet(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %1, 7
%8 = tail call i32 @get(i8 zeroext %6, i32 %7)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rotate(int /*<<< orphan*/, int);
void inv_shift_rows(uint8_t data[]) {
  *(uint32_t *)&data[(4)] = rotate(*(uint32_t *)&data[(4)], 24);
  *(uint32_t *)&data[(8)] = rotate(*(uint32_t *)&data[(8)], 16);
  *(uint32_t *)&data[(12)] = rotate(*(uint32_t *)&data[(12)], 8);
}


x86 assembly (clang, -O0):
<inv_shift_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
mov    $0x18,%esi
call   1030 <rotate@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edi
mov    $0x10,%esi
call   1030 <rotate@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%edi
mov    $0x8,%esi
call   1030 <rotate@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_shift_rows>:
push   %rbx
mov    %rdi,%rbx
mov    0x10(%rdi),%edi
mov    $0x18,%esi
call   1030 <rotate@plt>
mov    %eax,0x10(%rbx)
mov    0x20(%rbx),%edi
mov    $0x10,%esi
call   1030 <rotate@plt>
mov    %eax,0x20(%rbx)
mov    0x30(%rbx),%edi
mov    $0x8,%esi
call   1030 <rotate@plt>
mov    %eax,0x30(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @inv_shift_rows(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = call i32 @rotate(i32 %5, i32 24)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32 %6, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i32, i32* %10
%12 = call i32 @rotate(i32 %11, i32 16)
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 8
store i32 %12, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 12
%17 = load i32, i32* %16
%18 = call i32 @rotate(i32 %17, i32 8)
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 12
store i32 %18, i32* %20
ret void
}

LLVM IR (-O2):
define void @inv_shift_rows(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = tail call i32 @rotate(i32 %3, i32 24)
store i32 %4, i32* %2
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = load i32, i32* %5
%7 = tail call i32 @rotate(i32 %6, i32 16)
store i32 %7, i32* %5
%8 = getelementptr inbounds i32, i32* %0, i64 12
%9 = load i32, i32* %8
%10 = tail call i32 @rotate(i32 %9, i32 8)
store i32 %10, i32* %8
ret void
}