#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void write_header(long iterations, long dimensions, double endl, double endr,
                  long vectors, double kappa, long nrow, long ncol, long vals) {
  printf("SOLVING THE [A^TA] EIGENPROBLEM\n");
  printf("NO. OF ROWS               = %6ld\n", nrow);
  printf("NO. OF COLUMNS            = %6ld\n", ncol);
  printf("NO. OF NON-ZERO VALUES    = %6ld\n", vals);
  printf("MATRIX DENSITY            = %6.2f%%\n",
         ((float)vals / nrow) * 100 / ncol);
  printf("MAX. NO. OF LANCZOS STEPS = %6ld\n", iterations);
  printf("MAX. NO. OF EIGENPAIRS    = %6ld\n", dimensions);
  printf("LEFT  END OF THE INTERVAL = %9.2E\n", endl);
  printf("RIGHT END OF THE INTERVAL = %9.2E\n", endr);
  printf("KAPPA                     = %9.2E\n", kappa);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssq -0x48(%rbp),%xmm0
cvtsi2ssq -0x38(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xe65(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssq -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xf09(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xf19(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xf29(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r13
mov    %r8,%r12
mov    %rcx,%rbx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xfd7(%rip),%rdi
call   1040 <puts@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r13,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rbx,%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %r12,%xmm1
mulss  0xe3f(%rip),%xmm0
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xef1(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"SOLVING THE [A^TA] EIGENPROBLEM\0A\00"
@.str.1 = [34 x i8] c"NO. OF ROWS = %6ld\0A\00"
@.str.2 = [34 x i8] c"NO. OF COLUMNS = %6ld\0A\00"
@.str.3 = [34 x i8] c"NO. OF NON-ZERO VALUES = %6ld\0A\00"
@.str.4 = [37 x i8] c"MATRIX DENSITY = %6.2f%%\0A\00"
@.str.5 = [34 x i8] c"MAX. NO. OF LANCZOS STEPS = %6ld\0A\00"
@.str.6 = [34 x i8] c"MAX. NO. OF EIGENPAIRS = %6ld\0A\00"
@.str.7 = [35 x i8] c"LEFT END OF THE INTERVAL = %9.2E\0A\00"
@.str.8 = [35 x i8] c"RIGHT END OF THE INTERVAL = %9.2E\0A\00"
@.str.9 = [35 x i8] c"KAPPA = %9.2E\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
define void @write_header(i64 %0, i64 %1, double %2, double %3, i64 %4, double %5, i64 %6, i64 %7, i64 %8) {
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
%13 = alloca double
%14 = alloca i64
%15 = alloca double
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %10
store i64 %1, i64* %11
store double %2, double* %12
store double %3, double* %13
store i64 %4, i64* %14
store double %5, double* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
store i64 %8, i64* %18
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%20 = load i64, i64* %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %20)
%22 = load i64, i64* %17
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %22)
%24 = load i64, i64* %18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %24)
%26 = load i64, i64* %18
%27 = sitofp i64 %26 to float
%28 = load i64, i64* %16
%29 = sitofp i64 %28 to float
%30 = fdiv float %27, %29
%31 = fmul float %30, 1.000000e+02
%32 = load i64, i64* %17
%33 = sitofp i64 %32 to float
%34 = fdiv float %31, %33
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %35)
%37 = load i64, i64* %10
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i64 %37)
%39 = load i64, i64* %11
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i64 %39)
%41 = load double, double* %12
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %41)
%43 = load double, double* %13
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %43)
%45 = load double, double* %15
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), double %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"NO. OF ROWS = %6ld\0A\00"
@.str.2 = [34 x i8] c"NO. OF COLUMNS = %6ld\0A\00"
@.str.3 = [34 x i8] c"NO. OF NON-ZERO VALUES = %6ld\0A\00"
@.str.4 = [37 x i8] c"MATRIX DENSITY = %6.2f%%\0A\00"
@.str.5 = [34 x i8] c"MAX. NO. OF LANCZOS STEPS = %6ld\0A\00"
@.str.6 = [34 x i8] c"MAX. NO. OF EIGENPAIRS = %6ld\0A\00"
@.str.7 = [35 x i8] c"LEFT END OF THE INTERVAL = %9.2E\0A\00"
@.str.8 = [35 x i8] c"RIGHT END OF THE INTERVAL = %9.2E\0A\00"
@.str.9 = [35 x i8] c"KAPPA = %9.2E\0A\00"
@str = [32 x i8] c"SOLVING THE [A^TA] EIGENPROBLEM\00"
define void @write_header(i64 %0, i64 %1, double %2, double %3, i64 %4, double %5, i64 %6, i64 %7, i64 %8) {
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 %6)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %7)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i64 %8)
%14 = sitofp i64 %8 to float
%15 = sitofp i64 %6 to float
%16 = fdiv float %14, %15
%17 = fmul float %16, 1.000000e+02
%18 = sitofp i64 %7 to float
%19 = fdiv float %17, %18
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i64 %0)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i64 %1)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %2)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %3)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), double %5)
%27 = tail call i32 @putchar(i32 10)
ret void
}