#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 */
scalar_t__ have_situs_suffix(char *);
int /*<<< orphan*/ write_mrc(int, char *, double, double, double, double,
                             unsigned int, unsigned int, unsigned int,
                             double *);
int /*<<< orphan*/ write_situs(char *, double, double, double, double,
                               unsigned int, unsigned int, unsigned int,
                               double *);
void write_vol(char *vol_file, double width, double origx, double origy,
               double origz, unsigned extx, unsigned exty, unsigned extz,
               double *phi) {
  if (have_situs_suffix(vol_file))
    write_situs(vol_file, width, origx, origy, origz, extx, exty, extz, phi);
  else
    write_mrc(1, vol_file, width, origx, origy, origz, extx, exty, extz, phi);
  return;
}


x86 assembly (clang, -O0):
<write_vol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %edx,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %r8,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <have_situs_suffix@plt>
cmp    $0x0,%rax
je     119f <write_vol+0x6f>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x40(%rbp),%r8
call   1030 <write_situs@plt>
jmp    11cf <write_vol+0x9f>
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x40(%rbp),%r9
mov    $0x1,%edi
call   1040 <write_mrc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_vol>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
call   1050 <have_situs_suffix@plt>
test   %rax,%rax
je     11a1 <write_vol+0x71>
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14,%r8
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <write_situs@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14,%r9
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <write_mrc@plt>

LLVM IR (-O0):
define void @write_vol(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, double* %8) {
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
store i8* %0, i8** %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store double* %8, double** %18
%19 = load i8*, i8** %10
%20 = call i64 @have_situs_suffix(i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %9
%23 = load i8*, i8** %10
%24 = load double, double* %11
%25 = load double, double* %12
%26 = load double, double* %13
%27 = load double, double* %14
%28 = load i32, i32* %15
%29 = load i32, i32* %16
%30 = load i32, i32* %17
%31 = load double*, double** %18
%32 = call i32 @write_situs(i8* %23, double %24, double %25, double %26, double %27, i32 %28, i32 %29, i32 %30, double* %31)
br label %44
33: ; preds = %9
%34 = load i8*, i8** %10
%35 = load double, double* %11
%36 = load double, double* %12
%37 = load double, double* %13
%38 = load double, double* %14
%39 = load i32, i32* %15
%40 = load i32, i32* %16
%41 = load i32, i32* %17
%42 = load double*, double** %18
%43 = call i32 @write_mrc(i32 1, i8* %34, double %35, double %36, double %37, double %38, i32 %39, i32 %40, i32 %41, double* %42)
br label %44
44: ; preds = %33, %22
ret void
}

LLVM IR (-O2):
define void @write_vol(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, double* %8) {
%10 = tail call i64 @have_situs_suffix(i8* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 @write_situs(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, double* %8)
br label %16
14: ; preds = %9
%15 = tail call i32 @write_mrc(i32 1, i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, double* %8)
br label %16
16: ; preds = %14, %12
ret void
}