#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 *, float);
void dump_memory_structure_conv(float ***mem, int sh0, int sh1, int sh2) {
  int i, j, k;
  for (i = 0; i < sh0; i++) {
    for (j = 0; j < sh1; j++) {
      for (k = 0; k < sh2; k++) {
        printf("%.12lf\n", mem[i][j][k]);
      }
    }
  }
}


x86 assembly (clang, -O0):
<dump_memory_structure_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bb <dump_memory_structure_conv+0xab>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a8 <dump_memory_structure_conv+0x98>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1195 <dump_memory_structure_conv+0x85>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <dump_memory_structure_conv+0x42>
jmp    119a <dump_memory_structure_conv+0x8a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <dump_memory_structure_conv+0x2f>
jmp    11ad <dump_memory_structure_conv+0x9d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112c <dump_memory_structure_conv+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_memory_structure_conv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0x4(%rsp)
mov    %edx,(%rsp)
test   %esi,%esi
jle    11b2 <dump_memory_structure_conv+0xa2>
mov    %rdi,%rbp
mov    %esi,%eax
mov    %rax,0x8(%rsp)
mov    (%rsp),%eax
mov    %rax,0x10(%rsp)
mov    0x4(%rsp),%r14d
xor    %r12d,%r12d
lea    0xeb2(%rip),%rbx
jmp    115b <dump_memory_structure_conv+0x4b>
add    $0x1,%r12
cmp    0x8(%rsp),%r12
je     11b2 <dump_memory_structure_conv+0xa2>
cmpl   $0x0,(%rsp)
jle    1150 <dump_memory_structure_conv+0x40>
xor    %r15d,%r15d
jmp    117b <dump_memory_structure_conv+0x6b>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    0x10(%rsp),%r15
je     1150 <dump_memory_structure_conv+0x40>
cmpl   $0x0,0x4(%rsp)
jle    1170 <dump_memory_structure_conv+0x60>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%r12,8),%rax
mov    (%rax,%r15,8),%rax
movss  (%rax,%r13,4),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r14
jne    1190 <dump_memory_structure_conv+0x80>
jmp    1170 <dump_memory_structure_conv+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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