#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double const);
void lm_print_pars(int nout, const double *par, double fnorm, FILE *fout) {
  int i;
  for (i = 0; i < nout; ++i)
    fprintf(fout, " %16.9g", par[i]);
  fprintf(fout, " => %18.11g\n", fnorm);
}


x86 assembly (clang, -O0):
<lm_print_pars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <lm_print_pars+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <lm_print_pars+0x1f>
mov    -0x20(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lm_print_pars>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
movsd  %xmm0,0x8(%rsp)
test   %edi,%edi
jle    115a <lm_print_pars+0x4a>
mov    %rsi,%r12
mov    %edi,%r13d
xor    %ebx,%ebx
lea    0xec7(%rip),%r15
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <lm_print_pars+0x30>
lea    0xea7(%rip),%rsi
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %16.9g\00"
@.str.1 = [13 x i8] c" => %18.11g\0A\00"
define void @lm_print_pars(i32 %0, double* %1, double %2, i32* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double %2, double* %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %22, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = load i32*, i32** %8
%16 = load double*, double** %6
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %10
25: ; preds = %10
%26 = load i32*, i32** %8
%27 = load double, double* %7
%28 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %27)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %16.9g\00"
@.str.1 = [13 x i8] c" => %18.11g\0A\00"
define void @lm_print_pars(i32 %0, double* nocapture %1, double %2, i32* nocapture %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds double, double* %1, i64 %9
%11 = load double, double* %10
%12 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
%16 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %2)
ret void
}