#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*/ gauss3d_(float *, int *, int *, int *, float *, float *);
int /*<<< orphan*/ printf(char *, int, int, int);
void gauss2diz(float *imag, int *pnx, int *pny, int *pnz, float *mmppix,
               float *pfhalf) {
  int k;
  int nzp;
  nzp = 1;
  printf("gauss2diz: nxp=%d nyp=%d nzp=%d\n", *pnx, *pny, nzp);
  for (k = 0; k < *pnz; k++) {
    gauss3d_(imag + (*pnx) * (*pny) * k, pnx, pny, &nzp, mmppix, pfhalf);
  }
}


x86 assembly (clang, -O0):
<gauss2diz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x38(%rbp),%ecx
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    11bd <gauss2diz+0x9d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
imul   (%rcx),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x38(%rbp),%rcx
call   1030 <gauss3d_@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1169 <gauss2diz+0x49>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss2diz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
movl   $0x1,0xc(%rsp)
mov    (%rsi),%esi
mov    (%rdx),%edx
lea    0xeab(%rip),%rdi
mov    $0x1,%ecx
call   1040 <printf@plt>
cmpl   $0x0,(%r12)
jle    11aa <gauss2diz+0x8a>
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    (%rbx),%eax
imul   %r14d,%eax
imul   0x0(%r13),%eax
cltq
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
lea    0xc(%rsp),%rcx
mov    %r15,%r8
mov    0x10(%rsp),%r9
call   1030 <gauss3d_@plt>
add    $0x1,%r14d
cmp    (%r12),%r14d
jl     1170 <gauss2diz+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"gauss2diz: nxp=%d nyp=%d nzp=%d\0A\00"
define void @gauss2diz(float* %0, i32* %1, i32* %2, i32* nocapture %3, float* %4, float* %5) {
%7 = alloca i32
%8 = bitcast i32* %7 to i8*
store i32 1, i32* %7
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 1)
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %6, %14
%15 = phi i32 [ %23, %14 ], [ 0, %6 ]
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = mul i32 %16, %15
%19 = mul i32 %18, %17
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = call i32 @gauss3d_(float* %21, i32* %1, i32* %2, i32* %7, float* %4, float* %5)
%23 = add nuw nsw i32 %15, 1
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %14, label %26
26: ; preds = %14, %6
ret void
}