#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 dump_theta(int D, int K, double **theta) {
  int dvv_loop_var_1;
  int dvv_loop_var_2;
  printf("theta = ");
  for (dvv_loop_var_1 = 1; dvv_loop_var_1 <= D; dvv_loop_var_1++) {
    for (dvv_loop_var_2 = 1; dvv_loop_var_2 <= K; dvv_loop_var_2++) {
      printf("%g", theta[dvv_loop_var_1 - 1][dvv_loop_var_2 - 1]);
      printf(" ");
    }
    printf(" ; ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11bb <dump_theta+0xab>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     119f <dump_theta+0x8f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <dump_theta+0x3a>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <dump_theta+0x27>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_theta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,(%rsp)
mov    %edi,%r15d
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
jle    11ba <dump_theta+0x9a>
mov    (%rsp),%rax
lea    0x1(%rax),%ebp
add    $0x1,%r15d
add    $0xffffffffffffffff,%rbp
mov    $0x1,%r12d
lea    0xea5(%rip),%r13
jmp    1187 <dump_theta+0x67>
cs nopw 0x0(%rax,%rax,1)
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r15,%r12
je     11ba <dump_theta+0x9a>
cmpl   $0x0,(%rsp)
jle    1170 <dump_theta+0x50>
xor    %r14d,%r14d
mov    -0x8(%rbx,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1190 <dump_theta+0x70>
jmp    1170 <dump_theta+0x50>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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