#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_progress(size_t k, const double *ps, const double *mus,
                    const double *sds) {
  size_t i;
  fprintf(stderr, "------------------------------------\n");
  fprintf(stderr, "ps  = [ %e", ps[0]);
  for (i = 1; i < k; ++i)
    fprintf(stderr, ", %e", ps[i]);
  fprintf(stderr, " ]\n");
  fprintf(stderr, "mus = [ %e", mus[0]);
  for (i = 1; i < k; ++i)
    fprintf(stderr, ", %e", mus[i]);
  fprintf(stderr, " ]\n");
  fprintf(stderr, "sds = [ %e", sds[0]);
  for (i = 1; i < k; ++i)
    fprintf(stderr, ", %e", sds[i]);
  fprintf(stderr, " ]\n");
}


x86 assembly (clang, -O0):
<print_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xecf(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    11a9 <print_progress+0x99>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xea0(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1166 <print_progress+0x56>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe62(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    122a <print_progress+0x11a>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe1f(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11e7 <print_progress+0xd7>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xdec(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    12ab <print_progress+0x19b>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd9e(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1268 <print_progress+0x158>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_progress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r13
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r12
mov    0x2eb2(%rip),%r15
mov    (%r15),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  (%rbx),%xmm0
lea    0xed9(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
cmp    $0x2,%r12
jb     11ee <print_progress+0xde>
mov    %r13,(%rsp)
mov    $0x1,%r14d
lea    0xec2(%rip),%r13
nop
mov    (%r15),%edi
movsd  (%rbx,%r14,8),%xmm0
mov    %r13,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%r12
jne    1170 <print_progress+0x60>
mov    (%r15),%edi
lea    0xea0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x0(%rbp),%xmm0
lea    0xe8e(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
cmp    $0x2,%r12
mov    (%rsp),%r13
jb     126f <print_progress+0x15f>
mov    $0x1,%ebx
lea    0xe64(%rip),%r14
nopl   (%rax)
mov    (%r15),%edi
movsd  0x0(%rbp,%rbx,8),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11d0 <print_progress+0xc0>
jmp    1215 <print_progress+0x105>
mov    (%r15),%edi
lea    0xe3e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x0(%rbp),%xmm0
lea    0xe2c(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xe17(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x0(%r13),%xmm0
lea    0xe0f(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
cmp    $0x2,%r12
jb     1297 <print_progress+0x187>
mov    $0x1,%ebp
lea    0xde2(%rip),%rbx
nop
mov    (%r15),%edi
movsd  0x0(%r13,%rbp,8),%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1250 <print_progress+0x140>
jmp    1297 <print_progress+0x187>
mov    (%r15),%edi
lea    0xdbd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x0(%r13),%xmm0
lea    0xdb5(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xd95(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"------------------------------------\0A\00"
@.str.1 = [11 x i8] c"ps = [ %e\00"
@.str.2 = [5 x i8] c", %e\00"
@.str.3 = [4 x i8] c" ]\0A\00"
@.str.4 = [11 x i8] c"mus = [ %e\00"
@.str.5 = [11 x i8] c"sds = [ %e\00"
define void @print_progress(i64 %0, double* %1, double* %2, double* %3) {
%5 = alloca i64
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
store i64 %0, i64* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %15)
store i64 1, i64* %9
br label %17
17: ; preds = %28, %4
%18 = load i64, i64* %9
%19 = load i64, i64* %5
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i32, i32* @stderr
%23 = load double*, double** %6
%24 = load i64, i64* %9
%25 = getelementptr inbounds double, double* %23, i64 %24
%26 = load double, double* %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %26)
br label %28
28: ; preds = %21
%29 = load i64, i64* %9
%30 = add i64 %29, 1
store i64 %30, i64* %9
br label %17
31: ; preds = %17
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = load double*, double** %7
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %37)
store i64 1, i64* %9
br label %39
39: ; preds = %50, %31
%40 = load i64, i64* %9
%41 = load i64, i64* %5
%42 = icmp ult i64 %40, %41
br i1 %42, label %43, label %53
43: ; preds = %39
%44 = load i32, i32* @stderr
%45 = load double*, double** %7
%46 = load i64, i64* %9
%47 = getelementptr inbounds double, double* %45, i64 %46
%48 = load double, double* %47
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %48)
br label %50
50: ; preds = %43
%51 = load i64, i64* %9
%52 = add i64 %51, 1
store i64 %52, i64* %9
br label %39
53: ; preds = %39
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = load double*, double** %8
%58 = getelementptr inbounds double, double* %57, i64 0
%59 = load double, double* %58
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %59)
store i64 1, i64* %9
br label %61
61: ; preds = %72, %53
%62 = load i64, i64* %9
%63 = load i64, i64* %5
%64 = icmp ult i64 %62, %63
br i1 %64, label %65, label %75
65: ; preds = %61
%66 = load i32, i32* @stderr
%67 = load double*, double** %8
%68 = load i64, i64* %9
%69 = getelementptr inbounds double, double* %67, i64 %68
%70 = load double, double* %69
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %70)
br label %72
72: ; preds = %65
%73 = load i64, i64* %9
%74 = add i64 %73, 1
store i64 %74, i64* %9
br label %61
75: ; preds = %61
%76 = load i32, i32* @stderr
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"------------------------------------\0A\00"
@.str.1 = [11 x i8] c"ps = [ %e\00"
@.str.2 = [5 x i8] c", %e\00"
@.str.3 = [4 x i8] c" ]\0A\00"
@.str.4 = [11 x i8] c"mus = [ %e\00"
@.str.5 = [11 x i8] c"sds = [ %e\00"
define void @print_progress(i64 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load double, double* %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = icmp ugt i64 %0, 1
br i1 %10, label %11, label %33
11: ; preds = %4, %11
%12 = phi i64 [ %17, %11 ], [ 1, %4 ]
%13 = load i32, i32* @stderr
%14 = getelementptr inbounds double, double* %1, i64 %12
%15 = load double, double* %14
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = add nuw i64 %12, 1
%18 = icmp eq i64 %17, %0
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = load double, double* %2
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %23)
br i1 %10, label %25, label %53
25: ; preds = %19, %25
%26 = phi i64 [ %31, %25 ], [ 1, %19 ]
%27 = load i32, i32* @stderr
%28 = getelementptr inbounds double, double* %2, i64 %26
%29 = load double, double* %28
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %29)
%31 = add nuw i64 %26, 1
%32 = icmp eq i64 %31, %0
br i1 %32, label %39, label %25
33: ; preds = %4
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = load double, double* %2
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %37)
br label %39
39: ; preds = %25, %33
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = load double, double* %3
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %43)
br i1 %10, label %45, label %59
45: ; preds = %39, %45
%46 = phi i64 [ %51, %45 ], [ 1, %39 ]
%47 = load i32, i32* @stderr
%48 = getelementptr inbounds double, double* %3, i64 %46
%49 = load double, double* %48
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %49)
%51 = add nuw i64 %46, 1
%52 = icmp eq i64 %51, %0
br i1 %52, label %59, label %45
53: ; preds = %19
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = load double, double* %3
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %57)
br label %59
59: ; preds = %45, %53, %39
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}