#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*/ centers(size_t, double **);
int /*<<< orphan*/ dump2d(size_t, size_t, double **);
int /*<<< orphan*/ printf(char *, ...);
void testcenter(void) {
  double C[10][10];
  size_t i;
  for (i = 1; i <= 5; i++) {
    printf("Center Matrix [%zu, %zu]\n", i, i);
    centers(i, C);
    dump2d(i, i, C);
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<testcenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movq   $0x1,-0x328(%rbp)
cmpq   $0x5,-0x328(%rbp)
05
ja     11c2 <testcenter+0x92>
mov    -0x328(%rbp),%rsi
mov    -0x328(%rbp),%rdx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x328(%rbp),%rdi
lea    -0x320(%rbp),%rsi
call   1050 <centers@plt>
mov    -0x328(%rbp),%rdi
mov    -0x328(%rbp),%rsi
lea    -0x320(%rbp),%rdx
call   1030 <dump2d@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x328(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x328(%rbp)
jmp    1146 <testcenter+0x16>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testcenter>:
push   %r14
push   %rbx
sub    $0x328,%rsp
lea    0xeaf(%rip),%r14
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1060 <centers@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1040 <dump2d@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%esi
mov    $0x2,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1060 <centers@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    %rbx,%rdx
call   1040 <dump2d@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x3,%esi
mov    $0x3,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1060 <centers@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
call   1040 <dump2d@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x4,%esi
mov    $0x4,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1060 <centers@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1040 <dump2d@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%esi
mov    $0x5,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1060 <centers@plt>
mov    $0x5,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1040 <dump2d@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Center Matrix [%zu, %zu]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @testcenter() {
%1 = alloca [10 x [10 x double]]
%2 = alloca i64
store i64 1, i64* %2
br label %3
3: ; preds = %20, %0
%4 = load i64, i64* %2
%5 = icmp ule i64 %4, 5
br i1 %5, label %6, label %23
6: ; preds = %3
%7 = load i64, i64* %2
%8 = load i64, i64* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8)
%10 = load i64, i64* %2
%11 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0
%12 = bitcast [10 x double]* %11 to double**
%13 = call i32 @centers(i64 %10, double** %12)
%14 = load i64, i64* %2
%15 = load i64, i64* %2
%16 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0
%17 = bitcast [10 x double]* %16 to double**
%18 = call i32 @dump2d(i64 %14, i64 %15, double** %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %6
%21 = load i64, i64* %2
%22 = add i64 %21, 1
store i64 %22, i64* %2
br label %3
23: ; preds = %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Center Matrix [%zu, %zu]\0A\00"
define void @testcenter() {
%1 = alloca [10 x [10 x double]]
%2 = bitcast [10 x [10 x double]]* %1 to i8*
%3 = bitcast [10 x [10 x double]]* %1 to double**
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 1, i64 1)
%5 = call i32 @centers(i64 1, double** %3)
%6 = call i32 @dump2d(i64 1, i64 1, double** %3)
%7 = call i32 @putchar(i32 10)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 2, i64 2)
%9 = call i32 @centers(i64 2, double** %3)
%10 = call i32 @dump2d(i64 2, i64 2, double** %3)
%11 = call i32 @putchar(i32 10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 3, i64 3)
%13 = call i32 @centers(i64 3, double** %3)
%14 = call i32 @dump2d(i64 3, i64 3, double** %3)
%15 = call i32 @putchar(i32 10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 4, i64 4)
%17 = call i32 @centers(i64 4, double** %3)
%18 = call i32 @dump2d(i64 4, i64 4, double** %3)
%19 = call i32 @putchar(i32 10)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 5, i64 5)
%21 = call i32 @centers(i64 5, double** %3)
%22 = call i32 @dump2d(i64 5, i64 5, double** %3)
%23 = call i32 @putchar(i32 10)
%24 = call i32 @putchar(i32 10)
ret void
}