xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exitt();
void die(int status) { exitt(); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <exitt@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @die(i32 %0) {
%2 = tail call i32 (...) @exitt()
ret void
}
/* Variables and functions */
int daemonize(int, char **);
int main(int argc, char *argv[]) {
  int ret = daemonize(argc, argv);
  return ret;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <daemonize@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @daemonize(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ chown(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void c_chown_(char *path, uid_t *owner, gid_t *group, int lpath) {
  chown(path, *owner, *group);
}


x86 assembly (clang, -O0):
<c_chown_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <chown@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_chown_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <chown@plt>

LLVM IR (-O0):
define void @c_chown_(i8* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 @chown(i8* %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @c_chown_(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @chown(i8* %0, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *giveMeString(void) {
  char *str = malloc(sizeof(char) * 100);
  strcpy(str, "STRING!!!!");
  return str;
}


x86 assembly (clang, -O0):
<giveMeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<giveMeString>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"STRING!!!!\00"
define i8* @giveMeString() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [11 x i8] c"STRING!!!!\00"
define i8* @giveMeString() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void foo(__float128 *p, long double *q, long double *r) {
  *p = sinf128(*p);
  *q = __builtin_sinl(*q);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movaps (%rax),%xmm0
mov    $0x1,%al
call   1040 <sinf128@plt>
mov    %eax,%edi
call   1170 <__floatsitf>
mov    -0x8(%rbp),%rax
movaps %xmm0,(%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
add    $0x30,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps (%rdi),%xmm0
mov    $0x1,%al
call   1040 <sinf128@plt>
mov    %eax,%edi
call   1160 <__floatsitf>
movaps %xmm0,(%rbx)
fldt   (%r14)
fstpt  (%rsp)
call   1030 <sinl@plt>
fstpt  (%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @foo(fp128* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca fp128*
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
store fp128* %0, fp128** %4
store x86_fp80* %1, x86_fp80** %5
store x86_fp80* %2, x86_fp80** %6
%7 = load fp128*, fp128** %4
%8 = load fp128, fp128* %7
%9 = call i32 (fp128, ...) bitcast (i32 (...)* @sinf128 to i32 (fp128, ...)*)(fp128 %8)
%10 = sitofp i32 %9 to fp128
%11 = load fp128*, fp128** %4
store fp128 %10, fp128* %11
%12 = load x86_fp80*, x86_fp80** %5
%13 = load x86_fp80, x86_fp80* %12
%14 = call x86_fp80 @sinl(x86_fp80 %13)
%15 = load x86_fp80*, x86_fp80** %5
store x86_fp80 %14, x86_fp80* %15
ret void
}

LLVM IR (-O2):
define void @foo(fp128* nocapture %0, x86_fp80* nocapture %1, x86_fp80* nocapture readnone %2) {
%4 = load fp128, fp128* %0
%5 = tail call i32 (fp128, ...) bitcast (i32 (...)* @sinf128 to i32 (fp128, ...)*)(fp128 %4)
%6 = sitofp i32 %5 to fp128
store fp128 %6, fp128* %0
%7 = load x86_fp80, x86_fp80* %1
%8 = tail call x86_fp80 @sinl(x86_fp80 %7)
store x86_fp80 %8, x86_fp80* %1
ret void
}
/* Variables and functions */
char *mustFindVarData(char *);
char *cgiString(char *varName) { return mustFindVarData(varName); }


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

x86 assembly (clang, -O2):
<cgiString>:
jmp    1030 <mustFindVarData@plt>

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

LLVM IR (-O2):
define i8* @cgiString(i8* %0) {
%2 = tail call i8* @mustFindVarData(i8* %0)
ret i8* %2
}
int biosig_write_digital_samples(int handle, int *buf) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @biosig_write_digital_samples(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum = 0;
  for (int i = 1; i <= 100; i++) {
    sum += i;
  }
  printf("The sum of numbers from 1 to 100 is %d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"The sum of numbers from 1 to 100 is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"The sum of numbers from 1 to 100 is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test2_handler(int sig) { printf("CHILD: signal %d received\n", sig); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"CHILD: signal %d received\0A\00"
define void @test2_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"CHILD: signal %d received\0A\00"
define void @test2_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saved_callback();
void testSavedCallback() { saved_callback(); }


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

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

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

LLVM IR (-O2):
define void @testSavedCallback() {
%1 = tail call i32 (...) @saved_callback()
ret void
}
void hexdump(void *addr, int size) {}


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

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

LLVM IR (-O0):
define void @hexdump(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 @hexdump(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
bool isPrime(int n) {
  int i = 2;
  bool flag = true;
  do {
    if (n % i == 0)
      flag = false;
    i++;
  } while (flag == true && i <= n - 1);
  return flag;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    112c <isPrime+0x2c>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    1155 <isPrime+0x55>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1115 <isPrime+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
lea    -0x1(%rdi),%ecx
mov    $0x2,%esi
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1122 <isPrime+0x22>
lea    0x1(%rsi),%eax
cmp    %ecx,%esi
mov    %eax,%esi
jl     1110 <isPrime+0x10>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = add nsw i32 %0, -1
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 2, %1 ], [ %7, %3 ]
%5 = srem i32 %0, %4
%6 = icmp ne i32 %5, 0
%7 = add nuw nsw i32 %4, 1
%8 = icmp slt i32 %4, %2
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = zext i1 %6 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
char *get_str_8(FILE *fp) {
  char *s;
  int len = (unsigned char)fgetc(fp) + 1;
  s = (char *)malloc(len + 1);
  if (s != NULL) {
    fread(s, 1, len, fp);
    s[len] = '\0';
  }
  return s;
}


x86 assembly (clang, -O0):
<get_str_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
movzbl %al,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1189 <get_str_8+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_8>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <fgetc@plt>
movzbl %al,%r15d
lea    0x2(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     116e <get_str_8+0x3e>
add    $0x1,%r15
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_str_8(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @fgetc(i32* %5)
%7 = trunc i64 %6 to i8
%8 = zext i8 %7 to i32
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %25
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = load i32*, i32** %2
%20 = call i32 @fread(i8* %17, i32 1, i32 %18, i32* %19)
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %16, %1
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @get_str_8(i32* nocapture %0) {
%2 = tail call i64 @fgetc(i32* %0)
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 255
%5 = add nuw nsw i32 %4, 1
%6 = add nuw nsw i32 %4, 2
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i64 %7, 0
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = tail call i32 @fread(i8* %8, i32 1, i32 %5, i32* %0)
%12 = zext i32 %5 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %10, %1
ret i8* %8
}
void null_dereference_following_function_pointer_call_bad(
    int *(*fun_pointer)()) {
  int *p = fun_pointer();
  p = 0;
  *p = 42;
}


x86 assembly (clang, -O0):
<null_dereference_following_function_pointer_call_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_dereference_following_function_pointer_call_bad>:
push   %rax
xor    %eax,%eax
call   *%rdi

LLVM IR (-O0):
define void @null_dereference_following_function_pointer_call_bad(i32* (...)* %0) {
%2 = alloca i32* (...)*
%3 = alloca i32*
store i32* (...)* %0, i32* (...)** %2
%4 = load i32* (...)*, i32* (...)** %2
%5 = call i32* (...) %4()
store i32* %5, i32** %3
store i32* null, i32** %3
%6 = load i32*, i32** %3
store i32 42, i32* %6
ret void
}

LLVM IR (-O2):
define void @null_dereference_following_function_pointer_call_bad(i32* (...)* nocapture %0) {
%2 = tail call i32* (...) %0()
unreachable
}
/* Variables and functions */
scalar_t__ dominates(double *, double *, int);
int domination_cmp(double *a, double *b, int vlen) {
  if (dominates(a, b, vlen))
    return -1;
  else if (dominates(b, a, vlen))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<domination_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <dominates@plt>
cmp    $0x0,%rax
je     1149 <domination_cmp+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <domination_cmp+0x6b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <dominates@plt>
cmp    $0x0,%rax
je     116f <domination_cmp+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    117b <domination_cmp+0x6b>
jmp    1174 <domination_cmp+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domination_cmp>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <dominates@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1148 <domination_cmp+0x38>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <dominates@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @domination_cmp(double* %0, double* %1, i32 %2) {
%4 = tail call i64 @dominates(double* %0, double* %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @dominates(double* %1, double* %0, i32 %2)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
float myrandom(float max) {
  unsigned long const IM = 139968;
  unsigned long const IA = 3877;
  unsigned long const IC = 29573;
  static unsigned long last = 42;
  last = (last * IA + IC) % IM;
  return max * (long)last / IM;
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movq   $0x222c0,-0x10(%rbp)
movq   $0xf25,-0x18(%rbp)
movq   $0x7385,-0x20(%rbp)
imul   $0xf25,0x2ef4(%rip),%rax
add    $0x7385,%rax
mov    $0x222c0,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,0x2edd(%rip)
movss  -0x4(%rbp),%xmm0
cvtsi2ssq 0x2ecf(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea3(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
imul   $0xf25,0x2f15(%rip),%rcx
add    $0x7385,%rcx
movabs $0x3beead01fd6cbe91,%rdx
ad ee 3b
mov    %rcx,%rax
mul    %rdx
shr    $0xf,%rdx
imul   $0x222c0,%rdx,%rax
sub    %rax,%rcx
cvtsi2ss %ecx,%xmm1
mov    %rcx,0x2ee5(%rip)
mulss  %xmm1,%xmm0
divss  0xeb9(%rip),%xmm0
ret

LLVM IR (-O0):
@myrandom.last = internal global i64 42
define float @myrandom(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store float %0, float* %2
store i64 139968, i64* %3
store i64 3877, i64* %4
store i64 29573, i64* %5
%6 = load i64, i64* @myrandom.last
%7 = mul i64 %6, 3877
%8 = add i64 %7, 29573
%9 = urem i64 %8, 139968
store i64 %9, i64* @myrandom.last
%10 = load float, float* %2
%11 = load i64, i64* @myrandom.last
%12 = sitofp i64 %11 to float
%13 = fmul float %10, %12
%14 = fdiv float %13, 1.399680e+05
ret float %14
}

LLVM IR (-O2):
@myrandom.last = internal unnamed_addr global i64 42
define float @myrandom(float %0) {
%2 = load i64, i64* @myrandom.last
%3 = mul i64 %2, 3877
%4 = add i64 %3, 29573
%5 = urem i64 %4, 139968
store i64 %5, i64* @myrandom.last
%6 = sitofp i64 %5 to float
%7 = fmul float %6, %0
%8 = fdiv float %7, 1.399680e+05
ret float %8
}
/* Variables and functions */
int sh_map_compare_lexic(void const *, void const *);
int sh_set_compare_lexic(const void *s, const void *s2) {
  return sh_map_compare_lexic(s, s2);
}


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

x86 assembly (clang, -O2):
<sh_set_compare_lexic>:
jmp    1030 <sh_map_compare_lexic@plt>

LLVM IR (-O0):
define i32 @sh_set_compare_lexic(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 @sh_map_compare_lexic(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sh_set_compare_lexic(i8* %0, i8* %1) {
%3 = tail call i32 @sh_map_compare_lexic(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ count_bits_table();
int /*<<< orphan*/ rev_cmp_table();
int /*<<< orphan*/ rev_nibble_table();
int main() {
  rev_nibble_table();
  rev_cmp_table();
  count_bits_table();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <rev_nibble_table@plt>
mov    $0x0,%al
call   1040 <rev_cmp_table@plt>
mov    $0x0,%al
call   1030 <count_bits_table@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <rev_nibble_table@plt>
xor    %eax,%eax
call   1040 <rev_cmp_table@plt>
xor    %eax,%eax
call   1030 <count_bits_table@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rev_nibble_table()
%3 = call i32 (...) @rev_cmp_table()
%4 = call i32 (...) @count_bits_table()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @rev_nibble_table()
%2 = tail call i32 (...) @rev_cmp_table()
%3 = tail call i32 (...) @count_bits_table()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int ipv6Supported() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipv6Supported() {
ret i32 0
}
void U_WMRSETRELABS_print(const char *contents) { (void)(contents); }


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

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

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

LLVM IR (-O2):
define void @U_WMRSETRELABS_print(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *emalloc(int);
scalar_t__ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getTheDateISO() {
  char *date;
  time_t now;
  date = emalloc(2000);
  now = time(NULL);
  strftime(date, 2000, "%Y-%m-%d %H:%M:%S %Z", (struct tm *)localtime(&now));
  return date;
}


x86 assembly (clang, -O0):
<getTheDateISO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x7d0,%edi
call   1050 <emalloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rcx
mov    $0x7d0,%esi
lea    0xe7a(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTheDateISO>:
push   %rbx
sub    $0x10,%rsp
mov    $0x7d0,%edi
call   1050 <emalloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe92(%rip),%rdx
mov    %rbx,%rdi
mov    $0x7d0,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [21 x i8] c"%Y-%m-%d %H:%M:%S %Z\00"
define i8* @getTheDateISO() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @emalloc(i32 2000)
store i8* %3, i8** %1
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = load i8*, i8** %1
%6 = call i64 @localtime(i32* %2)
%7 = inttoptr i64 %6 to %struct.tm*
%8 = call i32 @strftime(i8* %5, i32 2000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [21 x i8] c"%Y-%m-%d %H:%M:%S %Z\00"
define i8* @getTheDateISO() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i8* @emalloc(i32 2000)
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call i64 @localtime(i32* %1)
%6 = inttoptr i64 %5 to %struct.tm*
%7 = call i32 @strftime(i8* %3, i32 2000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* %3
}
/* Variables and functions */
float RAND_MAX;
float cosf(double);
double logf(float);
scalar_t__ rand();
float sqrtf(double);
float randn() {
  return sqrtf(-2.0 * logf((float)rand() / RAND_MAX)) *
         cosf(2.0 * 3.141592653589793115997963468544 * (float)rand() /
              RAND_MAX);
}


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e8d(%rip),%rax
divss  (%rax),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2e48(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1040 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e90(%rip),%rbx
divss  (%rbx),%xmm0
call   1030 <logf@plt>
mulsd  0xe97(%rip),%xmm0
call   1050 <sqrtf@plt>
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1060 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe79(%rip),%xmm0
movss  (%rbx),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1040 <cosf@plt>
mulss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randn() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = call double @logf(float %4)
%6 = fmul double -2.000000e+00, %5
%7 = call float @sqrtf(double %6)
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = fpext float %9 to double
%11 = fmul double 0x401921FB54442D18, %10
%12 = load float, float* @RAND_MAX
%13 = fpext float %12 to double
%14 = fdiv double %11, %13
%15 = call float @cosf(double %14)
%16 = fmul float %7, %15
ret float %16
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randn() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = tail call double @logf(float %4)
%6 = fmul double %5, -2.000000e+00
%7 = tail call float @sqrtf(double %6)
%8 = tail call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = fpext float %9 to double
%11 = fmul double %10, 0x401921FB54442D18
%12 = load float, float* @RAND_MAX
%13 = fpext float %12 to double
%14 = fdiv double %11, %13
%15 = tail call float @cosf(double %14)
%16 = fmul float %7, %15
ret float %16
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int __test_same_longer() {
  void;
  if ((memcmp("foobar", "foo", 3)) == (0))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<__test_same_longer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1145 <__test_same_longer+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <__test_same_longer+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_same_longer>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"foobar\00"
@.str.1 = [4 x i8] c"foo\00"
define i32 @__test_same_longer() {
%1 = alloca i32
%2 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"foobar\00"
@.str.1 = [4 x i8] c"foo\00"
define i32 @__test_same_longer() {
%1 = tail call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__45__IO__selectModuleFunc();
void Msp430Adc12ImplP__Port65__selectModuleFunc(void) {
  HplMsp430GeneralIOP__45__IO__selectModuleFunc();
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @HammingDistance_C() {
ret void
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ car(struct object *);
struct object *cdr(struct object *);
struct object *cons(int /*<<< orphan*/, int /*<<< orphan*/);
struct object *prim_cons(struct object *args) {
  return cons(car(args), (car(cdr((args)))));
}


x86 assembly (clang, -O0):
<prim_cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <car@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1050 <car@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <cons@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_cons>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <car@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <cdr@plt>
mov    %rax,%rdi
call   1050 <car@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <cons@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @prim_cons(%struct.object* %0) {
%2 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%3 = load %struct.object*, %struct.object** %2
%4 = call i32 @car(%struct.object* %3)
%5 = load %struct.object*, %struct.object** %2
%6 = call %struct.object* @cdr(%struct.object* %5)
%7 = call i32 @car(%struct.object* %6)
%8 = call %struct.object* @cons(i32 %4, i32 %7)
ret %struct.object* %8
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @prim_cons(%struct.object* %0) {
%2 = tail call i32 @car(%struct.object* %0)
%3 = tail call %struct.object* @cdr(%struct.object* %0)
%4 = tail call i32 @car(%struct.object* %3)
%5 = tail call %struct.object* @cons(i32 %2, i32 %4)
ret %struct.object* %5
}
double im_mul_d(double re1, double im1, double re2, double im2) {
  return re1 * im2 + im1 * re2;
}


x86 assembly (clang, -O0):
<im_mul_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<im_mul_d>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @im_mul_d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
ret double %14
}

LLVM IR (-O2):
define double @im_mul_d(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %5)
ret double %6
}
int test_imm_F9int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F9int64_highword_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, 32
%6 = and i64 %5, 249
%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_F9int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1069446856704
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while (((*(volatile unsigned char *)(0x3CC00000 + 0x0 + 0x10)) & 0x4) == 0)
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x3cc00010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    113b <flush+0x2b>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
testb  $0x4,0x3cc00010
04
jne    1131 <flush+0x21>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x4,0x3cc00010
04
je     1120 <flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @barrier()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%2 = and i8 %1, 4
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%7 = and i8 %6, 4
%8 = icmp eq i8 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret void
}
/* Type definitions */
struct dirent {
  scalar_t__ d_type;
};

/* Variables and functions */
scalar_t__ DT_REG;
int regular_file_selector(const struct dirent *file) {
  return file->d_type == DT_REG;
}


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

x86 assembly (clang, -O2):
<regular_file_selector>:
mov    (%rdi),%rcx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
@DT_REG = global i64 0
define i32 @regular_file_selector(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @DT_REG
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
@DT_REG = global i64 0
define i32 @regular_file_selector(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DT_REG
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ quick_settings_view_deinit();
void phoneui_backend_quick_settings_deinit() { quick_settings_view_deinit(); }


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

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

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

LLVM IR (-O2):
define void @phoneui_backend_quick_settings_deinit() {
%1 = tail call i32 (...) @quick_settings_view_deinit()
ret void
}
void prune_int_by_pointer_Bad(int *p) {
  int *x = (int *)100;
  if (x == p) {
  }
  int a[5];
  a[5] = 0;
}


x86 assembly (clang, -O0):
<prune_int_by_pointer_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1124 <prune_int_by_pointer_Bad+0x24>
jmp    1124 <prune_int_by_pointer_Bad+0x24>
movl   $0x0,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_int_by_pointer_Bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [5 x i32]
store i32* %0, i32** %2
store i32* inttoptr (i64 100 to i32*), i32** %3
%5 = load i32*, i32** %3
%6 = load i32*, i32** %2
%7 = icmp eq i32* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 5
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @prune_int_by_pointer_Bad(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_uint16_t(uint16_t *const dest, uint16_t const src) {
  return (((*dest) = src), true);
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_uint16_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_start_duplex_streaming() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_call_start_duplex_streaming>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_duplex_streaming() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_duplex_streaming() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int fdc_map_type(int t) {
  switch (t) {
  case 2:
    return 0;
  case 4:
    return 1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<fdc_map_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     112c <fdc_map_type+0x2c>
jmp    111b <fdc_map_type+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1138 <fdc_map_type+0x38>
jmp    1144 <fdc_map_type+0x44>
movl   $0x0,-0x4(%rbp)
jmp    114b <fdc_map_type+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    114b <fdc_map_type+0x4b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdc_map_type>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
lea    (%rax,%rax,1),%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0x2,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fdc_map_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 2, label %5
i32 4, label %6
]
5: ; preds = %1
store i32 0, i32* %2
br label %8
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fdc_map_type(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = select i1 %2, i32 1, i32 -1
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
char *hash_plugin_summary(void) {
  return ("osxlion \tMacOSX Lion system passwords plugin");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"osxlion \09MacOSX Lion system passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"osxlion \09MacOSX Lion system passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
void ISRSVCall(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ISRSVCall>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ISRSVCall+0x9>
jmp    1109 <ISRSVCall+0x9>

x86 assembly (clang, -O2):
<ISRSVCall>:
jmp    1100 <ISRSVCall>

LLVM IR (-O0):
define void @ISRSVCall() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @ISRSVCall() {
br label %1
1: ; preds = %0, %1
br label %1
}
char *gettext(msgid) const char *msgid;
{ return gettext__(msgid); }


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

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

LLVM IR (-O0):
define i8* @gettext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @gettext__ to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @gettext(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @gettext__ to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}