xunge/DecIR huggingface dataset:
double det(double *M) { return (M[0] * M[3] - M[1] * M[2]); }


x86 assembly (clang, -O0):
<det>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @det(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fneg double %6
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %10)
ret double %11
}
/* Variables and functions */
char *malloc(int);
int main(int argc, char *argv[]) {
  char *pointer = 0;
  pointer = malloc(64);
  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)
movq   $0x0,-0x18(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void foo4() { printf("foo4 in inline 3\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"foo4 in inline 3\0A\00"
define void @foo4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"foo4 in inline 3\00"
define void @foo4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void REMR3InitFinalize(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3InitFinalize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_all_bytes(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<free_all_bytes>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_all_bytes(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int cm_delete_entry(char *, char *, char *, char *);
int delgshadow(char *group) {
  int i;
  if ((i = cm_delete_entry(group, "%[^:]:%*[^:]:%*d:%*[^:]", "/etc/gshadow",
                           "/etc/.gshadow.cm")) != 0) {
    return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<delgshadow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xef0(%rip),%rcx
call   1030 <cm_delete_entry@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <delgshadow+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <delgshadow+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delgshadow>:
lea    0xee9(%rip),%rsi
lea    0xefa(%rip),%rdx
lea    0xf00(%rip),%rcx
jmp    1030 <cm_delete_entry@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%[^:]:%*[^:]:%*d:%*[^:]\00"
@.str.1 = [13 x i8] c"/etc/gshadow\00"
@.str.2 = [17 x i8] c"/etc/.gshadow.cm\00"
define i32 @delgshadow(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @cm_delete_entry(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"%[^:]:%*[^:]:%*d:%*[^:]\00"
@.str.1 = [13 x i8] c"/etc/gshadow\00"
@.str.2 = [17 x i8] c"/etc/.gshadow.cm\00"
define i32 @delgshadow(i8* %0) {
%2 = tail call i32 @cm_delete_entry(i8* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 %2
}
int test_imm_83int64_lowword_mem(long long *val) {
  return ((*val) & (0x83 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_83int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 131
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ems1Emark();
int /*<<< orphan*/ ems1Mpush();
void emsMark(void) {
  ;
  ems1Emark();
  ems1Mpush();
  return;
}


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

x86 assembly (clang, -O2):
<emsMark>:
push   %rax
xor    %eax,%eax
call   1040 <ems1Emark@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ems1Mpush@plt>

LLVM IR (-O0):
define void @emsMark() {
%1 = call i32 (...) @ems1Emark()
%2 = call i32 (...) @ems1Mpush()
ret void
}

LLVM IR (-O2):
define void @emsMark() {
%1 = tail call i32 (...) @ems1Emark()
%2 = tail call i32 (...) @ems1Mpush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t strlen(char *);
size_t strLength(char *string) {
  assert(string != NULL);
  return strlen(string);
}


x86 assembly (clang, -O0):
<strLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLength>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @strLength(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @strLength(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %5
}
unsigned int _uiCommConnect(unsigned int uiCommType, unsigned char *psParam1,
                            unsigned char *psParam2, unsigned char *psParam3,
                            unsigned int uiTimeout) {
  return (0x0304);
}


x86 assembly (clang, -O0):
<_uiCommConnect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x304,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_uiCommConnect(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 772
}

LLVM IR (-O2):
define i32 @_uiCommConnect(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret i32 772
}
/* Variables and functions */
float sqrt(float);
float etr_side_area(float area) {
  float side = sqrt(area / 0.433);
  return side;
}


x86 assembly (clang, -O0):
<etr_side_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etr_side_area>:
cvtss2sd %xmm0,%xmm0
divsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112d <etr_side_area+0x1d>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @etr_side_area(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fdiv double %5, 4.330000e-01
%7 = fptrunc double %6 to float
%8 = call float @sqrt(float %7)
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @etr_side_area(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 4.330000e-01
%4 = fptrunc double %3 to float
%5 = tail call float @sqrt(float %4)
ret float %5
}
void otherStuff() {}


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

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

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

LLVM IR (-O2):
define void @otherStuff() {
ret void
}
read_tiff_header(file_name, image_header) char file_name[];
struct tiff_header_struct *image_header;
{
}


x86 assembly (clang, -O0):
<read_tiff_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tiff_header_struct = type opaque
define i32 @read_tiff_header(i8* %0, %struct.tiff_header_struct* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tiff_header_struct*
store i8* %0, i8** %4
store %struct.tiff_header_struct* %1, %struct.tiff_header_struct** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.tiff_header_struct = type opaque
define i32 @read_tiff_header(i8* nocapture readnone %0, %struct.tiff_header_struct* nocapture readnone %1) {
ret i32 undef
}
long long sum_of_digits(long long n) {
  if (n <= 0) {
    return 0;
  }
  return (n % 10) + sum_of_digits(n / 10);
}


x86 assembly (clang, -O0):
<sum_of_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1134 <sum_of_digits+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1167 <sum_of_digits+0x57>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <sum_of_digits@plt>
mov    -0x18(%rbp),%rdx
add    %rax,%rdx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_digits>:
test   %rdi,%rdi
jle    1148 <sum_of_digits+0x48>
mov    %rdi,%rsi
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rsi,%rdi
sub    %rax,%rdi
add    %rdi,%rcx
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1120 <sum_of_digits+0x20>
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sum_of_digits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %14
7: ; preds = %1
%8 = load i64, i64* %3
%9 = srem i64 %8, 10
%10 = load i64, i64* %3
%11 = sdiv i64 %10, 10
%12 = call i64 @sum_of_digits(i64 %11)
%13 = add nsw i64 %9, %12
store i64 %13, i64* %2
br label %14
14: ; preds = %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @sum_of_digits(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ %0, %1 ]
%5 = phi i64 [ %8, %3 ], [ 0, %1 ]
%6 = urem i64 %4, 10
%7 = udiv i64 %4, 10
%8 = add nuw nsw i64 %6, %5
%9 = icmp ult i64 %4, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %11
}
/* Variables and functions */
scalar_t__ is_close_paren(char);
scalar_t__ is_open_paren(char);
int is_paren(char c) { return is_open_paren(c) || is_close_paren(c); }


x86 assembly (clang, -O0):
<is_paren>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <is_open_paren@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_paren+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <is_close_paren@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_paren>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_open_paren@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_paren+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <is_close_paren@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_paren(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_open_paren(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_close_paren(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_paren(i8 signext %0) {
%2 = tail call i64 @is_open_paren(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_close_paren(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void zera_local_counter() {}


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

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

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

LLVM IR (-O2):
define void @zera_local_counter() {
ret void
}
void emit_int32(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_int32>:
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)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int32(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int32(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
void respond_init() { ; }


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

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

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

LLVM IR (-O2):
define void @respond_init() {
ret void
}
int security_inode_removexattr(struct dentry *dentry, char *name) { return 0; }


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
define i32 @security_inode_removexattr(%struct.dentry* %0, i8* %1) {
%3 = alloca %struct.dentry*
%4 = alloca i8*
store %struct.dentry* %0, %struct.dentry** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @security_inode_removexattr(%struct.dentry* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
long f1() { return "asdf"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"asdf\00"
define i64 @f1() {
ret i64 ptrtoint ([5 x i8]* @.str to i64)
}

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i64 @f1() {
ret i64 ptrtoint ([5 x i8]* @.str to i64)
}
void ff_hevc_put_hevc_uni_w_qpel_hv16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv16_10_sse4() {
ret void
}
void fn1(short p) {}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fn1(i16 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ svndump_deinit();
int /*<<< orphan*/ svndump_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ svndump_read(char *);
int /*<<< orphan*/ svndump_reset();
int main(int argc, char **argv) {
  svndump_init(NULL);
  svndump_read((argc > 1) ? argv[1] : NULL);
  svndump_deinit();
  svndump_reset();
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <svndump_init@plt>
cmpl   $0x1,-0x8(%rbp)
jle    117a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1185 <main+0x45>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1185 <main+0x45>
mov    -0x18(%rbp),%rdi
call   1050 <svndump_read@plt>
mov    $0x0,%al
call   1060 <svndump_deinit@plt>
mov    $0x0,%al
call   1030 <svndump_reset@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <svndump_init@plt>
cmp    $0x2,%ebp
jl     115b <main+0x1b>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1050 <svndump_read@plt>
xor    %eax,%eax
call   1060 <svndump_deinit@plt>
xor    %eax,%eax
call   1030 <svndump_reset@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
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 = call i32 @svndump_init(i32* null)
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ null, %13 ]
%16 = call i32 @svndump_read(i8* %15)
%17 = call i32 (...) @svndump_deinit()
%18 = call i32 (...) @svndump_reset()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @svndump_init(i32* null)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
%10 = tail call i32 @svndump_read(i8* %9)
%11 = tail call i32 (...) @svndump_deinit()
%12 = tail call i32 (...) @svndump_reset()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_pin(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void terminate(int signo) {
  puts("Shutting down...");
  clear_pin((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3));
  exit(0);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf,%edi
call   1050 <clear_pin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf,%edi
call   1050 <clear_pin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Shutting down...\00"
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @clear_pin(i32 15)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Shutting down...\00"
define void @terminate(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @clear_pin(i32 15)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int is_bigendian() {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  return (u.c[sizeof(long) - 1] == 1);
}


x86 assembly (clang, -O0):
<is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @is_bigendian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i64*
store i64 1, i64* %2
%3 = bitcast %union.anon* %1 to [8 x i8]*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_bigendian() {
ret i32 0
}
void thread_fn2(void *data) {
  while (1) {
    sleep(1);
    printf("%s\n", __func__);
  }
}


x86 assembly (clang, -O0):
<thread_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
lea    0xec1(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112c <thread_fn2+0xc>

x86 assembly (clang, -O2):
<thread_fn2>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1130 <thread_fn2+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.thread_fn2 = [11 x i8] c"thread_fn2\00"
define void @thread_fn2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.thread_fn2, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@__func__.thread_fn2 = [11 x i8] c"thread_fn2\00"
define void @thread_fn2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.thread_fn2, i64 0, i64 0))
br label %2
}
void foo_1_2_2_2_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_2_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ reply(int, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void perror_reply(int code, const char *string) {
  reply(code, "%s: %s.", string, strerror(errno));
}


x86 assembly (clang, -O0):
<perror_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea5(%rip),%rsi
call   1030 <reply@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror_reply>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <reply@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s.\00"
@errno = global i32 0
define void @perror_reply(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = call i32 @reply(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s.\00"
@errno = global i32 0
define void @perror_reply(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @reply(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4)
ret void
}
int sync_var_test_bit(int nr, const volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit)
                       : "m"((*(volatile long *)addr)), "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_var_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bt     %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_var_test_bit>:
bt     %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_var_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_var_test_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_metafont_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("metafont", " %comment"),
                            "comment", "%comment");
}


x86 assembly (clang, -O0):
<test_metafont_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xecb(%rip),%rsi
lea    0xec3(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_metafont_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed0(%rip),%rsi
lea    0xec8(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"metafont\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_metafont_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"metafont\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_metafont_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t get_data_tag_in_EvntGrp(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @get_data_tag_in_EvntGrp(i64 %0) {
ret i64 0
}
double LeftTurn(const double a[2], const double b[2], const double c[2]) {
  extern double orient2d(double *, double *, double *);
  return orient2d((double *)a, (double *)b, (double *)c);
}


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

x86 assembly (clang, -O2):
<LeftTurn>:
jmp    1030 <orient2d@plt>

LLVM IR (-O0):
define double @LeftTurn(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** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call double @orient2d(double* %7, double* %8, double* %9)
ret double %10
}

LLVM IR (-O2):
define double @LeftTurn(double* %0, double* %1, double* %2) {
%4 = tail call double @orient2d(double* %0, double* %1, double* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ log_any(char const *, int, char const *);
void log_warn(const char *type, int code, const char *msg) {
  log_any(type, code, msg);
}


x86 assembly (clang, -O0):
<log_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <log_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_warn>:
jmp    1030 <log_any@plt>

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

LLVM IR (-O2):
define void @log_warn(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @log_any(i8* %0, i32 %1, i8* %2)
ret void
}
int raise(int s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 0
}
/* Variables and functions */
float pow(int, int);
float exponentialIn(float fraction, float start, float delta) {
  if (fraction == 0)
    return start;
  return delta * pow(2, 10 * (fraction - 1)) + start;
}


x86 assembly (clang, -O0):
<exponentialIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    114d <exponentialIn+0x3d>
jp     114d <exponentialIn+0x3d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119c <exponentialIn+0x8c>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
movss  0xea0(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xe90(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponentialIn>:
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm0
jne    111e <exponentialIn+0xe>
jp     111e <exponentialIn+0xe>
movaps %xmm1,%xmm0
ret
push   %rax
addss  0xed9(%rip),%xmm0
mulss  0xed5(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
movss  %xmm1,0x4(%rsp)
movss  %xmm2,(%rsp)
call   1030 <pow@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @exponentialIn(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = fcmp oeq float %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %6
store float %11, float* %4
br label %21
12: ; preds = %3
%13 = load float, float* %7
%14 = load float, float* %5
%15 = fsub float %14, 1.000000e+00
%16 = fmul float 1.000000e+01, %15
%17 = fptosi float %16 to i32
%18 = call float @pow(i32 2, i32 %17)
%19 = load float, float* %6
%20 = call float @llvm.fmuladd.f32(float %13, float %18, float %19)
store float %20, float* %4
br label %21
21: ; preds = %12, %10
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @exponentialIn(float %0, float %1, float %2) {
%4 = fcmp oeq float %0, 0.000000e+00
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = fadd float %0, -1.000000e+00
%7 = fmul float %6, 1.000000e+01
%8 = fptosi float %7 to i32
%9 = tail call float @pow(i32 2, i32 %8)
%10 = tail call float @llvm.fmuladd.f32(float %2, float %9, float %1)
br label %11
11: ; preds = %3, %5
%12 = phi float [ %10, %5 ], [ %1, %3 ]
ret float %12
}
void g_thread_join() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_join() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box(int);
int main() {
  box(1);
  box(2);
  box(3);
  box(4);
  box(10);
  box(-2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <box@plt>
mov    $0x2,%edi
call   1030 <box@plt>
mov    $0x3,%edi
call   1030 <box@plt>
mov    $0x4,%edi
call   1030 <box@plt>
mov    $0xa,%edi
call   1030 <box@plt>
mov    $0xfffffffe,%edi
call   1030 <box@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <box@plt>
mov    $0x2,%edi
call   1030 <box@plt>
mov    $0x3,%edi
call   1030 <box@plt>
mov    $0x4,%edi
call   1030 <box@plt>
mov    $0xa,%edi
call   1030 <box@plt>
mov    $0xfffffffe,%edi
call   1030 <box@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @box(i32 1)
%2 = tail call i32 @box(i32 2)
%3 = tail call i32 @box(i32 3)
%4 = tail call i32 @box(i32 4)
%5 = tail call i32 @box(i32 10)
%6 = tail call i32 @box(i32 -2)
ret i32 0
}
/* Variables and functions */
int *do_an_allocation();
int /*<<< orphan*/ free_an_allocation(int *);
int main(int argc, char *argv[]) {
  int *ptr = do_an_allocation();
  free_an_allocation(ptr);
  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    $0x0,%al
call   1040 <do_an_allocation@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free_an_allocation@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <do_an_allocation@plt>
mov    %rax,%rdi
call   1030 <free_an_allocation@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**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* (...) @do_an_allocation()
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @free_an_allocation(i32* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @do_an_allocation()
%4 = tail call i32 @free_an_allocation(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302A - Spring 2014\n");
  printf("Name: Ayman Alghamdi\n");
  printf("Date Created: %d/%d/%d\n", 1, 28, 2014);
  printf("Assignment; assignment05\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Course: EG1302A - Spring 2014\0A\00"
@.str.1 = [22 x i8] c"Name: Ayman Alghamdi\0A\00"
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [26 x i8] c"Assignment; assignment05\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@str = [30 x i8] c"Course: EG1302A - Spring 2014\00"
@str.4 = [21 x i8] c"Name: Ayman Alghamdi\00"
@str.5 = [25 x i8] c"Assignment; assignment05\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int packack(unsigned char *buf, int blkno) {
  buf[0] = 4 >> 8;
  buf[1] = 4 & 0xff;
  buf[2] = blkno >> 8;
  buf[3] = blkno & 0xff;
  return 4;
}


x86 assembly (clang, -O0):
<packack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packack>:
mov    %esi,%eax
movw   $0x400,(%rdi)
mov    %ah,0x2(%rdi)
mov    %al,0x3(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @packack(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 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 4, i8* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 3
store i8 %16, i8* %18
ret i32 4
}

LLVM IR (-O2):
define i32 @packack(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 4, i8* %3
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %6
%7 = trunc i32 %1 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %7, i8* %8
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void memzero(void *s, size_t n) { memset(s, 0, n); }


x86 assembly (clang, -O0):
<memzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @memzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int ISORegexp__white_space(int c) {
  if ((c == ' ') || (c == '\t'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ISORegexp__white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     111b <ISORegexp__white_space+0x1b>
cmpl   $0x9,-0x8(%rbp)
jne    1127 <ISORegexp__white_space+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ISORegexp__white_space+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ISORegexp__white_space(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_02uint16_reg(unsigned short val) {
  return ((val) & (-0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xfffffffe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02uint16_reg>:
cmp    $0x2,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_02uint16_reg(i16 zeroext %0) {
%2 = icmp ult i16 %0, 2
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void mul10(int *a, int *b) {
  *a *= 10;
  *b *= 10;
}


x86 assembly (clang, -O0):
<mul10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul10>:
mov    (%rdi),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,(%rdi)
mov    (%rsi),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @mul10(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* %5
%7 = mul nsw i32 %6, 10
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 10
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @mul10(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = mul nsw i32 %3, 10
store i32 %4, i32* %0
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 10
store i32 %6, i32* %1
ret void
}