xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int count1s(int num) {
  int i = 0;
  int n = num;
  while (n) {
    n = n & (n - 1);
    i++;
  }
  printf("%d (0x%x) has %d 1s\n", num, num, i);
  return i;
}


x86 assembly (clang, -O0):
<count1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <count1s+0x3e>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <count1s+0x18>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count1s>:
push   %rbx
mov    %edi,%edx
xor    %ebx,%ebx
test   %edi,%edi
je     112c <count1s+0x1c>
mov    %edx,%eax
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rax),%ecx
add    $0x1,%ebx
and    %eax,%ecx
mov    %ecx,%eax
jne    1120 <count1s+0x10>
lea    0xecd(%rip),%rdi
mov    %edx,%esi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d (0x%x) has %d 1s\0A\00"
define i32 @count1s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = and i32 %10, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d (0x%x) has %d 1s\0A\00"
define i32 @count1s(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = and i32 %6, %4
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0, i32 %11)
ret i32 %11
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned int, unsigned int);
int rc_format_value_minutes(char *buffer, int size, unsigned minutes) {
  unsigned hours;
  hours = minutes / 60;
  minutes -= hours * 60;
  return snprintf(buffer, size, "%uh%02u", hours, minutes);
}


x86 assembly (clang, -O0):
<rc_format_value_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
imul   $0x3c,-0x14(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_format_value_minutes>:
mov    %edx,%eax
mov    $0x88888889,%ecx
imul   %rax,%rcx
shr    $0x25,%rcx
imul   $0xffffffc4,%ecx,%r8d
add    %edx,%r8d
lea    0xed3(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%uh%02u\00"
define i32 @rc_format_value_minutes(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = udiv i32 %8, 60
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = mul i32 %10, 60
%12 = load i32, i32* %6
%13 = sub i32 %12, %11
store i32 %13, i32* %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @snprintf(i8* %14, i32 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
@.str = [8 x i8] c"%uh%02u\00"
define i32 @rc_format_value_minutes(i8* %0, i32 %1, i32 %2) {
%4 = udiv i32 %2, 60
%5 = mul i32 %4, -60
%6 = add i32 %5, %2
%7 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret i32 %7
}
unsigned int refhash(const unsigned char *link_ref) {
  unsigned int hash = 0;
  while (*link_ref)
    hash = (*link_ref++) + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<refhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <refhash+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <refhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <refhash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <refhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @refhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = mul i32 %6, 65599
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct archive {
  int dummy;
};

/* Variables and functions */
int archive_filter_code(struct archive *, int /*<<< orphan*/);
int _alpm_archive_filter_code(struct archive *archive) {
  return archive_filter_code(archive, 0);
}


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

x86 assembly (clang, -O2):
<_alpm_archive_filter_code>:
xor    %esi,%esi
jmp    1030 <archive_filter_code@plt>

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

LLVM IR (-O2):
%struct.archive = type { i32 }
define i32 @_alpm_archive_filter_code(%struct.archive* %0) {
%2 = tail call i32 @archive_filter_code(%struct.archive* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_application() { exit(11); }


x86 assembly (clang, -O0):
<exit_application>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_application>:
push   %rax
mov    $0xb,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_application() {
%1 = call i32 @exit(i32 11)
unreachable
}

LLVM IR (-O2):
define void @exit_application() {
%1 = tail call i32 @exit(i32 11)
unreachable
}
void default_log_user(const char *a, ...) {}


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

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

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

LLVM IR (-O2):
define void @default_log_user(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double getRandomDouble(double, double);
void setRandomDoubleVector(double *vect, int num, double min, double max) {
  int i;
  for (i = 0; i < num; i++)
    vect[i] = getRandomDouble(min, max);
}


x86 assembly (clang, -O0):
<setRandomDoubleVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <setRandomDoubleVector+0x56>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <getRandomDouble@plt>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <setRandomDoubleVector+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRandomDoubleVector>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    114f <setRandomDoubleVector+0x3f>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <getRandomDouble@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <setRandomDoubleVector+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @setRandomDoubleVector(double* nocapture writeonly %0, i32 %1, double %2, double %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double @getRandomDouble(double %2, double %3)
%11 = getelementptr inbounds double, double* %0, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret void
}
shmat(shmid, shmaddr, shmflg) int shmid;
char *shmaddr;
int shmflg;
{ return (syscall(52, 0, shmid, shmaddr, shmflg)); }


x86 assembly (clang, -O0):
<shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x34,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmat>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x34,%edi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @shmat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, i8*, i32, ...)*)(i32 52, i32 0, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int _utils_searchexp(char const *, char const *, int /*<<< orphan*/,
                     char const **);
int utils_searchexp(const char *haystack, const char *needleslist,
                    const char **rest) {
  return _utils_searchexp(haystack, needleslist, 0, rest);
}


x86 assembly (clang, -O0):
<utils_searchexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <_utils_searchexp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_searchexp>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <_utils_searchexp@plt>

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

LLVM IR (-O2):
define i32 @utils_searchexp(i8* %0, i8* %1, i8** %2) {
%4 = tail call i32 @_utils_searchexp(i8* %0, i8* %1, i32 0, i8** %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
void ____longjmp_chk(__jmp_buf __env, int __val) { longjmp(__env, __val); }


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

x86 assembly (clang, -O2):
<____longjmp_chk>:
jmp    1030 <longjmp@plt>

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

LLVM IR (-O2):
define void @____longjmp_chk(i32 %0, i32 %1) {
%3 = tail call i32 @longjmp(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
struct Node **malloc(int);
struct Node **llistCursor_new(void) {
  struct Node **cursor = malloc(sizeof(*cursor));
  if (cursor != NULL) {
    *cursor = NULL;
  }
  return cursor;
}


x86 assembly (clang, -O0):
<llistCursor_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <llistCursor_new+0x2c>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llistCursor_new>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1127 <llistCursor_new+0x17>
movq   $0x0,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.Node = type { i32 }
define noalias %struct.Node** @llistCursor_new() {
%1 = tail call %struct.Node** @malloc(i32 8)
%2 = icmp eq %struct.Node** %1, null
br i1 %2, label %4, label %3
3: ; preds = %0
store %struct.Node* null, %struct.Node** %1
br label %4
4: ; preds = %3, %0
ret %struct.Node** %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rand32() {
  static int seed = 0;
  uint32_t hi, lo;
  hi = (seed = seed * 1103515245 + 12345) >> 16;
  lo = (seed = seed * 1103515245 + 12345) >> 16;
  return (hi << 16) + lo;
}


x86 assembly (clang, -O0):
<rand32>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f16(%rip),%eax
4e c6 41
add    $0x3039,%eax
mov    %eax,0x2f0b(%rip)
sar    $0x10,%eax
mov    %eax,-0x4(%rbp)
imul   $0x41c64e6d,0x2efb(%rip),%eax
4e c6 41
add    $0x3039,%eax
mov    %eax,0x2ef0(%rip)
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand32>:
imul   $0x41c64e6d,0x2f1a(%rip),%ecx
4e c6 41
add    $0x3039,%ecx
imul   $0x41c64e6d,%ecx,%eax
and    $0xffff0000,%ecx
add    $0x3039,%eax
mov    %eax,0x2efd(%rip)
sar    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@rand32.seed = internal global i32 0
define i32 @rand32() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @rand32.seed
%4 = mul nsw i32 %3, 1103515245
%5 = add nsw i32 %4, 12345
store i32 %5, i32* @rand32.seed
%6 = ashr i32 %5, 16
store i32 %6, i32* %1
%7 = load i32, i32* @rand32.seed
%8 = mul nsw i32 %7, 1103515245
%9 = add nsw i32 %8, 12345
store i32 %9, i32* @rand32.seed
%10 = ashr i32 %9, 16
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = shl i32 %11, 16
%13 = load i32, i32* %2
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@rand32.seed = internal unnamed_addr global i32 0
define i32 @rand32() {
%1 = load i32, i32* @rand32.seed
%2 = mul nsw i32 %1, 1103515245
%3 = add nsw i32 %2, 12345
%4 = and i32 %3, -65536
%5 = mul nsw i32 %3, 1103515245
%6 = add nsw i32 %5, 12345
store i32 %6, i32* @rand32.seed
%7 = ashr i32 %6, 16
%8 = add nsw i32 %7, %4
ret i32 %8
}
int emac1_aframechecksequenceerrors_set(
    unsigned int dev_id, union emac1_aframechecksequenceerrors_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_aframechecksequenceerrors_u = type opaque
define i32 @emac1_aframechecksequenceerrors_set(i32 %0, %union.emac1_aframechecksequenceerrors_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_aframechecksequenceerrors_u*
store i32 %0, i32* %3
store %union.emac1_aframechecksequenceerrors_u* %1, %union.emac1_aframechecksequenceerrors_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_aframechecksequenceerrors_u = type opaque
define i32 @emac1_aframechecksequenceerrors_set(i32 %0, %union.emac1_aframechecksequenceerrors_u* nocapture readnone %1) {
ret i32 1
}
void vnewde_(dev, len, len0) char *dev;
int *len;
int len0;
{ vnewdev_(dev, len, len0); }


x86 assembly (clang, -O0):
<vnewde_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <vnewdev_@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vnewde_(i8* %0, i32* %1, i32 %2) {
%4 = tail call i32 (i8*, i32*, i32, ...) bitcast (i32 (...)* @vnewdev_ to i32 (i8*, i32*, i32, ...)*)(i8* %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void log_frameSent(int packet, int frame) {
  char buffer[50];
  sprintf(buffer, "DAT: frame %d of packet %d sent", frame, packet);
  log_msg(buffer);
}


x86 assembly (clang, -O0):
<log_frameSent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <log_msg@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_frameSent>:
push   %rbx
sub    $0x40,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <log_msg@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"DAT: frame %d of packet %d sent\00"
define void @log_frameSent(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [50 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%11 = call i32 @log_msg(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"DAT: frame %d of packet %d sent\00"
define void @log_frameSent(i32 %0, i32 %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 @log_msg(i8* %4)
ret void
}
void BN_get0_nist_prime_384(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_get0_nist_prime_384() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genome_out(char *);
char *strstr(char *, char *);
void get_genome_uid(char *line, int chars, int maxchars) {
  if ((line = strstr(line, "<meta name=\"ncbi_uidlist\" content=\"")) != NULL) {
    strstr(line + 35, "\"")[0] = 0;
    genome_out(line + 35);
  }
  (void)chars;
  (void)maxchars;
}


x86 assembly (clang, -O0):
<get_genome_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1174 <get_genome_uid+0x54>
mov    -0x8(%rbp),%rdi
add    $0x23,%rdi
lea    0xec3(%rip),%rsi
call   1040 <strstr@plt>
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x23,%rdi
call   1030 <genome_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_genome_uid>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     1162 <get_genome_uid+0x32>
mov    %rax,%rbx
add    $0x23,%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <genome_out@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"<meta name=\22ncbi_uidlist\22 content=\22\00"
@.str.1 = [2 x i8] c"\22\00"
define void @get_genome_uid(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 35
%13 = call i8* @strstr(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 35
%17 = call i32 @genome_out(i8* %16)
br label %18
18: ; preds = %10, %3
%19 = load i32, i32* %5
%20 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"<meta name=\22ncbi_uidlist\22 content=\22\00"
define void @get_genome_uid(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 35
%8 = tail call i8* @strchr(i8* %7, i32 34)
store i8 0, i8* %8
%9 = tail call i32 @genome_out(i8* %7)
br label %10
10: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *);
int phSendSoundFile(int cid, const char *fileName) {
  char reqbuf[256];
  snprintf(reqbuf, sizeof(reqbuf), "SENDSF CID=%d FILE=%s", cid, fileName);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSendSoundFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x100,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSendSoundFile>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"SENDSF CID=%d FILE=%s\00"
define i32 @phSendSoundFile(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"SENDSF CID=%d FILE=%s\00"
define i32 @phSendSoundFile(i32 %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
/* Variables and functions */
int bsdsock_read(int, unsigned char *, void *);
int bsdsock_getch(void *data) {
  unsigned char ch;
  int err;
  if (1 != (err = bsdsock_read(1, &ch, data)))
    return err;
  return ch;
}


x86 assembly (clang, -O0):
<bsdsock_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    -0x11(%rbp),%rsi
call   1030 <bsdsock_read@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
mov    $0x1,%eax
cmp    %ecx,%eax
je     114b <bsdsock_getch+0x3b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <bsdsock_getch+0x42>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsdsock_getch>:
push   %rax
mov    %rdi,%rdx
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <bsdsock_read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bsdsock_getch(i8* %0) {
%2 = alloca i8
%3 = call i32 @bsdsock_read(i32 1, i8* %2, i8* %0)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int isspace(char buf[8]) { return buf[0] == 32; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmpb   $0x20,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isspace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
double getTime(double bandwidth, unsigned long int volume) {
  return (2 * volume * 8) / (bandwidth * 1000000000);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
movq   %rax,%xmm0
movaps 0xeef(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xef3(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
shl    $0x4,%rdi
movq   %rdi,%xmm2
punpckldq 0xeef(%rip),%xmm2
subpd  0xef7(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  0xef3(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getTime(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul i64 2, %5
%7 = mul i64 %6, 8
%8 = uitofp i64 %7 to double
%9 = load double, double* %3
%10 = fmul double %9, 1.000000e+09
%11 = fdiv double %8, %10
ret double %11
}

LLVM IR (-O2):
define double @getTime(double %0, i64 %1) {
%3 = shl i64 %1, 4
%4 = uitofp i64 %3 to double
%5 = fmul double %0, 1.000000e+09
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgdec1iw(void) { ngen("%s\t(%%rax)", "decq", 0); }


x86 assembly (clang, -O0):
<cgdec1iw>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec1iw>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%rax)\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdec1iw() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%rax)\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdec1iw() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int read(int file, char *ptr, int len) { svcPanic(); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Calling ps f --------------\n");
  system("ps f");
  printf("End calling --------------\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Calling ps \C2\96f --------------\0A\00"
@.str.1 = [7 x i8] c"ps \C2\96f\00"
@.str.2 = [28 x i8] c"End calling --------------\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"ps \C2\96f\00"
@str = [30 x i8] c"Calling ps \C2\96f --------------\00"
@str.3 = [27 x i8] c"End calling --------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void call2a(char c, float f1, short s, double d1, int i, float f2, long l,
            double d2) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2a>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  %xmm2,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movb   $0x61,-0x1(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movw   $0x5,-0xa(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movq   $0x7,-0x28(%rbp)
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2a(i8 signext %0, float %1, i16 signext %2, double %3, i32 %4, float %5, i64 %6, double %7) {
%9 = alloca i8
%10 = alloca float
%11 = alloca i16
%12 = alloca double
%13 = alloca i32
%14 = alloca float
%15 = alloca i64
%16 = alloca double
store i8 %0, i8* %9
store float %1, float* %10
store i16 %2, i16* %11
store double %3, double* %12
store i32 %4, i32* %13
store float %5, float* %14
store i64 %6, i64* %15
store double %7, double* %16
store i8 97, i8* %9
store float 0.000000e+00, float* %10
store i16 5, i16* %11
store double 0.000000e+00, double* %12
store i32 6, i32* %13
store float 0x3FB99999A0000000, float* %14
store i64 7, i64* %15
store double 2.000000e-01, double* %16
ret void
}

LLVM IR (-O2):
define void @call2a(i8 signext %0, float %1, i16 signext %2, double %3, i32 %4, float %5, i64 %6, double %7) {
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int count(struct TreeNode *);
int /*<<< orphan*/ helper(struct TreeNode *, int *, int *);
scalar_t__ malloc(int);
int *inorderTraversal(struct TreeNode *root, int *returnSize) {
  *returnSize = count(root);
  int *vals = (int *)malloc((*returnSize) * sizeof(int));
  int index = 0;
  helper(root, vals, &index);
  return vals;
}


x86 assembly (clang, -O0):
<inorderTraversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <helper@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inorderTraversal>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <count@plt>
mov    %eax,(%r14)
lea    0x0(,%rax,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <helper@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32* %1, i32** %4
%7 = load %struct.TreeNode*, %struct.TreeNode** %3
%8 = call i32 @count(%struct.TreeNode* %7)
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %5
store i32 0, i32* %6
%17 = load %struct.TreeNode*, %struct.TreeNode** %3
%18 = load i32*, i32** %5
%19 = call i32 @helper(%struct.TreeNode* %17, i32* %18, i32* %6)
%20 = load i32*, i32** %5
ret i32* %20
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal(%struct.TreeNode* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = tail call i32 @count(%struct.TreeNode* %0)
store i32 %4, i32* %1
%5 = shl i32 %4, 2
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = call i32 @helper(%struct.TreeNode* %0, i32* %7, i32* %3)
ret i32* %7
}
/* Variables and functions */
char *malloc(int);
char *allocate_string(int len) {
  char *s;
  s = malloc(sizeof(char) * len + 1);
  s[len] = 0;
  return s;
}


x86 assembly (clang, -O0):
<allocate_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_string>:
push   %rbx
movslq %edi,%rbx
lea    0x1(%rbx),%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocate_string(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 1, %5
%7 = add i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @allocate_string(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add i32 %0, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %5
ret i8* %4
}
int uksm_flags_can_scan(unsigned long vm_flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @uksm_flags_can_scan(i64 %0) {
ret i32 0
}
/* Type definitions */
struct nlattr {
  int dummy;
};

/* Variables and functions */
int memcmp(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ nla_data(struct nlattr const *);
size_t nla_len(struct nlattr const *);
int nla_memcmp(const struct nlattr *nla, const void *data, size_t size) {
  int d = nla_len(nla) - size;
  if (d == 0)
    d = memcmp(nla_data(nla), data, size);
  return d;
}


x86 assembly (clang, -O0):
<nla_memcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nla_len@plt>
sub    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1179 <nla_memcmp+0x49>
mov    -0x8(%rbp),%rdi
call   1050 <nla_data@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_memcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <nla_len@plt>
sub    %r15d,%eax
je     114e <nla_memcmp+0x1e>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
call   1050 <nla_data@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcmp@plt>

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_memcmp(%struct.nlattr* %0, i8* %1, i64 %2) {
%4 = alloca %struct.nlattr*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store %struct.nlattr* %0, %struct.nlattr** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.nlattr*, %struct.nlattr** %4
%9 = call i64 @nla_len(%struct.nlattr* %8)
%10 = load i64, i64* %6
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load %struct.nlattr*, %struct.nlattr** %4
%17 = call i32 @nla_data(%struct.nlattr* %16)
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = call i32 @memcmp(i32 %17, i8* %18, i64 %19)
store i32 %20, i32* %7
br label %21
21: ; preds = %15, %3
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_memcmp(%struct.nlattr* %0, i8* %1, i64 %2) {
%4 = tail call i64 @nla_len(%struct.nlattr* %0)
%5 = sub i64 %4, %2
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = tail call i32 @nla_data(%struct.nlattr* %0)
%10 = tail call i32 @memcmp(i32 %9, i8* %1, i64 %2)
br label %11
11: ; preds = %8, %3
%12 = phi i32 [ %10, %8 ], [ %6, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *malloc(int);
char *getpathbuffer(void) {
  char *buf;
  if (!(buf = malloc(1023 + 1)))
    (die("out of memory"));
  return buf;
}


x86 assembly (clang, -O0):
<getpathbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    114c <getpathbuffer+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpathbuffer>:
push   %rbx
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <getpathbuffer+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @getpathbuffer() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = icmp ne i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @getpathbuffer() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tgammaf();
scalar_t__ tgammaf(float);
void test_tgammaf(float f) {
  if (tgammaf(f) != tgammaf(f))
    link_failure_tgammaf();
}


x86 assembly (clang, -O0):
<test_tgammaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <tgammaf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <tgammaf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_tgammaf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_tgammaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tgammaf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <tgammaf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <tgammaf@plt>
cmp    %rax,%rbx
jne    1149 <test_tgammaf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_tgammaf@plt>

LLVM IR (-O0):
define void @test_tgammaf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @tgammaf(float %3)
%5 = load float, float* %2
%6 = call i64 @tgammaf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_tgammaf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_tgammaf(float %0) {
%2 = tail call i64 @tgammaf(float %0)
%3 = tail call i64 @tgammaf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tgammaf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
char *calloc(int, unsigned long);
char *bf_new(unsigned b) {
  char *bf = calloc(1, (((1UL << b) / 8) + (((1UL << b) % 8) ? 1 : 0)));
  return bf;
}


x86 assembly (clang, -O0):
<bf_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%rsi
shr    $0x3,%rsi
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
and    $0x7,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
add    %rax,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_new>:
mov    %edi,%ecx
mov    $0x1,%esi
shl    %cl,%rsi
shr    $0x3,%rsi
cmp    $0x3,%edi
adc    $0x0,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @bf_new(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = shl i64 1, %5
%7 = udiv i64 %6, 8
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
%11 = urem i64 %10, 8
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = sext i32 %14 to i64
%16 = add i64 %7, %15
%17 = call i8* @calloc(i32 1, i64 %16)
store i8* %17, i8** %3
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @bf_new(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw i64 1, %2
%4 = lshr i64 %3, 3
%5 = icmp ult i32 %0, 3
%6 = zext i1 %5 to i64
%7 = add nuw nsw i64 %4, %6
%8 = tail call i8* @calloc(i32 1, i64 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ compilerAssert();
void chpl_decRefCountsForDomainsInArrayEltTypes2(void) {
  compilerAssert();
  return;
}


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

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

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

LLVM IR (-O2):
define void @chpl_decRefCountsForDomainsInArrayEltTypes2() {
%1 = tail call i32 (...) @compilerAssert()
ret void
}