#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 print_initial_simplex(double **v, double *f, int n) {
  int i, j;
  printf("Initial Values\n");
  for (j = 0; j <= n; j++) {
    for (i = 0; i < n; i++) {
      printf("%f, ", v[j][i]);
    }
    printf("value %f\n", f[j]);
  }
}


x86 assembly (clang, -O0):
<print_initial_simplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11b1 <print_initial_simplex+0xa1>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1188 <print_initial_simplex+0x78>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <print_initial_simplex+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1138 <print_initial_simplex+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_initial_simplex>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebp
mov    %rsi,0x10(%rsp)
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,0x8(%rsp)
test   %ebp,%ebp
js     11bf <print_initial_simplex+0x9f>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%ebp
mov    %eax,%r12d
xor    %r14d,%r14d
lea    0xe9e(%rip),%r13
jmp    1192 <print_initial_simplex+0x72>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp),%rax
movsd  (%rax,%r14,8),%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %rbp,%r14
je     11bf <print_initial_simplex+0x9f>
cmpl   $0x0,0x8(%rsp)
je     1170 <print_initial_simplex+0x50>
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    (%rbx,%r14,8),%rax
movsd  (%rax,%r15,8),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r12
jne    11a0 <print_initial_simplex+0x80>
jmp    1170 <print_initial_simplex+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Initial Values\0A\00"
@.str.1 = [5 x i8] c"%f, \00"
@.str.2 = [10 x i8] c"value %f\0A\00"
define void @print_initial_simplex(double** %0, double* %1, i32 %2) {
%4 = alloca double**
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double** %0, double*** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %10
10: ; preds = %40, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %43
14: ; preds = %10
store i32 0, i32* %7
br label %15
15: ; preds = %30, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = load double**, double*** %4
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %28)
br label %30
30: ; preds = %19
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %15
33: ; preds = %15
%34 = load double*, double** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %38)
br label %40
40: ; preds = %33
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %10
43: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%f, \00"
@.str.2 = [10 x i8] c"value %f\0A\00"
@str = [15 x i8] c"Initial Values\00"
define void @print_initial_simplex(double** nocapture %0, double* nocapture %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = icmp slt i32 %2, 0
br i1 %5, label %29, label %6
6: ; preds = %3
%7 = icmp eq i32 %2, 0
%8 = add nuw i32 %2, 1
%9 = zext i32 %8 to i64
%10 = zext i32 %2 to i64
br label %11
11: ; preds = %6, %23
%12 = phi i64 [ 0, %6 ], [ %27, %23 ]
br i1 %7, label %23, label %13
13: ; preds = %11
%14 = getelementptr inbounds double*, double** %0, i64 %12
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %21, %15 ]
%17 = load double*, double** %14
%18 = getelementptr inbounds double, double* %17, i64 %16
%19 = load double, double* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = add nuw nsw i64 %16, 1
%22 = icmp eq i64 %21, %10
br i1 %22, label %23, label %15
23: ; preds = %15, %11
%24 = getelementptr inbounds double, double* %1, i64 %12
%25 = load double, double* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %25)
%27 = add nuw nsw i64 %12, 1
%28 = icmp eq i64 %27, %9
br i1 %28, label %29, label %11
29: ; preds = %23, %3
ret void
}