xunge/DecIR huggingface dataset:
char *my_strcpy(char *src, char *dest) {
  int i = 0;
  do {
    dest[i] = src[i];
    i++;
  } while (src[i] != 0);
  return dest;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1113 <my_strcpy+0x13>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rsi,%rax
mov    (%rdi),%cl
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %10, %4 ], [ %3, %2 ]
%6 = phi i64 [ %8, %4 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %5, i8* %7
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4
ret i8* %1
}
void xor (struct forth_instance * fi) { st_push(fi, st_pop(fi) ^ st_pop(fi)); }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <st_pop@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <st_pop@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
xor    %eax,%esi
mov    $0x0,%al
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <st_pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <st_pop@plt>
xor    %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type opaque
define void @xor(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %4)
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %6)
%8 = xor i32 %5, %7
%9 = call i32 (%struct.forth_instance*, i32, ...) bitcast (i32 (...)* @st_push to i32 (%struct.forth_instance*, i32, ...)*)(%struct.forth_instance* %3, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type opaque
define void @xor(%struct.forth_instance* %0) {
%2 = tail call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %0)
%3 = tail call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %0)
%4 = xor i32 %3, %2
%5 = tail call i32 (%struct.forth_instance*, i32, ...) bitcast (i32 (...)* @st_push to i32 (%struct.forth_instance*, i32, ...)*)(%struct.forth_instance* %0, i32 %4)
ret void
}
OP(dd, d6) { op_d6(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d6@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d6()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double ***double_alloc3p(int n) {
  double ***v;
  if ((v = (double ***)malloc(n * sizeof(double **))) == NULL) {
    fprintf(stderr, "FATAL ERROR: Out of memory\n");
    exit(1);
  }
  return v;
}


x86 assembly (clang, -O0):
<double_alloc3p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1177 <double_alloc3p+0x47>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_alloc3p>:
push   %rax
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <double_alloc3p+0x10>
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define double*** @double_alloc3p(i32 %0) {
%2 = alloca i32
%3 = alloca double***
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double***
store double*** %9, double**** %3
%10 = icmp eq double*** %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load double***, double**** %3
ret double*** %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define double*** @double_alloc3p(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %3 to double***
ret double*** %10
}
extern void put_fs_word(short val, short *addr) {
  __asm__("movw %0,%%fs:%1" ::"q"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_fs_word>:
mov    %di,%fs:(%rsi)
ret

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

LLVM IR (-O2):
define void @put_fs_word(i16 signext %0, i16* %1) {
tail call void asm sideeffect "movw $0,%fs:$1", "q,*m,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %1)
ret void
}
void I422ToARGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGBRow_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void main() {
  if (1) {
    f(1);
  }
  f(3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x3,%edi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 1)
%2 = call i32 @f(i32 3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 3)
ret void
}
double Function10Double(double a, double b, double c, double d, double e,
                        double f, double g, double h, double i, double j) {
  return a + b + c + d + e + f + g + h + i + j;
}


x86 assembly (clang, -O0):
<Function10Double>:
push   %rbp
mov    %rsp,%rbp
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
addsd  0x10(%rbp),%xmm0
addsd  0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function10Double>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
addsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @Function10Double(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %11
store double %1, double* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store double %7, double* %18
store double %8, double* %19
store double %9, double* %20
%21 = load double, double* %11
%22 = load double, double* %12
%23 = fadd double %21, %22
%24 = load double, double* %13
%25 = fadd double %23, %24
%26 = load double, double* %14
%27 = fadd double %25, %26
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double, double* %16
%31 = fadd double %29, %30
%32 = load double, double* %17
%33 = fadd double %31, %32
%34 = load double, double* %18
%35 = fadd double %33, %34
%36 = load double, double* %19
%37 = fadd double %35, %36
%38 = load double, double* %20
%39 = fadd double %37, %38
ret double %39
}

LLVM IR (-O2):
define double @Function10Double(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = fadd double %0, %1
%12 = fadd double %11, %2
%13 = fadd double %12, %3
%14 = fadd double %13, %4
%15 = fadd double %14, %5
%16 = fadd double %15, %6
%17 = fadd double %16, %7
%18 = fadd double %17, %8
%19 = fadd double %18, %9
ret double %19
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
void addstats(off_t *stats, off_t lines, off_t bytes) {
  if (stats) {
    if (stats[0] >= 0)
      stats[0] += lines;
    stats[1] += bytes;
  }
}


x86 assembly (clang, -O0):
<addstats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <addstats+0x47>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jl     1137 <addstats+0x37>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addstats>:
test   %rdi,%rdi
je     1117 <addstats+0x17>
mov    (%rdi),%rax
test   %rax,%rax
js     1113 <addstats+0x13>
add    %rsi,%rax
mov    %rax,(%rdi)
add    %rdx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @addstats(i64* %0, i64 %1, i64 %2) {
%4 = icmp eq i64* %0, null
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = load i64, i64* %0
%7 = icmp sgt i64 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = add nsw i64 %6, %1
store i64 %9, i64* %0
br label %10
10: ; preds = %8, %5
%11 = getelementptr inbounds i64, i64* %0, i64 1
%12 = load i64, i64* %11
%13 = add nsw i64 %12, %2
store i64 %13, i64* %11
br label %14
14: ; preds = %10, %3
ret void
}
void specks_lock_init(struct stuff *st) {}


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

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

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

LLVM IR (-O2):
%struct.stuff = type opaque
define void @specks_lock_init(%struct.stuff* nocapture %0) {
ret void
}
/* Variables and functions */
float log(int);
float log10(float n) { return log(n) / log(10); }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%edi
call   1030 <log@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
cvttss2si %xmm0,%edi
call   1030 <log@plt>
movss  %xmm0,0x4(%rsp)
mov    $0xa,%edi
call   1030 <log@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = call float @log(i32 %4)
%6 = call float @log(i32 10)
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @log10(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call float @log(i32 %2)
%4 = tail call float @log(i32 10)
%5 = fdiv float %3, %4
ret float %5
}
int also_before(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @also_before() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_collisions();
int /*<<< orphan*/ print_counts();
main() {
  get_collisions();
  print_counts();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @get_collisions()
%2 = call i32 (...) @print_counts()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_collisions()
%2 = tail call i32 (...) @print_counts()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_name_as_is(char *name) { printf("Hello, my name is %s\n", name); }


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"Hello, my name is %s\0A\00"
define void @print_name_as_is(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *foo(char *);
char *malloc(int);
void main() {
  char *p = malloc(1);
  char *q = foo(p);
  *q = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
call   1040 <foo@plt>
movb   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 1)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @foo(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
store i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i8* @foo(i8* %1)
store i8 1, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matvec3_c(float *, float *, float *);
void matvec3_neon(float m[9], float v[3], float d[3]) { matvec3_c(m, v, d); }


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

x86 assembly (clang, -O2):
<matvec3_neon>:
jmp    1030 <matvec3_c@plt>

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

LLVM IR (-O2):
define void @matvec3_neon(float* %0, float* %1, float* %2) {
%4 = tail call i32 @matvec3_c(float* %0, float* %1, float* %2)
ret void
}
char *strcat(char *s1, const char *s2) {
  while (*s1) {
    ++s1;
  }
  while ((*s1++ = *s2++)) {
    ;
  }
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat+0xc>
jmp    112f <strcat+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <strcat+0x5e>
jmp    112f <strcat+0x2f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <strcat+0x10>
mov    $0xffffffffffffffff,%rcx
movzbl 0x1(%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcat+0x20>
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %13
}
char *strerror(int errnum) { return "strerror(int) is unimplemented"; }


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"strerror(int) is unimplemented\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"strerror(int) is unimplemented\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void print_key(int key) {
  printf("key: %d\n", key);
  fflush(stdout);
}


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

x86 assembly (clang, -O2):
<print_key>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"key: %d\0A\00"
@stdout = global i32 0
define void @print_key(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"key: %d\0A\00"
@stdout = global i32 0
define void @print_key(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ mysetbuf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char buf[BUFSIZ];
  mysetbuf(stdin, buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <mysetbuf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <mysetbuf@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
%12 = load i32, i32* @stdin
%13 = call i32 @mysetbuf(i32 %12, i8* %11)
store i32 0, i32* %3
%14 = load i8*, i8** %6
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = load i32, i32* @stdin
%7 = call i32 @mysetbuf(i32 %6, i8* %5)
ret i32 0
}
/* Type definitions */
struct wdata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ busy_loop();
void worker_batch(struct wdata *wdata) { busy_loop(); }


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

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

LLVM IR (-O0):
%struct.wdata = type { i32 }
define void @worker_batch(%struct.wdata* %0) {
%2 = alloca %struct.wdata*
store %struct.wdata* %0, %struct.wdata** %2
%3 = call i32 (...) @busy_loop()
ret void
}

LLVM IR (-O2):
%struct.wdata = type { i32 }
define void @worker_batch(%struct.wdata* nocapture readnone %0) {
%2 = tail call i32 (...) @busy_loop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int doit() {
  printf("B %d\n", 0);
  return 0;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"B %d\0A\00"
define i32 @doit() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(int, char, char, char, char, char);
int main() {
  test(5, 'a', 'b', 'c', 'd', 'e');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
mov    $0x64,%r8d
mov    $0x65,%r9d
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
mov    $0x64,%r8d
mov    $0x65,%r9d
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 5, i8 signext 97, i8 signext 98, i8 signext 99, i8 signext 100, i8 signext 101)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 5, i8 signext 97, i8 signext 98, i8 signext 99, i8 signext 100, i8 signext 101)
ret i32 0
}
void timer1_init(void) {}


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

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

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

LLVM IR (-O2):
define void @timer1_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_space_or_eoln(char);
char *token_endnn(char *sptr) {
  while (!is_space_or_eoln(*(++sptr)))
    ;
  return sptr;
}


x86 assembly (clang, -O0):
<token_endnn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%edi
call   1030 <is_space_or_eoln@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1149 <token_endnn+0x39>
jmp    114e <token_endnn+0x3e>
jmp    111c <token_endnn+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_endnn>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_space_or_eoln@plt>
test   %eax,%eax
je     1120 <token_endnn+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @token_endnn(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @is_space_or_eoln(i8 signext %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}
long uxGetTickCounterValue(void) {
  long val;
  *(&val) = (*((volatile unsigned long *)0xe000e018));
  return val;
}


x86 assembly (clang, -O0):
<uxGetTickCounterValue>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e018,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uxGetTickCounterValue>:
mov    $0xe000e018,%eax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @uxGetTickCounterValue() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 3758153752 to i64*)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @uxGetTickCounterValue() {
%1 = load volatile i64, i64* inttoptr (i64 3758153752 to i64*)
ret i64 %1
}
int test_imm_53int64_lowword_reg(long long val) {
  return ((val) & (0x53 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_53int64_lowword_reg>:
test   $0x53,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 83
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *);
float *vector(int nl, int nh) {
  float *v;
  v = (float *)malloc((unsigned)(nh - nl + 1) * sizeof(float));
  if (!v) {
    printf("allocation failure in vector()");
    exit(-1);
  }
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <vector+0x49>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1152 <vector+0x22>
movslq %ebx,%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
pop    %rbx
ret
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %5
%15 = load float*, float** %5
%16 = icmp ne float* %15, null
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 -1)
unreachable
20: ; preds = %2
%21 = load float*, float** %5
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = sub i64 0, %23
%25 = getelementptr inbounds float, float* %21, i64 %24
ret float* %25
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = inttoptr i64 %6 to float*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds float, float* %12, i64 %14
ret float* %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 1;
  if (i == 1) {
    goto __pyx_L1_error;
  }
__pyx_L1_error:;
  printf("hello world\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1135 <main+0x25>
jmp    113a <main+0x2a>
jmp    113a <main+0x2a>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_white(int c) { return (c == ' ' || c == '\t') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_white+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_white(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_white(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_BEint16_mem(short *val) {
  return ((*val) & (-0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -190
%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_BEint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -190
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mat4f_copy(float *, float const *);
int /*<<< orphan*/ mat4f_transpose(float *);
void mat4f_transpose_new(float dest[16], const float src[16]) {
  mat4f_copy(dest, src);
  mat4f_transpose(dest);
}


x86 assembly (clang, -O0):
<mat4f_transpose_new>:
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   1040 <mat4f_copy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mat4f_transpose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_transpose_new>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mat4f_copy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mat4f_transpose@plt>

LLVM IR (-O0):
define void @mat4f_transpose_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @mat4f_copy(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @mat4f_transpose(float* %8)
ret void
}

LLVM IR (-O2):
define void @mat4f_transpose_new(float* %0, float* %1) {
%3 = tail call i32 @mat4f_copy(float* %0, float* %1)
%4 = tail call i32 @mat4f_transpose(float* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srl_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_srl_epi64(__m128i A, __m128i B) { return _mm_srl_epi64(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srl_epi64>:
jmp    1030 <_mm_srl_epi64@plt>

LLVM IR (-O0):
define i32 @test_mm_srl_epi64(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 @_mm_srl_epi64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_srl_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srl_epi64(i32 %0, i32 %1)
ret i32 %3
}
void SetPlane() {}


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

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

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

LLVM IR (-O2):
define void @SetPlane() {
ret void
}
/* Variables and functions */
double EvalAngDist_alpha0_2plus_0plus_15097_L2(double);
double funcAngDist_alpha0_2plus_0plus_15097_L2(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha0_2plus_0plus_15097_L2(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha0_2plus_0plus_15097_L2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha0_2plus_0plus_15097_L2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha0_2plus_0plus_15097_L2>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha0_2plus_0plus_15097_L2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha0_2plus_0plus_15097_L2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha0_2plus_0plus_15097_L2(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha0_2plus_0plus_15097_L2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha0_2plus_0plus_15097_L2(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *runner(void *param) {
  printf("thread running ------ %d\n", (int)param);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<runner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runner>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"thread running ------ %d\0A\00"
define i8* @runner(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pthread_exit(i32 0)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"thread running ------ %d\0A\00"
define noalias i8* @runner(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ si475xAMRX_general_cfg();
int /*<<< orphan*/ si475xAMRX_hardware_cfg();
int /*<<< orphan*/ si475xAMRX_output_config();
int /*<<< orphan*/ si475xAMRX_regional_cfg();
void si475xAMRX_configure(void) {
  si475xAMRX_output_config();
  si475xAMRX_hardware_cfg();
  si475xAMRX_general_cfg();
  si475xAMRX_regional_cfg();
}


x86 assembly (clang, -O0):
<si475xAMRX_configure>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <si475xAMRX_output_config@plt>
mov    $0x0,%al
call   1050 <si475xAMRX_hardware_cfg@plt>
mov    $0x0,%al
call   1040 <si475xAMRX_general_cfg@plt>
mov    $0x0,%al
call   1030 <si475xAMRX_regional_cfg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMRX_configure>:
push   %rax
xor    %eax,%eax
call   1060 <si475xAMRX_output_config@plt>
xor    %eax,%eax
call   1050 <si475xAMRX_hardware_cfg@plt>
xor    %eax,%eax
call   1040 <si475xAMRX_general_cfg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <si475xAMRX_regional_cfg@plt>

LLVM IR (-O0):
define void @si475xAMRX_configure() {
%1 = call i32 (...) @si475xAMRX_output_config()
%2 = call i32 (...) @si475xAMRX_hardware_cfg()
%3 = call i32 (...) @si475xAMRX_general_cfg()
%4 = call i32 (...) @si475xAMRX_regional_cfg()
ret void
}

LLVM IR (-O2):
define void @si475xAMRX_configure() {
%1 = tail call i32 (...) @si475xAMRX_output_config()
%2 = tail call i32 (...) @si475xAMRX_hardware_cfg()
%3 = tail call i32 (...) @si475xAMRX_general_cfg()
%4 = tail call i32 (...) @si475xAMRX_regional_cfg()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _funlockfile_stub(FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @_funlockfile_stub(i32* nocapture %0) {
ret void
}
int test4(int a, int b) {
  int lt = a < b;
  int eq = b == a;
  return (lt || eq);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1145 <test4+0x45>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
cmp    %edi,%esi
setge  %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %2
%21 = phi i1 [ true, %2 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @test4(i32 %0, i32 %1) {
%3 = icmp sge i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ avg_init(int, char **);
int /*<<< orphan*/ write_to_vhd();
int main(int argc, char *argv[]) {
  avg_init(argc, argv);
  write_to_vhd();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @avg_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @write_to_vhd()
ret i32 0
}