xunge/DecIR huggingface dataset:
signed long signedlong_ignoring_unsignedint(signed long x, unsigned int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlong_ignoring_unsignedint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
void initscreen() {
  initscr();
  noecho();
}


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

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

LLVM IR (-O0):
define void @initscreen() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
define void @initscreen() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
ret void
}
/* Type definitions */
struct HMMSegment {
  int dummy;
};

/* Variables and functions */
struct HMMSegment *NewHMMSegment(char const *);
struct HMMSegment *hmm_engine(const char *HMM_PATH) {
  return NewHMMSegment(HMM_PATH);
}


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

x86 assembly (clang, -O2):
<hmm_engine>:
jmp    1030 <NewHMMSegment@plt>

LLVM IR (-O0):
%struct.HMMSegment = type { i32 }
define %struct.HMMSegment* @hmm_engine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.HMMSegment* @NewHMMSegment(i8* %3)
ret %struct.HMMSegment* %4
}

LLVM IR (-O2):
%struct.HMMSegment = type { i32 }
define %struct.HMMSegment* @hmm_engine(i8* %0) {
%2 = tail call %struct.HMMSegment* @NewHMMSegment(i8* %0)
ret %struct.HMMSegment* %2
}
/* Variables and functions */
double quagpa_(double *, double *);
double cquagpa(double *f, double *para) { return quagpa_(f, para); }


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

x86 assembly (clang, -O2):
<cquagpa>:
jmp    1030 <quagpa_@plt>

