#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_solution(int n, double rt, double it, int m, double *v, double err,
                    double rco, double res) {
  int i;
  printf("t : %.15e  %.15e\n", rt, it);
  printf("m : %d\n", m);
  printf("The solution for t :\n");
  for (i = 0; i < n; i++)
    printf(" %.15e  %.15e\n", v[2 * i], v[2 * i + 1]);
  printf("== err : %.3e = rco : %.3e = res : %.3e ==\n", err, rco, res);
}


x86 assembly (clang, -O0):
<write_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11c8 <write_solution+0xb8>
mov    -0x28(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe50(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1179 <write_solution+0x69>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
lea    0xe52(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_solution>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm4,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,(%rsp)
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xeb6(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    11ae <write_solution+0x8e>
mov    %ebp,%r15d
shl    $0x4,%r15
xor    %ebp,%ebp
lea    0xe81(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rbx,%rbp,1),%xmm0
movsd  0x8(%rbx,%rbp,1),%xmm1
mov    %r14,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x10,%rbp
cmp    %rbp,%r15
jne    1190 <write_solution+0x70>
lea    0xe65(%rip),%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    $0x3,%al
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"t : %.15e %.15e\0A\00"
@.str.1 = [8 x i8] c"m : %d\0A\00"
@.str.2 = [22 x i8] c"The solution for t :\0A\00"
@.str.3 = [15 x i8] c" %.15e %.15e\0A\00"
@.str.4 = [44 x i8] c"== err : %.3e = rco : %.3e = res : %.3e ==\0A\00"
define void @write_solution(i32 %0, double %1, double %2, i32 %3, double* %4, double %5, double %6, double %7) {
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca double*
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
store i32 %0, i32* %9
store double %1, double* %10
store double %2, double* %11
store i32 %3, i32* %12
store double* %4, double** %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%18 = load double, double* %10
%19 = load double, double* %11
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %18, double %19)
%21 = load i32, i32* %12
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %17
br label %24
24: ; preds = %43, %8
%25 = load i32, i32* %17
%26 = load i32, i32* %9
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %46
28: ; preds = %24
%29 = load double*, double** %13
%30 = load i32, i32* %17
%31 = mul nsw i32 2, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %29, i64 %32
%34 = load double, double* %33
%35 = load double*, double** %13
%36 = load i32, i32* %17
%37 = mul nsw i32 2, %36
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %35, i64 %39
%41 = load double, double* %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %34, double %41)
br label %43
43: ; preds = %28
%44 = load i32, i32* %17
%45 = add nsw i32 %44, 1
store i32 %45, i32* %17
br label %24
46: ; preds = %24
%47 = load double, double* %14
%48 = load double, double* %15
%49 = load double, double* %16
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), double %47, double %48, double %49)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"t : %.15e %.15e\0A\00"
@.str.1 = [8 x i8] c"m : %d\0A\00"
@.str.3 = [15 x i8] c" %.15e %.15e\0A\00"
@.str.4 = [44 x i8] c"== err : %.3e = rco : %.3e = res : %.3e ==\0A\00"
@str = [21 x i8] c"The solution for t :\00"
define void @write_solution(i32 %0, double %1, double %2, i32 %3, double* nocapture %4, double %5, double %6, double %7) {
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %1, double %2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%12 = icmp sgt i32 %0, 0
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = zext i32 %0 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %24, %15 ]
%17 = shl nuw nsw i64 %16, 1
%18 = getelementptr inbounds double, double* %4, i64 %17
%19 = load double, double* %18
%20 = or i64 %17, 1
%21 = getelementptr inbounds double, double* %4, i64 %20
%22 = load double, double* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %19, double %22)
%24 = add nuw nsw i64 %16, 1
%25 = icmp eq i64 %24, %14
br i1 %25, label %26, label %15
26: ; preds = %15, %8
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), double %5, double %6, double %7)
ret void
}