xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *,
                          char *);
void print_prog_hdr(void) {
  printf("%9s %-15s %8s %6s %-12s %-15s\n", "BID", "TYPE", "UID", "#MAPS",
         "LoadTime", "NAME");
}


x86 assembly (clang, -O0):
<print_prog_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xef9(%rip),%rsi
lea    0xef6(%rip),%rdx
lea    0xef4(%rip),%rcx
lea    0xef1(%rip),%r8
lea    0xef0(%rip),%r9
lea    0xef2(%rip),%rax
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prog_hdr>:
push   %rax
lea    0xf23(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef2(%rip),%rdx
lea    0xef0(%rip),%rcx
lea    0xeed(%rip),%r8
lea    0xeec(%rip),%r9
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%9s %-15s %8s %6s %-12s %-15s\0A\00"
@.str.1 = [4 x i8] c"BID\00"
@.str.2 = [5 x i8] c"TYPE\00"
@.str.3 = [4 x i8] c"UID\00"
@.str.4 = [6 x i8] c"#MAPS\00"
@.str.5 = [9 x i8] c"LoadTime\00"
@.str.6 = [5 x i8] c"NAME\00"
define void @print_prog_hdr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%9s %-15s %8s %6s %-12s %-15s\0A\00"
@.str.1 = [4 x i8] c"BID\00"
@.str.2 = [5 x i8] c"TYPE\00"
@.str.3 = [4 x i8] c"UID\00"
@.str.4 = [6 x i8] c"#MAPS\00"
@.str.5 = [9 x i8] c"LoadTime\00"
@.str.6 = [5 x i8] c"NAME\00"
define void @print_prog_hdr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ synchronize_page_table();
void page_table_sync() { synchronize_page_table(); }


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

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

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

LLVM IR (-O2):
define void @page_table_sync() {
%1 = tail call i32 (...) @synchronize_page_table()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc7(void) {
  printf("Executing exitfunc"
         "7"
         ".\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc7.\00"
define void @exitfunc7() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int recv(int, char *, size_t, int);
int xrecv(int s, void *buf, size_t len, int flags) {
  return recv(s, (char *)buf, len, flags) != (int)len;
}


x86 assembly (clang, -O0):
<xrecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
mov    -0x18(%rbp),%rcx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrecv>:
push   %rbx
mov    %rdx,%rbx
call   1030 <recv@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xrecv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @recv(i32 %9, i8* %10, i64 %11, i32 %12)
%14 = load i64, i64* %7
%15 = trunc i64 %14 to i32
%16 = icmp ne i32 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @xrecv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = trunc i64 %2 to i32
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void time_frame_to_msf(long frame, int *m, int *s, int *f) {
  *f = frame % 75;
  frame /= 75;
  *s = frame % 60;
  frame /= 60;
  *m = frame;
}


x86 assembly (clang, -O0):
<time_frame_to_msf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_frame_to_msf>:
mov    %rdx,%r8
mov    %rdi,%r9
movabs $0x6d3a06d3a06d3a07,%rdx
06 3a 6d
mov    %rdi,%rax
imul   %rdx
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdi
add    %rax,%rdi
imul   $0x4b,%edi,%eax
mov    %r9d,%edx
sub    %eax,%edx
mov    %edx,(%rcx)
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
imul   %rcx
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x5,%rdx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%edi
mov    %edi,(%r8)
movabs $0x3a4114b5225c6337,%rcx
14 41 3a
mov    %r9,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%rdx
add    %eax,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define void @time_frame_to_msf(i64 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i64 %0, i64* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i64, i64* %5
%10 = srem i64 %9, 75
%11 = trunc i64 %10 to i32
%12 = load i32*, i32** %8
store i32 %11, i32* %12
%13 = load i64, i64* %5
%14 = sdiv i64 %13, 75
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = srem i64 %15, 60
%17 = trunc i64 %16 to i32
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i64, i64* %5
%20 = sdiv i64 %19, 60
store i64 %20, i64* %5
%21 = load i64, i64* %5
%22 = trunc i64 %21 to i32
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @time_frame_to_msf(i64 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i64 %0, 75
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = sdiv i64 %0, 75
%8 = srem i64 %7, 60
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = sdiv i64 %0, 4500
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, float const);
int main(void) {
  double const avogadro = 6e23;
  printf("%e\n", avogadro);
  float const behemoth = 31337e-3;
  printf("%e\n", behemoth);
  printf("%g\n", behemoth);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xedd(%rip),%rdi
movss  0xec9(%rip),%xmm0
call   1030 <printf@plt>
movss  0xeb8(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
movss  0xea4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
movss  0xe90(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
movss  0xebd(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca float
store i32 0, i32* %1
store double 6.000000e+23, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x44DFC38420000000)
store float 0x403F5645A0000000, float* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x403F5645A0000000)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x403F5645A0000000)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x44DFC38420000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x403F5645A0000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x403F5645A0000000)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ftello64(int /*<<< orphan*/ *);
off_t ftello(FILE *f) { return ftello64(f); }


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

x86 assembly (clang, -O2):
<ftello>:
jmp    1030 <ftello64@plt>

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

LLVM IR (-O2):
define i32 @ftello(i32* nocapture %0) {
%2 = tail call i32 @ftello64(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *smalloc(size_t size) {
  void *p = NULL;
  p = malloc(size);
  if (p)
    return p;
  abort();
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <smalloc+0x36>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<smalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <smalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
}
const char *type_name(unsigned char t) {
  if (t)
    return "UCHAR";
  else
    return "unsigned char";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1124 <type_name+0x24>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <type_name+0x2f>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %edi,%edi
lea    0xefd(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"UCHAR\00"
@.str.1 = [14 x i8] c"unsigned char\00"
define i8* @type_name(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"UCHAR\00"
@.str.1 = [14 x i8] c"unsigned char\00"
define i8* @type_name(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ heapsort(int *, int);
int test_heapsort() {
  int input[] = {8, 2, 9, 4, 0, 5, 1, 7, 6, 3};
  int expected[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  heapsort(input, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_heapsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_heapsort>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf00(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_heapsort.input = [10 x i32] [i32 8, i32 2, i32 9, i32 4, i32 0, i32 5, i32 1, i32 7, i32 6, i32 3]
@__const.test_heapsort.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_heapsort() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_heapsort.input = [10 x i32] [i32 8, i32 2, i32 9, i32 4, i32 0, i32 5, i32 1, i32 7, i32 6, i32 3]
@__const.test_heapsort.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_heapsort() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
char *get_char_vec(int x) {
  char *vec;
  vec = (char *)malloc(x * sizeof(char));
  vec = " ";
  return vec;
}


x86 assembly (clang, -O0):
<get_char_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_vec>:
push   %rax
call   1030 <malloc@plt>
lea    0xee3(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @get_char_vec(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @get_char_vec(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ iobound();
int main(int argc, char **argv) {
  iobound();
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @iobound()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @iobound()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
struct tms {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
clock_t times(struct tms *buf) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (1000 * tv.tv_sec) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<times>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
%struct.timeval = type { i32, i32 }
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
%3 = alloca %struct.timeval
store %struct.tms* %0, %struct.tms** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 1000, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.tms = type { i32 }
%struct.timeval = type { i32, i32 }
define i32 @times(%struct.tms* nocapture readnone %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ beeplf(int, int);
void beep(void) { beeplf(100, 261); }


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
mov    $0x105,%esi
call   1030 <beeplf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
mov    $0x64,%edi
mov    $0x105,%esi
jmp    1030 <beeplf@plt>

LLVM IR (-O0):
define void @beep() {
%1 = call i32 @beeplf(i32 100, i32 261)
ret void
}

LLVM IR (-O2):
define void @beep() {
%1 = tail call i32 @beeplf(i32 100, i32 261)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int lseek(int, int /*<<< orphan*/, int);
int do_lseek(int fd, off_t seekdist, int whence) {
  return lseek(fd, seekdist, whence);
}


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

x86 assembly (clang, -O2):
<do_lseek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @do_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(void) {
  int var;
  printf("&var = %p\n", &var);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"&var = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addch(char);
void nc_addch(char c) {
  if (c == '\t') {
    c = ' ';
  } else if (c == '\r') {
    addch('^');
    addch('M');
    return;
  }
  addch(c & 0xff);
}


x86 assembly (clang, -O0):
<nc_addch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    1134 <nc_addch+0x24>
movb   $0x20,-0x1(%rbp)
jmp    115f <nc_addch+0x4f>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    115a <nc_addch+0x4a>
mov    $0x5e,%edi
call   1030 <addch@plt>
mov    $0x4d,%edi
call   1030 <addch@plt>
jmp    1170 <nc_addch+0x60>
jmp    115f <nc_addch+0x4f>
movsbl -0x1(%rbp),%eax
and    $0xff,%eax
movsbl %al,%edi
call   1030 <addch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_addch>:
cmp    $0x9,%dil
je     1137 <nc_addch+0x27>
cmp    $0xd,%dil
jne    112e <nc_addch+0x1e>
push   %rax
mov    $0x5e,%edi
call   1030 <addch@plt>
mov    $0x4d,%dil
add    $0x8,%rsp
movsbl %dil,%edi
jmp    1030 <addch@plt>
mov    $0x20,%dil
movsbl %dil,%edi
jmp    1030 <addch@plt>

LLVM IR (-O0):
define void @nc_addch(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 9
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 32, i8* %2
br label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 13
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = call i32 @addch(i8 signext 94)
%13 = call i32 @addch(i8 signext 77)
br label %21
14: ; preds = %7
br label %15
15: ; preds = %14, %6
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = call i32 @addch(i8 signext %19)
br label %21
21: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
define void @nc_addch(i8 signext %0) {
switch i8 %0, label %4 [
i8 9, label %5
i8 13, label %2
]
2: ; preds = %1
%3 = tail call i32 @addch(i8 signext 94)
br label %5
4: ; preds = %1
br label %5
5: ; preds = %4, %1, %2
%6 = phi i8 [ 77, %2 ], [ 32, %1 ], [ %0, %4 ]
%7 = tail call i32 @addch(i8 signext %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void arch_spin_unlock(pthread_mutex_t *mutex) { pthread_mutex_unlock(mutex); }


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

x86 assembly (clang, -O2):
<arch_spin_unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define void @arch_spin_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret void
}
/* Variables and functions */
double sqrtf(double const);
double fSqrt(const double a) {
  if (a <= 0)
    return 0;
  return sqrtf(a);
}


x86 assembly (clang, -O0):
<fSqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1138 <fSqrt+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <fSqrt+0x37>
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrtf@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fSqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    112b <fSqrt+0x1b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1130 <fSqrt+0x20>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define double @fSqrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sqrtf(double %8)
store double %9, double* %2
br label %10
10: ; preds = %7, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @fSqrt(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @sqrtf(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int);
void set_kb_bl_level(unsigned level) {
  FILE *out = fopen("/sys/class/leds/asus::kbd_backlight/brightness", "w");
  fprintf(out, "%d\n", level);
  fclose(out);
}


x86 assembly (clang, -O0):
<set_kb_bl_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_kb_bl_level>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xedf(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"/sys/class/leds/asus::kbd_backlight/brightness\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @set_kb_bl_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"/sys/class/leds/asus::kbd_backlight/brightness\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @set_kb_bl_level(i32 %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
double EvalAngDist_alpha1_2plus_2plus_15097_L0(double);
double funcAngDist_alpha1_2plus_2plus_15097_L0(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha1_2plus_2plus_15097_L0(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha1_2plus_2plus_15097_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha1_2plus_2plus_15097_L0@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha1_2plus_2plus_15097_L0>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha1_2plus_2plus_15097_L0@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha1_2plus_2plus_15097_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha1_2plus_2plus_15097_L0(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha1_2plus_2plus_15097_L0(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha1_2plus_2plus_15097_L0(double %4)
%6 = fmul double %3, %5
ret double %6
}
int f(char a, char flag) {
  if (a == (flag ? 1 : 0))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jne    1139 <f+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1140 <f+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %ecx,%ecx
test   %sil,%sil
setne  %cl
xor    %eax,%eax
cmp    %ecx,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
%13 = icmp eq i32 %7, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = icmp ne i8 %1, 0
%5 = zext i1 %4 to i32
%6 = icmp ne i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef long int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(long *, void const *, int);
long osrp4s(const void *p) {
  int32_t tmp;
  memcpy(&tmp, p, 4);
  return tmp;
}


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

x86 assembly (clang, -O2):
<osrp4s>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @osrp4s(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @memcpy(i64* %2, i8* %0, i32 4)
%5 = load i64, i64* %2
ret i64 %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long zmtime_set_timeout(int timeout) {
  long r;
  struct timeval tv;
  gettimeofday(&tv, 0);
  r = tv.tv_sec * 1000 + tv.tv_usec / 1000 + timeout;
  return r;
}


x86 assembly (clang, -O0):
<zmtime_set_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    -0x4(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmtime_set_timeout>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%eax
movslq 0xc(%rsp),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
add    %ebx,%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @zmtime_set_timeout(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca %struct.timeval
store i32 %0, i32* %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @zmtime_set_timeout(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add i32 %7, %0
%12 = add i32 %11, %10
%13 = sext i32 %12 to i64
ret i64 %13
}
int test_imm_2Cint16_reg(short val) {
  return ((val) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x2c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cint16_reg>:
test   $0x2c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 44
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_2Cint16_reg(i16 signext %0) {
%2 = and i16 %0, 44
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ password();
int main() {
  password();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @password()
ret i32 0
}
/* Variables and functions */
const char *cli_check_help(bool full) {
  const char *fullmsg =
      ""
      "asignify [global_opts] check - verifies signature and check external "
      "files validtiy\n\n"
      "Usage: asignify check <pubkey> <signature> <file>...\n"
      "\tpubkey        Path to a public key file to check signature against\n"
      "\tsignature     Path to signature file to check\n"
      "\tfile          A file that is recorded in the signature digests\n";
  if (!full) {
    return ("check pubkey signature file [file...]");
  }
  return (fullmsg);
}


x86 assembly (clang, -O0):
<cli_check_help>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112c <cli_check_help+0x2c>
lea    0x101b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <cli_check_help+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_check_help>:
test   %edi,%edi
lea    0x1035(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [318 x i8] c"asignify [global_opts] check - verifies signature and check external files validtiy\0A\0AUsage: asignify check <pubkey> <signature> <file>...\0A\09pubkey Path to a public key file to check signature against\0A\09signature Path to signature file to check\0A\09file A file that is recorded in the signature digests\0A\00"
@.str.1 = [38 x i8] c"check pubkey signature file [file...]\00"
define i8* @cli_check_help(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([318 x i8], [318 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %10
10: ; preds = %8, %7
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [318 x i8] c"asignify [global_opts] check - verifies signature and check external files validtiy\0A\0AUsage: asignify check <pubkey> <signature> <file>...\0A\09pubkey Path to a public key file to check signature against\0A\09signature Path to signature file to check\0A\09file A file that is recorded in the signature digests\0A\00"
@.str.1 = [38 x i8] c"check pubkey signature file [file...]\00"
define i8* @cli_check_help(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([318 x i8], [318 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge4(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 4);
}


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

x86 assembly (clang, -O2):
<charge4>:
mov    $0x4,%edx
jmp    1030 <charge_generic@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @charge4(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %3
%6 = load %struct.battle_char*, %struct.battle_char** %4
%7 = call i32 @charge_generic(%struct.battle_char* %5, %struct.battle_char* %6, i32 4)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge4(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 4)
ret void
}
unsigned point_index(const unsigned x) {
  return ((x >> 1) & 1u) | ((x >> 2) & 2u) | ((x >> 3) & 4u);
}


x86 assembly (clang, -O0):
<point_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x2,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
and    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_index>:
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x2,%eax
or     %ecx,%eax
shr    $0x3,%edi
and    $0x4,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @point_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
%6 = load i32, i32* %2
%7 = lshr i32 %6, 2
%8 = and i32 %7, 2
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 3
%12 = and i32 %11, 4
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @point_index(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
%4 = lshr i32 %0, 2
%5 = and i32 %4, 2
%6 = or i32 %3, %5
%7 = lshr i32 %0, 3
%8 = and i32 %7, 4
%9 = or i32 %6, %8
ret i32 %9
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  double dtval = (tv.tv_sec + tv.tv_usec / 1000000.0);
  return dtval;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
store double %9, double* %2
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Type definitions */
struct iso_dir {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct iso_dir *);
int iso_dclose(struct iso_dir *dir) {
  if (dir) {
    kfree(dir);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<iso_dclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <iso_dclose+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <kfree@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <iso_dclose+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_dclose>:
test   %rdi,%rdi
je     1122 <iso_dclose+0x12>
push   %rax
call   1030 <kfree@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.iso_dir = type { i32 }
define i32 @iso_dclose(%struct.iso_dir* %0) {
%2 = icmp eq %struct.iso_dir* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @kfree(%struct.iso_dir* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}