xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) signed __int128 t103_4add(signed __int128 x) {
  signed __int128 y =
      (((signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1)));
  signed __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_4add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    1174 <t103_4add+0x64>
jmp    117b <t103_4add+0x6b>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_4add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
adc    %rsi,%rbx
jno    1131 <t103_4add+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_4add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 170141183460469231731687303715884105727, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t103_4add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 170141183460469231731687303715884105727)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int, size_t);
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t n) {
  void *p;
  p = realloc(ptr, n);
  if (p == NULL)
    eprintf("realloc of %u bytes failed:",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/"
            "3rdparty/check/src/check_error.c",
            71 - 2, n);
  return p;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <erealloc+0x48>
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x45,%edx
call   1030 <eprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <erealloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x45,%edx
mov    %r14,%rcx
call   1030 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"realloc of %u bytes failed:\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/3rdparty/check/src/check_error.c\00"
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @eprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 69, i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"realloc of %u bytes failed:\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hugo303/check-ci/refs/heads/master/3rdparty/check/src/check_error.c\00"
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 69, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void tub_(unsigned char *const uba, int *const nub, unsigned char *const ub) {

  int j;
  *ub = 0;
  for (j = 0; j < *nub; j++)
    *ub = *ub + uba[j];
}


x86 assembly (clang, -O0):
<tub_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <tub_+0x58>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <tub_+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tub_>:
movb   $0x0,(%rdx)
cmpl   $0x0,(%rsi)
jle    1123 <tub_+0x23>
xor    %r8d,%r8d
xor    %ecx,%ecx
nopl   (%rax)
add    (%rdi,%rcx,1),%r8b
mov    %r8b,(%rdx)
add    $0x1,%rcx
movslq (%rsi),%rax
cmp    %rax,%rcx
jl     1110 <tub_+0x10>
ret

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

LLVM IR (-O2):
define void @tub_(i8* nocapture %0, i32* nocapture %1, i8* nocapture %2) {
store i8 0, i8* %2
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ 0, %3 ]
%8 = phi i64 [ %12, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = add i8 %10, %7
store i8 %11, i8* %2
%12 = add nuw nsw i64 %8, 1
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %3
ret void
}
void hwInitDeviceDrivers(void) {}


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

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

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

LLVM IR (-O2):
define void @hwInitDeviceDrivers() {
ret void
}
void foo191() {}


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

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

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

LLVM IR (-O2):
define void @foo191() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strtok(char *, char *);
char *read_user_input(char *buffer, int buffer_size) {
  fgets(buffer, buffer_size, stdin);
  return buffer = strtok(buffer, "\n");
}


x86 assembly (clang, -O0):
<read_user_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_user_input>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strtok@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define i8* @read_user_input(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 = load i32, i32* %4
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %5, i32 %6, i32 %7)
%9 = load i8*, i8** %3
%10 = call i8* @strtok(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
define i8* @read_user_input(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32 %3)
%5 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ mbs;

/* Variables and functions */
size_t mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                 int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
size_t mbstowcs(wchar_t *__restrict pwcs, const char *__restrict s, size_t n) {
  mbstate_t mbs;
  const char *sp;
  memset(&mbs, 0, sizeof(mbs));
  sp = s;
  return (mbsrtowcs(pwcs, &sp, n, &mbs));
}


x86 assembly (clang, -O0):
<mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1040 <mbsrtowcs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstowcs>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x14(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
mov    %r12,%rcx
call   1040 <mbsrtowcs@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @mbstowcs(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = call i32 @memset(i32* %7, i32 0, i32 4)
%10 = load i8*, i8** %5
store i8* %10, i8** %8
%11 = load i32*, i32** %4
%12 = load i64, i64* %6
%13 = call i64 @mbsrtowcs(i32* %11, i8** %8, i64 %12, i32* %7)
ret i64 %13
}

LLVM IR (-O2):
define i64 @mbstowcs(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = bitcast i32* %4 to i8*
%7 = bitcast i8** %5 to i8*
%8 = call i32 @memset(i32* %4, i32 0, i32 4)
store i8* %1, i8** %5
%9 = call i64 @mbsrtowcs(i32* %0, i8** %5, i64 %2, i32* %4)
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ AES_encrypt(unsigned char const *, unsigned char *,
                               int /*<<< orphan*/ const *);
void JTR_AES_encrypt(const unsigned char *in, unsigned char *out,
                     const AES_KEY *key) {
  AES_encrypt(in, out, key);
}


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

x86 assembly (clang, -O2):
<JTR_AES_encrypt>:
jmp    1030 <AES_encrypt@plt>

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

LLVM IR (-O2):
define void @JTR_AES_encrypt(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @AES_encrypt(i8* %0, i8* %1, i32* %2)
ret void
}
int test_imm_DCuint16_mem(unsigned short *val) {
  return ((*val) & (-0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff24,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCuint16_mem>:
movzwl (%rdi),%eax
test   $0xff24,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DCuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -220
%7 = icmp ne i32 %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_DCuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -220
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double stat_int_average(const int *v, int n) {
  assert(v);
  assert(n > 0);
  double s = stat_int_sum(v, n);
  return (s / n);
}


x86 assembly (clang, -O0):
<stat_int_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <stat_int_sum@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_int_average>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <assert@plt>
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
xor    %eax,%eax
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <stat_int_sum@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @stat_int_average(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %6)
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @stat_int_sum to i32 (i32*, i32, ...)*)(i32* %12, i32 %13)
%15 = sitofp i32 %14 to double
store double %15, double* %5
%16 = load double, double* %5
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fdiv double %16, %18
ret double %19
}

LLVM IR (-O2):
define double @stat_int_average(i32* %0, i32 %1) {
%3 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %0)
%4 = icmp sgt i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @stat_int_sum to i32 (i32*, i32, ...)*)(i32* %0, i32 %1)
%8 = sitofp i32 %7 to double
%9 = sitofp i32 %1 to double
%10 = fdiv double %8, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t read_FD_BE(int, int /*<<< orphan*/ *, int);
size_t uint64ReadFromFD(int fd, uint64_t *data) {
  return read_FD_BE(fd, data, sizeof(uint64_t));
}


x86 assembly (clang, -O0):
<uint64ReadFromFD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read_FD_BE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64ReadFromFD>:
mov    $0x4,%edx
jmp    1030 <read_FD_BE@plt>

LLVM IR (-O0):
define i64 @uint64ReadFromFD(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 i64 @read_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint64ReadFromFD(i32 %0, i32* %1) {
%3 = tail call i64 @read_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ clearInputBuffer();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void waitForEnter() {
  fflush(stdout);
  clearInputBuffer();
  char c = getc(stdin);
  while (c != '\n') {
    c = getc(stdin);
  }
}


x86 assembly (clang, -O0):
<waitForEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    $0x0,%al
call   1050 <clearInputBuffer@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1181 <waitForEnter+0x51>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %al,-0x1(%rbp)
jmp    115e <waitForEnter+0x2e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForEnter>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
call   1050 <clearInputBuffer@plt>
mov    0x2e9b(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edi
call   1040 <getc@plt>
cmp    $0xa,%al
jne    1150 <waitForEnter+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
define void @waitForEnter() {
%1 = alloca i8
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 (...) @clearInputBuffer()
%5 = load i32, i32* @stdin
%6 = call signext i8 @getc(i32 %5)
store i8 %6, i8* %1
br label %7
7: ; preds = %11, %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* @stdin
%13 = call signext i8 @getc(i32 %12)
store i8 %13, i8* %1
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define void @waitForEnter() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 (...) @clearInputBuffer()
%4 = load i32, i32* @stdin
%5 = tail call signext i8 @getc(i32 %4)
%6 = icmp eq i8 %5, 10
br i1 %6, label %11, label %7
7: ; preds = %0, %7
%8 = load i32, i32* @stdin
%9 = tail call signext i8 @getc(i32 %8)
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %7
11: ; preds = %7, %0
ret void
}
/* Type definitions */
typedef scalar_t__ memcmp;

/* Variables and functions */
void *(memstarts)(const void *string, const void *desired, size_t size) {
  return (memcmp)(string, desired, size) ? NULL : string;
}


x86 assembly (clang, -O0):
<memstarts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1126 <memstarts+0x26>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    112e <memstarts+0x2e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memstarts>:
xor    %eax,%eax
test   %rdx,%rdx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @memstarts(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %14
12: ; preds = %3
%13 = load i8*, i8** %4
br label %14
14: ; preds = %12, %11
%15 = phi i8* [ null, %11 ], [ %13, %12 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @memstarts(i8* readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, i8* %0, i8* null
ret i8* %5
}
/* Variables and functions */
scalar_t__ error();
int /*<<< orphan*/ memory_init(int);
void init_region() {
  memory_init(42);
  if (error()) {
    return;
  }
}


x86 assembly (clang, -O0):
<init_region>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <memory_init@plt>
mov    $0x0,%al
call   1040 <error@plt>
cmp    $0x0,%rax
je     1144 <init_region+0x24>
jmp    1144 <init_region+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_region>:
push   %rax
mov    $0x2a,%edi
call   1030 <memory_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <error@plt>

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

LLVM IR (-O2):
define void @init_region() {
%1 = tail call i32 @memory_init(i32 42)
%2 = tail call i64 (...) @error()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfree(char *);
void xfree(char *ap) {
  gfree(ap);
  return;
}


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

x86 assembly (clang, -O2):
<xfree>:
jmp    1030 <gfree@plt>

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = tail call i32 @gfree(i8* %0)
ret void
}
unsigned curposNext(const char *const str_top, unsigned curpos) {
  return curpos + (1);
}


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

x86 assembly (clang, -O2):
<curposNext>:
lea    0x1(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @curposNext(i8* nocapture readnone %0, i32 %1) {
%3 = add i32 %1, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
long I2SRxDataGetNonBlocking(unsigned long ulBase, unsigned long *pulData) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  if ((*((volatile unsigned long *)(ulBase + 0x00000818))) != 0) {
    *pulData = (*((volatile unsigned long *)(ulBase + 0x00000800)));
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2SRxDataGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x40054000,-0x10(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    0x818(%rax),%rax
cmp    $0x0,%rax
je     1169 <I2SRxDataGetNonBlocking+0x59>
mov    -0x10(%rbp),%rax
mov    0x800(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    1171 <I2SRxDataGetNonBlocking+0x61>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxDataGetNonBlocking>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x0,0x818(%rbx)
je     1147 <I2SRxDataGetNonBlocking+0x37>
mov    0x800(%rbx),%rax
mov    %rax,(%r14)
mov    $0x1,%eax
jmp    1149 <I2SRxDataGetNonBlocking+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @I2SRxDataGetNonBlocking(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 1074085888
%8 = zext i1 %7 to i32
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i64, i64* %4
%11 = add i64 %10, 2072
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i64, i64* %4
%17 = add i64 %16, 2048
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = load i64*, i64** %5
store i64 %19, i64* %20
store i64 1, i64* %3
br label %22
21: ; preds = %2
store i64 0, i64* %3
br label %22
22: ; preds = %21, %15
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @I2SRxDataGetNonBlocking(i64 %0, i64* nocapture writeonly %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 2072
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = add i64 %0, 2048
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store i64 %13, i64* %1
br label %14
14: ; preds = %2, %10
%15 = phi i64 [ 1, %10 ], [ 0, %2 ]
ret i64 %15
}
/* Type definitions */
typedef float const int32_t;

/* Variables and functions */
float float_from_i32(int32_t ival) {
  static const float scale = 1. / (float)(1UL << 31);
  return ival * scale;
}


x86 assembly (clang, -O0):
<float_from_i32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_from_i32>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
@float_from_i32.scale = internal constant float 0x3E00000000000000
define float @float_from_i32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3E00000000000000
ret float %4
}

LLVM IR (-O2):
define float @float_from_i32(float %0) {
%2 = fmul float %0, 0x3E00000000000000
ret float %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcrossing.serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xcrossing_serial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_serial>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xcrossing_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
double ddot_(int *, double const *, int *, double const *, int *);
double ddot(int n, const double *x, int incx, const double *y, int incy) {
  return ddot_(&n, x, &incx, y, &incy);
}


x86 assembly (clang, -O0):
<ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <ddot_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddot>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <ddot_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double*, double** %7
%12 = load double*, double** %9
%13 = call double @ddot_(i32* %6, double* %11, i32* %8, double* %12, i32* %10)
ret double %13
}

LLVM IR (-O2):
define double @ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call double @ddot_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void PrintString(char *sz) {
  if (sz == NULL)
    return;
  if (*sz == 0)
    return;
  printf("%c", *sz);
  PrintString(sz + 1);
}


x86 assembly (clang, -O0):
<PrintString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <PrintString+0x1c>
jmp    1171 <PrintString+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1151 <PrintString+0x31>
jmp    1171 <PrintString+0x51>
mov    -0x8(%rbp),%rax
lea    0xea4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <PrintString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintString>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <PrintString+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <PrintString+0x36>
add    $0x1,%rbx
lea    0xed3(%rip),%r14
nopl   (%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <PrintString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @PrintString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
br label %18
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %14)
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
br label %18
18: ; preds = %12, %11, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @PrintString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
void vec3_scale3(double *v1, const double *v2, double a) {
  v1[0] = a * v2[0];
  v1[1] = a * v2[1];
  v1[2] = a * v2[2];
}


x86 assembly (clang, -O0):
<vec3_scale3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_scale3>:
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec3_scale3(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fmul double %7, %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double, double* %6
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
%21 = load double, double* %6
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @vec3_scale3(double* nocapture writeonly %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fmul double %4, %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fmul double %11, %2
%13 = getelementptr inbounds double, double* %0, i64 2
store double %12, double* %13
ret void
}
__attribute__((no)) int foo(int n) {
  int x = 0;
  return n + 10;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xa(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}
long s_align_to(long size) {
  return ((size - 1) / ((0x4000000)) + 1) * ((0x4000000));
}


x86 assembly (clang, -O0):
<s_align_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    $0x4000000,%ecx
cqto
idiv   %rcx
add    $0x1,%rax
shl    $0x1a,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_align_to>:
lea    -0x1(%rdi),%rcx
lea    0x3fffffe(%rdi),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
and    $0xfffffffffc000000,%rax
add    $0x4000000,%rax
ret

LLVM IR (-O0):
define i64 @s_align_to(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
%5 = sdiv i64 %4, 67108864
%6 = add nsw i64 %5, 1
%7 = mul nsw i64 %6, 67108864
ret i64 %7
}

LLVM IR (-O2):
define i64 @s_align_to(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = sdiv i64 %2, 67108864
%4 = shl nsw i64 %3, 26
%5 = add i64 %4, 67108864
ret i64 %5
}
int test_imm_4Auint8_mem(unsigned char *val) {
  return ((*val) & (0x4A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Auint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Auint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 74
%7 = icmp ne i32 %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_4Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 74
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(int, int, int, int, int, int);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void resizeCB(int window_width, int window_height) {
  glViewport(0, 0, window_width, window_height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-1., 1., -1., 1., 1., -1.);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<resizeCB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    $0xffffffff,%r9d
mov    $0x1,%r8d
mov    %r9d,%edi
mov    %r8d,%esi
mov    %r9d,%edx
mov    %r8d,%ecx
call   1040 <glOrtho@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resizeCB>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <glViewport@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0xffffffff,%r9d
call   1040 <glOrtho@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resizeCB(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = call i32 @glOrtho(i32 -1, i32 1, i32 -1, i32 1, i32 1, i32 -1)
%12 = load i32, i32* @GL_MODELVIEW
%13 = call i32 @glMatrixMode(i32 %12)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resizeCB(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @glOrtho(i32 -1, i32 1, i32 -1, i32 1, i32 1, i32 -1)
%8 = load i32, i32* @GL_MODELVIEW
%9 = tail call i32 @glMatrixMode(i32 %8)
ret void
}
int fun137() { return 137; }


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

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

LLVM IR (-O0):
define i32 @fun137() {
ret i32 137
}

LLVM IR (-O2):
define i32 @fun137() {
ret i32 137
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ isblank(int);
scalar_t__ ispunct(int);
int isprint(int c) { return (isalnum(c) || ispunct(c) || isblank(c)); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isprint+0x51>
mov    -0x4(%rbp),%edi
call   1050 <ispunct@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1181 <isprint+0x51>
mov    -0x4(%rbp),%edi
call   1040 <isblank@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <isalnum@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115f <isprint+0x2f>
mov    %ebp,%edi
call   1050 <ispunct@plt>
test   %rax,%rax
jne    115f <isprint+0x2f>
mov    %ebp,%edi
call   1040 <isblank@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @ispunct(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @isblank(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @ispunct(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @isblank(i32 %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
long syscall4(long nr, long a1, long a2, long a3, long a4) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  register long r2 asm("rsi") = a2;
  register long r3 asm("rdx") = a3;
  register long r4 asm("r10") = a4;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%r10
syscall
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall4>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
syscall
ret

LLVM IR (-O0):
define i64 @syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%16 = load i64, i64* %6
store i64 %16, i64* %11
%17 = load i64, i64* %7
store i64 %17, i64* %12
%18 = load i64, i64* %8
store i64 %18, i64* %13
%19 = load i64, i64* %9
store i64 %19, i64* %14
%20 = load i64, i64* %10
store i64 %20, i64* %15
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = load i64, i64* %13
%24 = load i64, i64* %14
%25 = load i64, i64* %15
%26 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %21, i64 %22, i64 %23, i64 %24, i64 %25)
store i64 %26, i64* %11
%27 = load i64, i64* %11
ret i64 %27
}

LLVM IR (-O2):
define i64 @syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
void __delay(unsigned long loops) {
  unsigned long i;
  for (i = 0; i < loops; i++)
    ;
}


x86 assembly (clang, -O0):
<__delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1134 <__delay+0x34>
jmp    1123 <__delay+0x23>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <__delay+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__delay(i64 %0) {
ret void
}
void lif_write_phy_block(int output_device, int block, unsigned char *data) {}


x86 assembly (clang, -O0):
<lif_write_phy_block>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lif_write_phy_block(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
int do_506() { return 506; }


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

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

LLVM IR (-O0):
define i32 @do_506() {
ret i32 506
}

LLVM IR (-O2):
define i32 @do_506() {
ret i32 506
}
void CL_CharEvent(const char *key) {}


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

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

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

LLVM IR (-O2):
define void @CL_CharEvent(i8* nocapture %0) {
ret void
}