LLVM IR (-O0):
define double @cquagpa(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @quagpa_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquagpa(double* %0, double* %1) {
%3 = tail call double @quagpa_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int proc_num_of_occ(char *, char *);
int proc_cpu_number() { return proc_num_of_occ("/proc/cpuinfo", "processor"); }


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

x86 assembly (clang, -O2):
<proc_cpu_number>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <proc_num_of_occ@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [10 x i8] c"processor\00"
define i32 @proc_cpu_number() {
%1 = call i32 @proc_num_of_occ(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [10 x i8] c"processor\00"
define i32 @proc_cpu_number() {
%1 = tail call i32 @proc_num_of_occ(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ _PC_PATH_MAX;
int pathconf(char *, int /*<<< orphan*/);
int pathmax() {
  static int pathmax = 0;
  if (pathmax == 0) {
    pathmax = pathconf("/", _PC_PATH_MAX);
    pathmax = (pathmax <= 0) ? 1024 : pathmax + 1;
  }
  return pathmax;
}


x86 assembly (clang, -O0):
<pathmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
jne    116f <pathmax+0x5f>
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <pathconf@plt>
mov    %eax,0x2eec(%rip)
cmpl   $0x0,0x2ee5(%rip)
jg     115a <pathmax+0x4a>
mov    $0x400,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <pathmax+0x56>
mov    0x2ecc(%rip),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2ebd(%rip)
mov    0x2eb7(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathmax>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <pathmax+0xd>
pop    %rcx
ret
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <pathconf@plt>
lea    0x1(%rax),%ecx
test   %eax,%eax
mov    $0x400,%eax
cmovg  %ecx,%eax
mov    %eax,0x2ee7(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@pathmax.pathmax = internal global i32 0
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
define i32 @pathmax() {
%1 = load i32, i32* @pathmax.pathmax
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %14
3: ; preds = %0
%4 = load i32, i32* @_PC_PATH_MAX
%5 = call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* @pathmax.pathmax
%6 = load i32, i32* @pathmax.pathmax
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %12
9: ; preds = %3
%10 = load i32, i32* @pathmax.pathmax
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 1024, %8 ], [ %11, %9 ]
store i32 %13, i32* @pathmax.pathmax
br label %14
14: ; preds = %12, %0
%15 = load i32, i32* @pathmax.pathmax
ret i32 %15
}

LLVM IR (-O2):
@pathmax.pathmax = internal unnamed_addr global i32 0
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
define i32 @pathmax() {
%1 = load i32, i32* @pathmax.pathmax
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i32, i32* @_PC_PATH_MAX
%5 = tail call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp slt i32 %5, 1
%7 = add nsw i32 %5, 1
%8 = select i1 %6, i32 1024, i32 %7
store i32 %8, i32* @pathmax.pathmax
br label %9
9: ; preds = %3, %0
%10 = phi i32 [ %8, %3 ], [ %1, %0 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("asd, version %s\n", "1.0"); }


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"asd, version %s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"asd, version %s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ array_func_param(int *);
int /*<<< orphan*/ array_func_param_1(int *);
void test_func_param() {
  int *p;
  array_func_param(p);
  array_func_param_1(p);
}


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

x86 assembly (clang, -O2):
<test_func_param>:
push   %rax
call   1030 <array_func_param@plt>
pop    %rax
jmp    1040 <array_func_param_1@plt>

LLVM IR (-O0):
define void @test_func_param() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @array_func_param(i32* %2)
%4 = load i32*, i32** %1
%5 = call i32 @array_func_param_1(i32* %4)
ret void
}

LLVM IR (-O2):
define void @test_func_param() {
%1 = tail call i32 @array_func_param(i32* undef)
%2 = tail call i32 @array_func_param_1(i32* undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int64_t size(char *input) { return strlen(input); }


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

x86 assembly (clang, -O2):
<size>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @size(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          char const *);
void cmdshell_print_status_write(const char *wsrc, const char *wdst,
                                 const char *woffset, const char *wcipher) {
  printf("\n"
         "Write options:\n"
         "  Source:             \"%s\"\n"
         "  Destination:        \"%s\"\n"
         "  Destination Offset: %s\n"
         "  Destination Cipher: %s\n"
         "\n",
         wsrc, wdst, woffset, wcipher);
}


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

x86 assembly (clang, -O2):
<cmdshell_print_status_write>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [122 x i8] c"\0AWrite options:\0A Source: \22%s\22\0A Destination: \22%s\22\0A Destination Offset: %s\0A Destination Cipher: %s\0A\0A\00"
define void @cmdshell_print_status_write(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [122 x i8] c"\0AWrite options:\0A Source: \22%s\22\0A Destination: \22%s\22\0A Destination Offset: %s\0A Destination Cipher: %s\0A\0A\00"
define void @cmdshell_print_status_write(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
int ft_isdigit(int c) {
  if (c <= '9' && c >= '0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void g(int x[]) {
  int i;
  for (i = 0; i < 2; i++) {
    x[i] = i;
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1135 <g+0x35>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <g+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movabs $0x100000000,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @g(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello word"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello word\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello word\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void arm_ldc() {}


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

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

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

LLVM IR (-O2):
define void @arm_ldc() {
ret void
}
/* Variables and functions */
size_t strlen(char *);
scalar_t__ writen(int, char const *, size_t);
size_t writeline(int fd, const char *ptr, size_t n, char *ret) {
  size_t r = 0;
  r += writen(fd, ptr, n);
  r += writen(fd, ret, strlen(ret));
  return r;
}


x86 assembly (clang, -O0):
<writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <writen@plt>
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
call   1040 <writen@plt>
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeline>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edi,%ebp
call   1040 <writen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <writen@plt>
add    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @writeline(i32 %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
store i64 0, i64* %9
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i64 @writen(i32 %10, i8* %11, i64 %12)
%14 = load i64, i64* %9
%15 = add i64 %14, %13
store i64 %15, i64* %9
%16 = load i32, i32* %5
%17 = load i8*, i8** %8
%18 = load i8*, i8** %8
%19 = call i64 @strlen(i8* %18)
%20 = call i64 @writen(i32 %16, i8* %17, i64 %19)
%21 = load i64, i64* %9
%22 = add i64 %21, %20
store i64 %22, i64* %9
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @writeline(i32 %0, i8* %1, i64 %2, i8* %3) {
%5 = tail call i64 @writen(i32 %0, i8* %1, i64 %2)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%7 = tail call i64 @writen(i32 %0, i8* %3, i64 %6)
%8 = add i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ glmDot3f(float const *, float const *);
float sqrtf(int /*<<< orphan*/);
float glmLength3f(const float x[3]) { return sqrtf(glmDot3f(x, x)); }


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

x86 assembly (clang, -O2):
<glmLength3f>:
push   %rax
mov    %rdi,%rsi
call   1040 <glmDot3f@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @glmLength3f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @glmDot3f(float* %3, float* %4)
%6 = call float @sqrtf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @glmLength3f(float* %0) {
%2 = tail call i32 @glmDot3f(float* %0, float* %0)
%3 = tail call float @sqrtf(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ cria(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char file[50];
  puts("Informe o nome do arquivo:");
  scanf("%s", file);
  cria(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    -0x50(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <cria@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <cria@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Informe o nome do arquivo:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [50 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%11 = call i32 @cria(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Informe o nome do arquivo:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @cria(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Display();
int /*<<< orphan*/ clearDisplay();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
void BreakDeal(int sig) {
  clearDisplay();
  usleep(1000000);
  Display();
  exit(0);
}


x86 assembly (clang, -O0):
<BreakDeal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clearDisplay@plt>
mov    $0xf4240,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1040 <Display@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<BreakDeal>:
push   %rax
xor    %eax,%eax
call   1030 <clearDisplay@plt>
mov    $0xf4240,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1040 <Display@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @BreakDeal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clearDisplay()
%4 = call i32 @usleep(i32 1000000)
%5 = call i32 (...) @Display()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @BreakDeal(i32 %0) {
%2 = tail call i32 (...) @clearDisplay()
%3 = tail call i32 @usleep(i32 1000000)
%4 = tail call i32 (...) @Display()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ c_fstr_sort_index(int *, int);
void FSTR_SORT_INDEX_(int *index_data, int *n) {
  c_fstr_sort_index(index_data, *n);
}


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

x86 assembly (clang, -O2):
<FSTR_SORT_INDEX_>:
mov    (%rsi),%esi
jmp    1030 <c_fstr_sort_index@plt>

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

LLVM IR (-O2):
define void @FSTR_SORT_INDEX_(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @c_fstr_sort_index(i32* %0, i32 %3)
ret void
}
char s_get_indexed(char index, char *msg) { return msg[index]; }


x86 assembly (clang, -O0):
<s_get_indexed>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_get_indexed>:
movslq %edi,%rax
mov    (%rsi,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @s_get_indexed(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @s_get_indexed(i8 signext %0, i8* nocapture %1) {
%3 = sext i8 %0 to i64
%4 = getelementptr inbounds i8, i8* %1, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_send_event(void *_p, int _v) {
  ((XCrossingEvent *)_p)->send_event = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCrossingEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void int_lower_bound(register int *what, register int limit) {
  if (*what < limit)
    *what = limit;
}


x86 assembly (clang, -O0):
<int_lower_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jge    1123 <int_lower_bound+0x23>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_lower_bound>:
cmp    %esi,(%rdi)
jge    1106 <int_lower_bound+0x6>
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @int_lower_bound(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %1, i32* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
bool nrf52_errata_204(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_204() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PreferencesDialog();
void MenuPreferences(const char *key) { PreferencesDialog(); }


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

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

LLVM IR (-O0):
define void @MenuPreferences(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @PreferencesDialog()
ret void
}

LLVM IR (-O2):
define void @MenuPreferences(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @PreferencesDialog()
ret void
}
/* Variables and functions */
int getpagesize();
__attribute__((__weak__, __always___)) int softboundmpx_getpagesize(void) {
  return getpagesize();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_getpagesize() {
%1 = call i32 (...) @getpagesize()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundmpx_getpagesize() {
%1 = tail call i32 (...) @getpagesize()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ scrypt_1024_1_1_256_sp(char const *, char *, char *);
void scrypt_1024_1_1_256(const char *input, char *output) {
  char scratchpad[263166];
  scrypt_1024_1_1_256_sp(input, output, scratchpad);
}


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

x86 assembly (clang, -O2):
<scrypt_1024_1_1_256>:
sub    $0x40408,%rsp
mov    %rsp,%rdx
call   1030 <scrypt_1024_1_1_256_sp@plt>
add    $0x40408,%rsp
ret

LLVM IR (-O0):
define void @scrypt_1024_1_1_256(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [263166 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [263166 x i8], [263166 x i8]* %5, i64 0, i64 0
%9 = call i32 @scrypt_1024_1_1_256_sp(i8* %6, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @scrypt_1024_1_1_256(i8* %0, i8* %1) {
%3 = alloca [263166 x i8]
%4 = getelementptr inbounds [263166 x i8], [263166 x i8]* %3, i64 0, i64 0
%5 = call i32 @scrypt_1024_1_1_256_sp(i8* %0, i8* %1, i8* %4)
ret void
}
int cast_int(char c) {
  char digits[] = "0123456789";
  int i;
  for (i = 0; i < 10; ++i)
    if (c == digits[i])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<cast_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xee4(%rip),%al
mov    %al,-0x6(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    116d <cast_int+0x6d>
movsbl -0x5(%rbp),%eax
movslq -0x14(%rbp),%rcx
movsbl -0x10(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    115a <cast_int+0x5a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <cast_int+0x74>
jmp    115f <cast_int+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <cast_int+0x30>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_int>:
add    $0xd0,%dil
cmp    $0xa,%dil
movzbl %dil,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
@__const.cast_int.digits = [11 x i8] c"0123456789\00"
define i32 @cast_int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [11 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [11 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %12, %17
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load i32, i32* %5
store i32 %20, i32* %2
br label %26
21: ; preds = %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @cast_int(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i8 %2 to i32
%5 = select i1 %3, i32 %4, i32 -1
ret i32 %5
}
void RTCrcAdler32Process(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCrcAdler32Process() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char **char_mat_alloc(int n, int k) {
  char **mat;
  mat = (char **)calloc(n, sizeof(char *));
  if (mat == NULL) {
    fprintf(stderr, "could not allocate memory");
    exit(EXIT_FAILURE);
  }
  return mat;
}


x86 assembly (clang, -O0):
<char_mat_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117d <char_mat_alloc+0x4d>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_mat_alloc>:
push   %rax
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <char_mat_alloc+0x12>
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"could not allocate memory\00"
@EXIT_FAILURE = global i32 0
define i8** @char_mat_alloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i64 @calloc(i32 %6, i32 8)
%8 = inttoptr i64 %7 to i8**
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
ret i8** %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"could not allocate memory\00"
@EXIT_FAILURE = global i32 0
define i8** @char_mat_alloc(i32 %0, i32 %1) {
%3 = tail call i64 @calloc(i32 %0, i32 8)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = inttoptr i64 %3 to i8**
ret i8** %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
void note_on(char a, char b, char c) { printf("note_on %d %d %d\n", a, b, c); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"note_on %d %d %d\0A\00"
define void @note_on(i8 signext %0, i8 signext %1, i8 signext %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* %5
%9 = load i8, i8* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"note_on %d %d %d\0A\00"
define void @note_on(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1, i8 signext %2)
ret void
}
/* Variables and functions */
char *print_vfpu_reg(int, int, char, char, char *);
char *print_vfpupair(int reg, char *output) {
  if ((reg >> 6) & 1) {
    return print_vfpu_reg(reg, 2, 'C', 'R', output);
  } else {
    return print_vfpu_reg(reg, 0, 'C', 'R', output);
  }
}


x86 assembly (clang, -O0):
<print_vfpupair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1155 <print_vfpupair+0x45>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <print_vfpupair+0x61>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vfpupair>:
mov    %rsi,%r8
mov    %edi,%esi
shr    $0x5,%esi
and    $0x2,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
jmp    1030 <print_vfpu_reg@plt>

LLVM IR (-O0):
define i8* @print_vfpupair(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = ashr i32 %6, 6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i8* @print_vfpu_reg(i32 %11, i32 2, i8 signext 67, i8 signext 82, i8* %12)
store i8* %13, i8** %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = call i8* @print_vfpu_reg(i32 %15, i32 0, i8 signext 67, i8 signext 82, i8* %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %14, %10
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @print_vfpupair(i32 %0, i8* %1) {
%3 = lshr i32 %0, 5
%4 = and i32 %3, 2
%5 = tail call i8* @print_vfpu_reg(i32 %0, i32 %4, i8 signext 67, i8 signext 82, i8* %1)
ret i8* %5
}
void kvm_pmu_flush_hwstate(struct kvm_vcpu *vcpu) {}


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

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

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

LLVM IR (-O2):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_flush_hwstate(%struct.kvm_vcpu* nocapture %0) {
ret void
}
unsigned int generic_hweight32(unsigned int w) {
  unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
  res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
  return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<generic_hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_hweight32>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @generic_hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 1431655765
%9 = add i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 858993459
%12 = load i32, i32* %3
%13 = lshr i32 %12, 2
%14 = and i32 %13, 858993459
%15 = add i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = and i32 %16, 252645135
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = and i32 %19, 252645135
%21 = add i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = and i32 %22, 16711935
%24 = load i32, i32* %3
%25 = lshr i32 %24, 8
%26 = and i32 %25, 16711935
%27 = add i32 %23, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = and i32 %28, 65535
%30 = load i32, i32* %3
%31 = lshr i32 %30, 16
%32 = and i32 %31, 65535
%33 = add i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @generic_hweight32(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ipow(uint64_t base, uint64_t exp) {
  uint64_t result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
sar    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = ashr i32 %6, 1
%13 = mul nsw i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int strlen(char *);
void chomp(char *s) {
  int l = strlen(s) - 1;
  if (l >= 0 && s[l] == '\n')
    s[l] = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1156 <chomp+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <chomp+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
int main(int ac, char **av) { return (0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned long gfx_ind(int);
unsigned char Dorado9211ReadDataIn(void) {
  unsigned char readdata = 0;
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  value = gfx_ind(0x6400 + 0x04);
  value = gfx_ind(0x6400 + 0x04);
  value = gfx_ind(0x6400 + 0x04);
  if (value & 0x00000800)
    readdata = 1;
  return (readdata);
}


x86 assembly (clang, -O0):
<Dorado9211ReadDataIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    %rax,-0x10(%rbp)
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    %rax,-0x10(%rbp)
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    %rax,-0x10(%rbp)
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x800,%rax
cmp    $0x0,%rax
je     116c <Dorado9211ReadDataIn+0x5c>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211ReadDataIn>:
push   %rax
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
mov    $0x6404,%edi
call   1030 <gfx_ind@plt>
shr    $0xb,%rax
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @Dorado9211ReadDataIn() {
%1 = alloca i8
%2 = alloca i64
store i8 0, i8* %1
%3 = call i64 @gfx_ind(i32 25604)
store i64 %3, i64* %2
%4 = call i64 @gfx_ind(i32 25604)
store i64 %4, i64* %2
%5 = call i64 @gfx_ind(i32 25604)
store i64 %5, i64* %2
%6 = call i64 @gfx_ind(i32 25604)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = and i64 %7, 2048
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i8 1, i8* %1
br label %11
11: ; preds = %10, %0
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @Dorado9211ReadDataIn() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = tail call i64 @gfx_ind(i32 25604)
%3 = tail call i64 @gfx_ind(i32 25604)
%4 = tail call i64 @gfx_ind(i32 25604)
%5 = lshr i64 %4, 11
%6 = trunc i64 %5 to i8
%7 = and i8 %6, 1
ret i8 %7
}