#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*/ free(float *);
int /*<<< orphan*/ gauss3d_(float *, int *, int *, int *, float *, float *);
int /*<<< orphan*/ imgdap_(float *, int *, int *, int *, float *, int *, int *,
                           int *);
int /*<<< orphan*/ imgpad_(float *, int *, int *, int *, float *, int *, int *,
                           int *);
scalar_t__ malloc(int);
int npad_(int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
void gauss3diz(float *imag, int *pnx, int *pny, int *pnz, float *mmppix,
               float *pfhalf) {
  float *imagp;
  int margin;
  int nxp, nyp, nzp;
  nxp = *pnx;
  nyp = *pny;
  margin = (int)(2.0 * 0.1874 / (mmppix[2] * (*pfhalf)));
  nzp = npad_(pnz, &margin);
  printf("gauss3diz: nxp=%d nyp=%d nzp=%d\n", nxp, nyp, nzp);
  imagp = (float *)malloc(nxp * nyp * nzp * sizeof(float));
  imgpad_(imag, pnx, pny, pnz, imagp, &nxp, &nyp, &nzp);
  gauss3d_(imagp, &nxp, &nyp, &nzp, mmppix, pfhalf);
  imgdap_(imag, pnx, pny, pnz, imagp, &nxp, &nyp, &nzp);
  free(imagp);
}


x86 assembly (clang, -O0):
<gauss3diz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x30(%rbp),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe41(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
call   1090 <npad_@plt>
mov    %eax,-0x48(%rbp)
mov    -0x40(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
lea    0xe1e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x40(%rbp),%eax
imul   -0x44(%rbp),%eax
imul   -0x48(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    -0x40(%rbp),%r9
lea    -0x44(%rbp),%r10
lea    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1080 <imgpad_@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x48(%rbp),%rcx
call   1030 <gauss3d_@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    -0x40(%rbp),%r9
lea    -0x44(%rbp),%r10
lea    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1070 <imgdap_@plt>
mov    -0x38(%rbp),%rdi
call   1040 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss3diz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x30(%rsp)
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,0x20(%rsp)
mov    (%rsi),%ebp
mov    %rsi,0x10(%rsp)
mov    %ebp,0x8(%rsp)
mov    (%rdx),%r12d
mov    %r12d,0x4(%rsp)
movss  0x8(%r8),%xmm0
mulss  (%r9),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe40(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rcx,%rdi
mov    %rcx,0x18(%rsp)
call   1090 <npad_@plt>
mov    %eax,%ebx
mov    %eax,(%rsp)
lea    0xe1e(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %eax,%ecx
call   1050 <printf@plt>
imul   %r12d,%ebp
imul   %ebx,%ebp
shl    $0x2,%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %rsp,%rbp
lea    0x4(%rsp),%rax
lea    0x8(%rsp),%r9
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r15,%r13
mov    %r14,%rcx
mov    %r12,%r8
mov    %r9,%r15
push   %rbp
push   %rax
mov    %rax,%r14
call   1080 <imgpad_@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    0x30(%rsp),%r8
mov    0x28(%rsp),%r9
call   1030 <gauss3d_@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%rsi
mov    %r13,%rdx
mov    0x18(%rsp),%rcx
mov    %r12,%r8
mov    %r15,%r9
push   %rbp
push   %r14
call   1070 <imgdap_@plt>
add    $0x10,%rsp
mov    %r12,%rdi
call   1040 <free@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"gauss3diz: nxp=%d nyp=%d nzp=%d\0A\00"
define void @gauss3diz(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 float*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = 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
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
store i32 %19, i32* %15
%20 = load i32*, i32** %9
%21 = load i32, i32* %20
store i32 %21, i32* %16
%22 = load float*, float** %11
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = load float*, float** %12
%26 = load float, float* %25
%27 = fmul float %24, %26
%28 = fpext float %27 to double
%29 = fdiv double 3.748000e-01, %28
%30 = fptosi double %29 to i32
store i32 %30, i32* %14
%31 = load i32*, i32** %10
%32 = call i32 @npad_(i32* %31, i32* %14)
store i32 %32, i32* %17
%33 = load i32, i32* %15
%34 = load i32, i32* %16
%35 = load i32, i32* %17
%36 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %33, i32 %34, i32 %35)
%37 = load i32, i32* %15
%38 = load i32, i32* %16
%39 = mul nsw i32 %37, %38
%40 = load i32, i32* %17
%41 = mul nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = mul i64 %42, 4
%44 = trunc i64 %43 to i32
%45 = call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to float*
store float* %46, float** %13
%47 = load float*, float** %7
%48 = load i32*, i32** %8
%49 = load i32*, i32** %9
%50 = load i32*, i32** %10
%51 = load float*, float** %13
%52 = call i32 @imgpad_(float* %47, i32* %48, i32* %49, i32* %50, float* %51, i32* %15, i32* %16, i32* %17)
%53 = load float*, float** %13
%54 = load float*, float** %11
%55 = load float*, float** %12
%56 = call i32 @gauss3d_(float* %53, i32* %15, i32* %16, i32* %17, float* %54, float* %55)
%57 = load float*, float** %7
%58 = load i32*, i32** %8
%59 = load i32*, i32** %9
%60 = load i32*, i32** %10
%61 = load float*, float** %13
%62 = call i32 @imgdap_(float* %57, i32* %58, i32* %59, i32* %60, float* %61, i32* %15, i32* %16, i32* %17)
%63 = load float*, float** %13
%64 = call i32 @free(float* %63)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"gauss3diz: nxp=%d nyp=%d nzp=%d\0A\00"
define void @gauss3diz(float* %0, i32* %1, i32* %2, i32* %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = bitcast i32* %7 to i8*
%12 = bitcast i32* %8 to i8*
%13 = bitcast i32* %9 to i8*
%14 = bitcast i32* %10 to i8*
%15 = load i32, i32* %1
store i32 %15, i32* %8
%16 = load i32, i32* %2
store i32 %16, i32* %9
%17 = getelementptr inbounds float, float* %4, i64 2
%18 = load float, float* %17
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = fdiv double 3.748000e-01, %21
%23 = fptosi double %22 to i32
store i32 %23, i32* %7
%24 = call i32 @npad_(i32* %3, i32* %7)
store i32 %24, i32* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %24)
%26 = shl i32 %15, 2
%27 = mul i32 %26, %16
%28 = mul i32 %27, %24
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to float*
%31 = call i32 @imgpad_(float* %0, i32* %1, i32* %2, i32* %3, float* %30, i32* %8, i32* %9, i32* %10)
%32 = call i32 @gauss3d_(float* %30, i32* %8, i32* %9, i32* %10, float* %4, float* %5)
%33 = call i32 @imgdap_(float* %0, i32* %1, i32* %2, i32* %3, float* %30, i32* %8, i32* %9, i32* %10)
%34 = call i32 @free(float* %30)
ret void
}