#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 */
typedef scalar_t__ *n;
typedef int i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dumpMatrix3D_int(int *M, int m, int n, int l) {
  int i, j, k;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      for (k = 0; k < l; k++) {
        printf("%d ", M[((i) * (n) + (j)) * l + (k)]);
      }
      printf(";");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<dumpMatrix3D_int>:
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    11cd <dumpMatrix3D_int+0xbd>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b1 <dumpMatrix3D_int+0xa1>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1195 <dumpMatrix3D_int+0x85>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x1c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <dumpMatrix3D_int+0x42>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <dumpMatrix3D_int+0x2f>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112c <dumpMatrix3D_int+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpMatrix3D_int>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %rdi,0x10(%rsp)
test   %esi,%esi
jle    1209 <dumpMatrix3D_int+0xe9>
movslq 0xc(%rsp),%r14
movslq 0x8(%rsp),%rax
mov    %esi,%ecx
mov    %rcx,0x18(%rsp)
mov    %eax,%ecx
mov    %rcx,0x30(%rsp)
mov    %r14d,%r13d
imul   %r14,%rax
shl    $0x2,%rax
mov    %rax,0x20(%rsp)
shl    $0x2,%r14
lea    0xe8a(%rip),%rbp
xor    %ecx,%ecx
jmp    11a4 <dumpMatrix3D_int+0x84>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x28(%rsp),%rcx
add    $0x1,%rcx
mov    0x20(%rsp),%rax
add    %rax,0x10(%rsp)
cmp    0x18(%rsp),%rcx
je     1209 <dumpMatrix3D_int+0xe9>
mov    %rcx,0x28(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    1180 <dumpMatrix3D_int+0x60>
mov    0x10(%rsp),%r15
xor    %r12d,%r12d
jmp    11d8 <dumpMatrix3D_int+0xb8>
nopw   0x0(%rax,%rax,1)
mov    $0x3b,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    %r14,%r15
cmp    0x30(%rsp),%r12
je     1180 <dumpMatrix3D_int+0x60>
cmpl   $0x0,0xc(%rsp)
jle    11c0 <dumpMatrix3D_int+0xa0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11f0 <dumpMatrix3D_int+0xd0>
jmp    11c0 <dumpMatrix3D_int+0xa0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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