xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ call_error(char const *);
int readlink(char const *, char *, int);
char *my_readlink(const char *lnk) {
  static char path[256 + 1];
  int n;
  if ((n = readlink(lnk, path, 256)) == -1) {
    call_error(lnk);
  }
  path[n] = '\0';
  return path;
}


x86 assembly (clang, -O0):
<my_readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f09(%rip),%rsi
mov    $0x100,%edx
call   1030 <readlink@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1156 <my_readlink+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <call_error@plt>
movslq -0xc(%rbp),%rcx
lea    0x2edf(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ed4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_readlink>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0x2f12(%rip),%r14
mov    %r14,%rsi
mov    $0x100,%edx
call   1030 <readlink@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    114a <my_readlink+0x2a>
mov    %rbx,%rdi
call   1040 <call_error@plt>
movslq %ebp,%rax
movb   $0x0,(%rax,%r14,1)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@my_readlink.path = internal global [257 x i8] zeroinitializer
define i8* @my_readlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @readlink(i8* %4, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 0), i32 256)
store i32 %5, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @call_error(i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 %12
store i8 0, i8* %13
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 0)
}

LLVM IR (-O2):
@my_readlink.path = internal global [257 x i8] zeroinitializer
define i8* @my_readlink(i8* %0) {
%2 = tail call i32 @readlink(i8* %0, i8* getelementptr inbounds ([257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 0), i32 256)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @call_error(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 %7
store i8 0, i8* %8
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @my_readlink.path, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_truncf();
scalar_t__ truncf(float);
void test_truncf(float f) {
  if (truncf(f) != truncf(f))
    link_failure_truncf();
}


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

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

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

LLVM IR (-O2):
define void @test_truncf(float %0) {
%2 = tail call i64 @truncf(float %0)
%3 = tail call i64 @truncf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_truncf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int gen_posix_cond_init(pthread_cond_t *cond, pthread_condattr_t *attr) {
  return pthread_cond_init(cond, attr);
}


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

x86 assembly (clang, -O2):
<gen_posix_cond_init>:
jmp    1030 <pthread_cond_init@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_cond_init(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_init(i32* %0, i32* %1)
ret i32 %3
}
void *thread_function(void *arg) {
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)

x86 assembly (clang, -O2):
<thread_function>:
call   1030 <x86_trace_dummy@plt>
ret

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

LLVM IR (-O2):
define i8* @thread_function(i8* nocapture readnone %0) {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ dgetri_(int *, double *, int *, int *, double *, int *,
                           int *);
void dgetri(int n, double *a, int lda, int *ipiv, double *work, int lwork,
            int *info) {
  dgetri_(&n, a, &lda, ipiv, work, &lwork, info);
}


x86 assembly (clang, -O0):
<dgetri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    0x10(%rbp),%rax
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x2c(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <dgetri_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgetri>:
sub    $0x18,%rsp
mov    0x20(%rsp),%rax
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r9d,0xc(%rsp)
mov    %rax,(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r9
call   1030 <dgetri_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dgetri(i32 %0, double* %1, i32 %2, i32* %3, double* %4, i32 %5, i32* %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32*
store i32 %0, i32* %8
store double* %1, double** %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store double* %4, double** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load double*, double** %9
%16 = load i32*, i32** %11
%17 = load double*, double** %12
%18 = load i32*, i32** %14
%19 = call i32 @dgetri_(i32* %8, double* %15, i32* %10, i32* %16, double* %17, i32* %13, i32* %18)
ret void
}

LLVM IR (-O2):
define void @dgetri(i32 %0, double* %1, i32 %2, i32* %3, double* %4, i32 %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %8
store i32 %2, i32* %9
store i32 %5, i32* %10
%11 = call i32 @dgetri_(i32* %8, double* %1, i32* %9, i32* %3, double* %4, i32* %10, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eoutdent();
scalar_t__ is_verbose();
void eoutdentv(void) {
  if (is_verbose())
    eoutdent();
}


x86 assembly (clang, -O0):
<eoutdentv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <is_verbose@plt>
cmp    $0x0,%rax
je     113c <eoutdentv+0x1c>
mov    $0x0,%al
call   1030 <eoutdent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoutdentv>:
push   %rax
xor    %eax,%eax
call   1040 <is_verbose@plt>
test   %rax,%rax
je     1135 <eoutdentv+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <eoutdent@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @eoutdentv() {
%1 = call i64 (...) @is_verbose()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @eoutdent()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @eoutdentv() {
%1 = tail call i64 (...) @is_verbose()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @eoutdent()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int main() {
  FILE *out;
  out = fopen("output.s", "w");
  fprintf(out,
          "    .text"
          "\n"
          "    .globl scheme_entry"
          "\n"
          "    .type scheme_entry, @function"
          "\n"
          "scheme_entry:"
          "\n"
          "    movl $%i, %%eax"
          "\n"
          "    ret"
          "\n",
          0x3F);
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x3f,%edx
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rsi
mov    %rax,%rdi
mov    $0x3f,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"output.s\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [111 x i8] c" .text\0A .globl scheme_entry\0A .type scheme_entry, @function\0Ascheme_entry:\0A movl $%i, %%eax\0A ret\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i32 63)
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"output.s\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [111 x i8] c" .text\0A .globl scheme_entry\0A .type scheme_entry, @function\0Ascheme_entry:\0A movl $%i, %%eax\0A ret\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i32 63)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ findmaxmin(int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int v = 12345, max, min;
  findmaxmin(v, &max, &min);
  printf("V=%d  max=%d min=%d\n", v, max, min);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3039,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <findmaxmin@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x3039,%edi
call   1040 <findmaxmin@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
lea    0xebf(%rip),%rdi
mov    $0x3039,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"V=%d max=%d min=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 12345, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @findmaxmin(i32 %4, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"V=%d max=%d min=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @findmaxmin(i32 12345, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 12345, i32 %6, i32 %7)
ret i32 0
}
int __attribute__((weak)) weak() { return 1; }


x86 assembly (clang, -O0):
<weak>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define weak i32 @weak() {
ret i32 1
}

LLVM IR (-O2):
define weak i32 @weak() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void format(void) {
  fprintf(
      stderr,
      "Usage: sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sink(char *);
void vla_int_memset(int n) {
  char a[13 < n ? 13 : n];
  memset(a, 0, 14);
  sink(a);
  memset(a, 0, 13);
  sink(a);
}


x86 assembly (clang, -O0):
<vla_int_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xd,%eax
cmp    -0x4(%rbp),%eax
jge    1146 <vla_int_memset+0x26>
mov    $0xd,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <vla_int_memset+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    $0xe,%edx
call   1030 <memset@plt>
mov    -0x28(%rbp),%rdi
call   1040 <sink@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1030 <memset@plt>
mov    -0x28(%rbp),%rdi
call   1040 <sink@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vla_int_memset>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
cmp    $0xd,%edi
mov    $0xd,%eax
cmovge %eax,%edi
add    $0xf,%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rsp,%rbx
sub    %rdi,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xe,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <sink@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <sink@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @vla_int_memset(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 13, %5
br i1 %6, label %7, label %8
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 13, %7 ], [ %9, %8 ]
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %3
%14 = alloca i8, i64 %12
store i64 %12, i64* %4
%15 = call i32 @memset(i8* %14, i32 0, i32 14)
%16 = call i32 @sink(i8* %14)
%17 = call i32 @memset(i8* %14, i32 0, i32 13)
%18 = call i32 @sink(i8* %14)
%19 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla_int_memset(i32 %0) {
%2 = icmp slt i32 %0, 13
%3 = select i1 %2, i32 %0, i32 13
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @memset(i8* %5, i32 0, i32 14)
%7 = call i32 @sink(i8* %5)
%8 = call i32 @memset(i8* %5, i32 0, i32 13)
%9 = call i32 @sink(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpu6050_dmpEnable();
int /*<<< orphan*/ mpu6050_dmpInitalize();
int /*<<< orphan*/ sei();
int main(void) {
  mpu6050_dmpInitalize();
  mpu6050_dmpEnable();
  sei();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpu6050_dmpInitalize@plt>
mov    $0x0,%al
call   1040 <mpu6050_dmpEnable@plt>
mov    $0x0,%al
call   1050 <sei@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @mpu6050_dmpInitalize()
%2 = call i32 (...) @mpu6050_dmpEnable()
%3 = call i32 (...) @sei()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mpu6050_dmpInitalize()
%2 = tail call i32 (...) @mpu6050_dmpEnable()
%3 = tail call i32 (...) @sei()
ret i32 0
}
/* Type definitions */
struct dive_site_table {
  int dummy;
};
struct dive_site {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_dive_site_to_table(struct dive_site *,
                                          struct dive_site_table *);
struct dive_site *alloc_dive_site_with_name(char const *);
struct dive_site *create_dive_site(const char *name,
                                   struct dive_site_table *ds_table) {
  struct dive_site *ds = alloc_dive_site_with_name(name);
  add_dive_site_to_table(ds, ds_table);
  return ds;
}


x86 assembly (clang, -O0):
<create_dive_site>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <alloc_dive_site_with_name@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add_dive_site_to_table@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dive_site>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <alloc_dive_site_with_name@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <add_dive_site_to_table@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dive_site = type { i32 }
%struct.dive_site_table = type { i32 }
define %struct.dive_site* @create_dive_site(i8* %0, %struct.dive_site_table* %1) {
%3 = alloca i8*
%4 = alloca %struct.dive_site_table*
%5 = alloca %struct.dive_site*
store i8* %0, i8** %3
store %struct.dive_site_table* %1, %struct.dive_site_table** %4
%6 = load i8*, i8** %3
%7 = call %struct.dive_site* @alloc_dive_site_with_name(i8* %6)
store %struct.dive_site* %7, %struct.dive_site** %5
%8 = load %struct.dive_site*, %struct.dive_site** %5
%9 = load %struct.dive_site_table*, %struct.dive_site_table** %4
%10 = call i32 @add_dive_site_to_table(%struct.dive_site* %8, %struct.dive_site_table* %9)
%11 = load %struct.dive_site*, %struct.dive_site** %5
ret %struct.dive_site* %11
}

LLVM IR (-O2):
%struct.dive_site = type { i32 }
%struct.dive_site_table = type { i32 }
define %struct.dive_site* @create_dive_site(i8* %0, %struct.dive_site_table* %1) {
%3 = tail call %struct.dive_site* @alloc_dive_site_with_name(i8* %0)
%4 = tail call i32 @add_dive_site_to_table(%struct.dive_site* %3, %struct.dive_site_table* %1)
ret %struct.dive_site* %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
void settimeout(struct timeval *tmv, int ms) {
  if (ms > 5 && 0) {
    tmv->tv_sec = 0;
    tmv->tv_usec = 5000;
  } else {
    tmv->tv_sec = ms / 1000;
    tmv->tv_usec = 1000 * (ms % 1000);
  }
}


x86 assembly (clang, -O0):
<settimeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    113e <settimeout+0x3e>
xor    %eax,%eax
test   $0x1,%al
jne    1124 <settimeout+0x24>
jmp    113e <settimeout+0x3e>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1388,0x4(%rax)
jmp    1169 <settimeout+0x69>
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<settimeout>:
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rdi)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @settimeout(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %2
br i1 false, label %8, label %13
8: ; preds = %7
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i32 0, i32* %10
%11 = load %struct.timeval*, %struct.timeval** %3
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i32 5000, i32* %12
br label %23
13: ; preds = %7, %2
%14 = load i32, i32* %4
%15 = sdiv i32 %14, 1000
%16 = load %struct.timeval*, %struct.timeval** %3
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
store i32 %15, i32* %17
%18 = load i32, i32* %4
%19 = srem i32 %18, 1000
%20 = mul nsw i32 1000, %19
%21 = load %struct.timeval*, %struct.timeval** %3
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 1
store i32 %20, i32* %22
br label %23
23: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @settimeout(%struct.timeval* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 1000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %1, 1000
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fpu_main();
int get_pid();
int /*<<< orphan*/ report_subtest(int);
int /*<<< orphan*/ set_fsr(int /*<<< orphan*/);
int /*<<< orphan*/ setpsr(int);
int xgetpsr();
fputest() {
  int tmp;
  tmp = xgetpsr();
  setpsr(tmp | (1 << 12));
  tmp = xgetpsr();
  if (!(tmp & (1 << 12)))
    return (0);
  set_fsr(0);
  report_subtest(8 + (get_pid() << 4));
  fpu_main();
}


x86 assembly (clang, -O0):
<fputest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <xgetpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
or     $0x1000,%edi
call   1070 <setpsr@plt>
mov    $0x0,%al
call   1060 <xgetpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
jne    11a7 <fputest+0x47>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <fputest+0x69>
xor    %edi,%edi
call   1030 <set_fsr@plt>
mov    $0x0,%al
call   1080 <get_pid@plt>
mov    %eax,%edi
shl    $0x4,%edi
add    $0x8,%edi
call   1040 <report_subtest@plt>
mov    $0x0,%al
call   1050 <fpu_main@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputest>:
push   %rax
xor    %eax,%eax
call   1060 <xgetpsr@plt>
or     $0x1000,%eax
mov    %eax,%edi
call   1070 <setpsr@plt>
xor    %eax,%eax
call   1060 <xgetpsr@plt>
test   $0x1000,%eax
je     11a2 <fputest+0x42>
xor    %edi,%edi
call   1030 <set_fsr@plt>
xor    %eax,%eax
call   1080 <get_pid@plt>
shl    $0x4,%eax
lea    0x8(%rax),%edi
call   1040 <report_subtest@plt>
xor    %eax,%eax
call   1050 <fpu_main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputest() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @xgetpsr()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %4, 4096
%6 = call i32 @setpsr(i32 %5)
%7 = call i32 (...) @xgetpsr()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 4096
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %0
store i32 0, i32* %1
br label %19
12: ; preds = %0
%13 = call i32 @set_fsr(i32 0)
%14 = call i32 (...) @get_pid()
%15 = shl i32 %14, 4
%16 = add nsw i32 8, %15
%17 = call i32 @report_subtest(i32 %16)
%18 = call i32 (...) @fpu_main()
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @fputest() {
%1 = tail call i32 (...) @xgetpsr()
%2 = or i32 %1, 4096
%3 = tail call i32 @setpsr(i32 %2)
%4 = tail call i32 (...) @xgetpsr()
%5 = and i32 %4, 4096
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = tail call i32 @set_fsr(i32 0)
%9 = tail call i32 (...) @get_pid()
%10 = shl i32 %9, 4
%11 = or i32 %10, 8
%12 = tail call i32 @report_subtest(i32 %11)
%13 = tail call i32 (...) @fpu_main()
br label %14
14: ; preds = %0, %7
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, void const *, size_t);
ssize_t restartableWrite(int fd, const void *buf, size_t count) {
  ssize_t result;
  do {
    do {
      result = write(fd, buf, count);
    } while ((result == -1) && (errno == EINTR));
  } while (0);
  return result;
}


x86 assembly (clang, -O0):
<restartableWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1128 <restartableWrite+0x18>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1164 <restartableWrite+0x54>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1128 <restartableWrite+0x18>
jmp    1174 <restartableWrite+0x64>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restartableWrite>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <restartableWrite+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <restartableWrite+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @restartableWrite(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
int ind(int j, int d[], int k) {
  int i;
  for (i = 0; i < k; i++)
    if (d[i] == j)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <ind+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <ind+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <ind+0x5b>
jmp    1146 <ind+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <ind+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
test   %edx,%edx
jle    111e <ind+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <ind+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <ind+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ind(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void foo2(void) {
  typedef int(*arrayptr)[];
  arrayptr x = 0;
  arrayptr y = &*x;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo2() {
%1 = alloca [0 x i32]*
%2 = alloca [0 x i32]*
store [0 x i32]* null, [0 x i32]** %1
%3 = load [0 x i32]*, [0 x i32]** %1
store [0 x i32]* %3, [0 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @foo2() {
ret void
}
int CmpDouble(const void *dptr1, const void *dptr2) {
  if (*(const double *)dptr1 > *(const double *)dptr2) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<CmpDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <CmpDouble+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <CmpDouble+0x35>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmpDouble>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @CmpDouble(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @CmpDouble(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
int HTTPWrapperSSLSend(int s, char *buf, int len, int flags) { return -1; }


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

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

LLVM IR (-O0):
define i32 @HTTPWrapperSSLSend(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @HTTPWrapperSSLSend(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ saveMultipleEntries(int, int);
void saveOneEntry(int position) { saveMultipleEntries(position, 1); }


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

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

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

LLVM IR (-O2):
define void @saveOneEntry(i32 %0) {
%2 = tail call i32 @saveMultipleEntries(i32 %0, i32 1)
ret void
}
/* Variables and functions */
int _pipe(int *);
int pipe(int _fildes[2]) { return _pipe(_fildes); }


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

x86 assembly (clang, -O2):
<pipe>:
jmp    1030 <_pipe@plt>

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

LLVM IR (-O2):
define i32 @pipe(i32* %0) {
%2 = tail call i32 @_pipe(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
bool success_with_prob(float prob) {
  int prob_precision = 1000000000;
  assert(prob <= 1 && prob >= 0);
  int prob_int = (int)(prob * prob_precision);
  return ((rand() % prob_precision) < prob_int);
}


x86 assembly (clang, -O0):
<success_with_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x3b9aca00,-0x8(%rbp)
xor    %eax,%eax
movss  0xec2(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0xd(%rbp)
jb     115c <success_with_prob+0x3c>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x8(%rbp)
cmp    -0xc(%rbp),%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<success_with_prob>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
movss  0xecd(%rip),%xmm1
ucomiss %xmm0,%xmm1
setae  %al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movss  0xc(%rsp),%xmm0
mulss  0xeaa(%rip),%xmm0
cvttss2si %xmm0,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rcx
imul   $0x44b82fa1,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x3c,%rax
add    %edx,%eax
imul   $0x3b9aca00,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setl   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @success_with_prob(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
store i32 1000000000, i32* %3
%5 = load float, float* %2
%6 = fcmp ole float %5, 1.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %2
%9 = fcmp oge float %8, 0.000000e+00
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ false, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load float, float* %2
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to float
%17 = fmul float %14, %16
%18 = fptosi float %17 to i32
store i32 %18, i32* %4
%19 = call i32 (...) @rand()
%20 = load i32, i32* %3
%21 = srem i32 %19, %20
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @success_with_prob(float %0) {
%2 = fcmp ole float %0, 1.000000e+00
%3 = fcmp oge float %0, 0.000000e+00
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fmul float %0, 1.000000e+09
%8 = fptosi float %7 to i32
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 1000000000
%11 = icmp slt i32 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ network_init();
int main(int argc, char *argv[]) { network_init(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sds_munmap(void *);
uint32_t cma_munmap(void *buf, uint32_t len) {
  sds_munmap(buf);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @cma_munmap(i8* %0, i32 %1) {
%3 = tail call i32 @sds_munmap(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *, char const *);
void CL_UIModule_Print(const char *msg) { Com_Printf("%s", msg); }


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

x86 assembly (clang, -O2):
<CL_UIModule_Print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <Com_Printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @CL_UIModule_Print(i8* %0) {
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_5Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x5A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Auint64_midword_reg>:
test   $0x5a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5898240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *x = (char *)malloc(10 * sizeof(char));
  free(x);
  return x[5];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
movsbl 0x5(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8, i8* %2, i64 5
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
int GoogleHotwordDspGetMaximumAudioPreambleMs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GoogleHotwordDspGetMaximumAudioPreambleMs() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void plain_number(FILE *f, const char **opts, double d) {
  fprintf(f, "%g\n", d);
}


x86 assembly (clang, -O0):
<plain_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plain_number>:
lea    0xee9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define void @plain_number(i32* %0, i8** %1, double %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca double
store i32* %0, i32** %4
store i8** %1, i8*** %5
store double %2, double* %6
%7 = load i32*, i32** %4
%8 = load double, double* %6
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define void @plain_number(i32* nocapture %0, i8** nocapture readnone %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
void f10() { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<f10>:
ud2

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

LLVM IR (-O2):
define void @f10() {
tail call void @llvm.trap()
unreachable
}
unsigned short swap16(unsigned short val) { return (val >> 8) | (val << 8); }


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @swap16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @swap16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void XStoreNamedColor() {}


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

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

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

LLVM IR (-O2):
define void @XStoreNamedColor() {
ret void
}
void module_put(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @module_put(%struct.module* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PDCWrite(int, int);
void PDCLCDBacklightOff(void) { PDCWrite(0x1, 0x00); }


x86 assembly (clang, -O0):
<PDCLCDBacklightOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <PDCWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCLCDBacklightOff>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <PDCWrite@plt>

LLVM IR (-O0):
define void @PDCLCDBacklightOff() {
%1 = call i32 @PDCWrite(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @PDCLCDBacklightOff() {
%1 = tail call i32 @PDCWrite(i32 1, i32 0)
ret void
}
unsigned int *get_exp(float f) {
  unsigned int *fi = &f;
  unsigned int frac = (*fi & 0x7F800000);
  return frac;
}


x86 assembly (clang, -O0):
<get_exp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7f800000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exp>:
movd   %xmm0,%eax
and    $0x7f800000,%eax
ret

LLVM IR (-O0):
define i32* @get_exp(float %0) {
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32
store float %0, float* %2
%5 = bitcast float* %2 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = and i32 %7, 2139095040
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @get_exp(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2139095040
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}