xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void eval_int(int value) { fprintf(stderr, "%d", value); }


x86 assembly (clang, -O0):
<eval_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_int>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @eval_int(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int getTempDir(char *tempDir) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getTempDir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int tun_open_common(char *, int);
int tun_open(char *dev) { return tun_open_common(dev, 1); }


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

x86 assembly (clang, -O2):
<tun_open>:
mov    $0x1,%esi
jmp    1030 <tun_open_common@plt>

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

LLVM IR (-O2):
define i32 @tun_open(i8* %0) {
%2 = tail call i32 @tun_open_common(i8* %0, i32 1)
ret i32 %2
}
void remove_files(filec, filev) int filec;
char **filev;
{
  int i;
  for (i = 0; i < filec; i++)
    remove_one(filev[i]);
}


x86 assembly (clang, -O0):
<remove_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1153 <remove_files+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <remove_one@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <remove_files+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_files>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1144 <remove_files+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <remove_one@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <remove_files+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @remove_files(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @remove_one to i32 (i8*, ...)*)(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int is_prime(int num2, int num1) {
  int ans;
  while (1) {
    if (num1 < 1) {
      ans = -1;
      break;
    }
    if (num1 == num2) {
      ans = 1;
      break;
    } else if (num1 % num2 == 0) {
      ans = 0;
      break;
    } else
      num2++;
  }
  return ans;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1120 <is_prime+0x20>
movl   $0xffffffff,-0xc(%rbp)
jmp    1167 <is_prime+0x67>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1138 <is_prime+0x38>
movl   $0x1,-0xc(%rbp)
jmp    1167 <is_prime+0x67>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
jne    1154 <is_prime+0x54>
movl   $0x0,-0xc(%rbp)
jmp    1167 <is_prime+0x67>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <is_prime+0x62>
jmp    110a <is_prime+0xa>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
test   %esi,%esi
jle    1123 <is_prime+0x23>
mov    $0x1,%ecx
cmp    %esi,%edi
je     1120 <is_prime+0x20>
nopl   (%rax)
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1129 <is_prime+0x29>
add    $0x1,%edi
cmp    %edi,%esi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, %1
br i1 %5, label %13, label %8
6: ; preds = %8
%7 = icmp eq i32 %12, %1
br i1 %7, label %13, label %8
8: ; preds = %4, %6
%9 = phi i32 [ %12, %6 ], [ %0, %4 ]
%10 = srem i32 %1, %9
%11 = icmp eq i32 %10, 0
%12 = add nsw i32 %9, 1
br i1 %11, label %13, label %6
13: ; preds = %8, %6, %4, %2
%14 = phi i32 [ -1, %2 ], [ 1, %4 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ pedigree_reboot();
int main(void) {
  pedigree_reboot();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pedigree_reboot()
ret i32 0
}
int test0(void) {
  __attribute__((vector_size(16))) int a;
  return a[10];
}


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

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

LLVM IR (-O0):
define i32 @test0() {
%1 = alloca <4 x i32>
%2 = load <4 x i32>, <4 x i32>* %1
%3 = extractelement <4 x i32> %2, i32 10
ret i32 %3
}

LLVM IR (-O2):
define i32 @test0() {
ret i32 undef
}
int right(int i) { return (i << 1) + 2; }


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

x86 assembly (clang, -O2):
<right>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = shl i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fun(const int a) {
  int y = a;
  y += 5;
  printf("int: %20d\n", y);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0x5(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"int: %20d\0A\00"
define i32 @fun(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 5
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"int: %20d\0A\00"
define i32 @fun(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
void lst_append(void *lst, int v) {}


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

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

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

LLVM IR (-O2):
define void @lst_append(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *);
char *rdb_print_pool_stats(char *buf, int max_len) {
  int used = 0;
  snprintf(buf + used, max_len - used, "rDB pool record counting disabled");
  return (buf);
}


x86 assembly (clang, -O0):
<rdb_print_pool_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdb_print_pool_stats>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"rDB pool record counting disabled\00"
define i8* @rdb_print_pool_stats(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = call i32 @snprintf(i8* %9, i32 %12, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [34 x i8] c"rDB pool record counting disabled\00"
define i8* @rdb_print_pool_stats(i8* returned %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i8* %0
}
R0R1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ r0 = r1; }


x86 assembly (clang, -O0):
<R0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %9
store i16 %16, i16* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
ret i32 undef
}
void BIO_get_retry_reason(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_get_retry_reason() {
ret void
}
int test_imm_93int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x93 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_93int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x93,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_93int64_midword_mem>:
testb  $0x93,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_93int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 147
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_93int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9633792
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ doubles_copy(double const *, double *, int);
void doubles_xyt_copy(const double xyt[3], double r[3]) {
  doubles_copy(xyt, r, 3);
}


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

x86 assembly (clang, -O2):
<doubles_xyt_copy>:
mov    $0x3,%edx
jmp    1030 <doubles_copy@plt>

LLVM IR (-O0):
define void @doubles_xyt_copy(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 i32 @doubles_copy(double* %5, double* %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @doubles_xyt_copy(double* %0, double* %1) {
%3 = tail call i32 @doubles_copy(double* %0, double* %1, i32 3)
ret void
}
long double mixed_div(long long a, long double b, int c) { return a / b; }


x86 assembly (clang, -O0):
<mixed_div>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
fildll -0x30(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_div>:
fldt   0x8(%rsp)
mov    %rdi,-0x8(%rsp)
fildll -0x8(%rsp)
fdivp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @mixed_div(i64 %0, x86_fp80 %1, i32 %2) {
%4 = alloca i64
%5 = alloca x86_fp80
%6 = alloca i32
store i64 %0, i64* %4
store x86_fp80 %1, x86_fp80* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to x86_fp80
%9 = load x86_fp80, x86_fp80* %5
%10 = fdiv x86_fp80 %8, %9
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @mixed_div(i64 %0, x86_fp80 %1, i32 %2) {
%4 = sitofp i64 %0 to x86_fp80
%5 = fdiv x86_fp80 %4, %1
ret x86_fp80 %5
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", bitcount(80));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 80)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
const char *__attribute__((weak)) __attribute__((long_call)) __attribute__((no))
weak_l1(void) {
  return "weak_l1";
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"weak_l1\00"
define weak i8* @weak_l1() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
void tegra_gpu_config(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_gpu_config() {
ret void
}
int is_big_endian() {
  int a = 1;
  return !(int)(*(char *)(&a));
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
int FLOOR(float x) { return ((int)(x) - ((x) < 0.0f)); }


x86 assembly (clang, -O0):
<FLOOR>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLOOR>:
cvttss2si %xmm0,%eax
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FLOOR(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = load float, float* %2
%6 = fcmp olt float %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = sub nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @FLOOR(float %0) {
%2 = fptosi float %0 to i32
%3 = fcmp olt float %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = add i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *realloc_or_die(void *space, size_t nbytes) {
  void *result;
  result = realloc(space, nbytes);
  if (result == NULL) {
    perror("realloc or die");
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<realloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <realloc_or_die+0x3f>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_or_die>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <realloc_or_die+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"realloc or die\00"
define i8* @realloc_or_die(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"realloc or die\00"
define noalias i8* @realloc_or_die(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
const char *skipspace(const char *p) {
  while (isspace((unsigned char)*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
unsigned int NeAACDecGetCapabilities(void) {
  unsigned int cap = 0;
  cap += (1 << 0);
  cap += (1 << 1);
  cap += (1 << 2);
  cap += (1 << 3);
  cap += (1 << 4);
  return cap;
}


x86 assembly (clang, -O0):
<NeAACDecGetCapabilities>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @NeAACDecGetCapabilities() {
ret i32 31
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longdouble_prod_to_all(long double *target,
                                         long double *source, int nreduce,
                                         int PE_start, int logPE_stride,
                                         int PE_size, long double *pWrk,
                                         long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longdouble_prod_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_longdouble_prod_to_all(x86_fp80* %0, x86_fp80* %1, i32 %2, i32 %3, i32 %4, i32 %5, x86_fp80* %6, i64* %7) {
%9 = alloca x86_fp80*
%10 = alloca x86_fp80*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca x86_fp80*
%16 = alloca i64*
store x86_fp80* %0, x86_fp80** %9
store x86_fp80* %1, x86_fp80** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store x86_fp80* %6, x86_fp80** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longdouble_prod_to_all(x86_fp80* nocapture readnone %0, x86_fp80* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, x86_fp80* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sin(double);
__attribute__((__weak__, __always___)) double softboundmpx_sin(double x) {
  return sin(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_sin>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define weak double @softboundmpx_sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void clearScreen() {
  write(STDOUT_FILENO, "\x1b[2J", 4);
  write(STDOUT_FILENO, "\x1b[H", 3);
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
push   %rbx
mov    0x2ed8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
mov    $0x3,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clearScreen() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clearScreen() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tmkdir aname path\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: tmkdir aname path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: tmkdir aname path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
uint8_t spy_mach_read_from_1(unsigned char *b) {
  assert(b);
  return (uint8_t)(b[0]);
}


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

x86 assembly (clang, -O2):
<spy_mach_read_from_1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
movzbl (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @spy_mach_read_from_1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @spy_mach_read_from_1(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(void const *, void const *);
int comp_strings(const void *a, const void *b) { return strcmp(a, b); }


x86 assembly (clang, -O0):
<comp_strings>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_strings>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @comp_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int test_imm_16uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x16,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_16uint64_highword_mem>:
testb  $0x16,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_16uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 22
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_16uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 94489280512
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
void c_sigfillset_(sigset_t *set, int dmy) { sigfillset(set); }


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

x86 assembly (clang, -O2):
<c_sigfillset_>:
jmp    1030 <sigfillset@plt>

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

LLVM IR (-O2):
define void @c_sigfillset_(i32* %0, i32 %1) {
%3 = tail call i32 @sigfillset(i32* %0)
ret void
}
/* Variables and functions */
int gethostid();
int /*<<< orphan*/ printf(char *, int);
void main() { printf("%d\n", gethostid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gethostid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 (...) @gethostid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void datf_init(void) {}


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

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

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

LLVM IR (-O2):
define void @datf_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
void CopyFloats(const float *src, float *dst, int n) {
  memcpy(dst, src, n * sizeof(float));
}


x86 assembly (clang, -O0):
<CopyFloats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyFloats>:
mov    %rdi,%rax
shl    $0x2,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @CopyFloats(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %5
%8 = load float*, float** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(float* %7, float* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @CopyFloats(float* %0, float* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(float* %1, float* %0, i32 %4)
ret void
}
void opal_atomic_rmb(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @opal_atomic_rmb() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @opal_atomic_rmb() {
fence seq_cst
ret void
}
/* Variables and functions */
scalar_t__ memory_free(void *, char *, int);
int /*<<< orphan*/ sequence_clear(void *);
void sequence_release(void **S) {
  sequence_clear(*S);
  ((void)(memory_free((void *)(*S),
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/"
                      "heads/master/src/sequence.c",
                      105),
          (*S) = 0));
}


x86 assembly (clang, -O0):
<sequence_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <sequence_clear@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeba(%rip),%rsi
mov    $0x69,%edx
call   1040 <memory_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_release>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <sequence_clear@plt>
mov    (%rbx),%rdi
lea    0xeca(%rip),%rsi
mov    $0x69,%edx
call   1040 <memory_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/sequence.c\00"
define void @sequence_release(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @sequence_clear(i8* %4)
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i64 @memory_free(i8* %7, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 105)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
ret void
}

LLVM IR (-O2):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/sequence.c\00"
define void @sequence_release(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @sequence_clear(i8* %2)
%4 = load i8*, i8** %0
%5 = tail call i64 @memory_free(i8* %4, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 105)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, unsigned int);
void strncat_symbolic_limit(unsigned limit) {
  char dst[6] = "1234";
  char src[] = "567";
  strncat(dst, src, limit);
  if (strlen(dst) < 4)
    (void)*(char *)0;
  if (strlen(dst) == 4)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncat_symbolic_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0xe(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xe(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <strncat@plt>
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    116a <strncat_symbolic_limit+0x4a>
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    117c <strncat_symbolic_limit+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_symbolic_limit>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
movw   $0x0,0xc(%rsp)
movl   $0x34333231,0x8(%rsp)
34
movl   $0x373635,0x4(%rsp)
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strncat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strncat_symbolic_limit.dst = [6 x i8] c"1234\00\00"
@__const.strncat_symbolic_limit.src = [4 x i8] c"567\00"
define void @strncat_symbolic_limit(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = bitcast [6 x i8]* %3 to i8*
%6 = bitcast [4 x i8]* %4 to i8*
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @strncat(i8* %7, i8* %8, i32 %9)
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i8, i8* null
br label %16
16: ; preds = %14, %1
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i8, i8* null
br label %22
22: ; preds = %20, %16
ret void
}

LLVM IR (-O2):
@__const.strncat_symbolic_limit.dst = [6 x i8] c"1234\00\00"
define void @strncat_symbolic_limit(i32 %0) {
%2 = alloca [6 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
store i32 3618357, i32* %3
%6 = call i32 @strncat(i8* %4, i8* %5, i32 %0)
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @strlen(i8* %4)
ret void
}
int surface_pixel_bitoffset(const struct surface_t *surface, const int x,
                            const int y) {
  return y % 8;
}


x86 assembly (clang, -O0):
<surface_pixel_bitoffset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<surface_pixel_bitoffset>:
mov    %edx,%eax
lea    0x7(%rax),%ecx
test   %edx,%edx
cmovns %edx,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
%struct.surface_t = type opaque
define i32 @surface_pixel_bitoffset(%struct.surface_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.surface_t*
%5 = alloca i32
%6 = alloca i32
store %struct.surface_t* %0, %struct.surface_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = srem i32 %7, 8
ret i32 %8
}

LLVM IR (-O2):
%struct.surface_t = type opaque
define i32 @surface_pixel_bitoffset(%struct.surface_t* nocapture readnone %0, i32 %1, i32 %2) {
%4 = srem i32 %2, 8
ret i32 %4
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ numa_run_on_node_mask_v2_int(struct bitmask *);
int /*<<< orphan*/ numa_set_membind_v2_int(struct bitmask *);
void numa_bind_v2(struct bitmask *bmp) {
  numa_run_on_node_mask_v2_int(bmp);
  numa_set_membind_v2_int(bmp);
}


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

x86 assembly (clang, -O2):
<numa_bind_v2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <numa_run_on_node_mask_v2_int@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <numa_set_membind_v2_int@plt>

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define void @numa_bind_v2(%struct.bitmask* %0) {
%2 = alloca %struct.bitmask*
store %struct.bitmask* %0, %struct.bitmask** %2
%3 = load %struct.bitmask*, %struct.bitmask** %2
%4 = call i32 @numa_run_on_node_mask_v2_int(%struct.bitmask* %3)
%5 = load %struct.bitmask*, %struct.bitmask** %2
%6 = call i32 @numa_set_membind_v2_int(%struct.bitmask* %5)
ret void
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define void @numa_bind_v2(%struct.bitmask* %0) {
%2 = tail call i32 @numa_run_on_node_mask_v2_int(%struct.bitmask* %0)
%3 = tail call i32 @numa_set_membind_v2_int(%struct.bitmask* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("exit() test");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [12 x i8] c"exit() test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"exit() test\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int data[9] = {2, 1, 3, 4, 5, 4, 2, 8, 7};
  int res = maxProfit(data, 9);
  printf("最大利润:%d\n", res);
  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
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1050 <maxProfit@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    0xeda(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1050 <maxProfit@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.data = [9 x i32] [i32 2, i32 1, i32 3, i32 4, i32 5, i32 4, i32 2, i32 8, i32 7]
@.str.1 = [17 x i8] c"\E6\9C\80\E5\A4\A7\E5\88\A9\E6\B6\A6:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [9 x i32]* %6 to i8*
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%11 = call i32 @maxProfit(i32* %10, i32 9)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [9 x i32] [i32 2, i32 1, i32 3, i32 4, i32 5, i32 4, i32 2, i32 8, i32 7]
@.str.1 = [17 x i8] c"\E6\9C\80\E5\A4\A7\E5\88\A9\E6\B6\A6:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = bitcast [9 x i32]* %3 to i8*
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%7 = call i32 @maxProfit(i32* %6, i32 9)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}