#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 */
double bingham_F_3d(double, double, double);
int /*<<< orphan*/ printf(char *, ...);
void compute_all_bingham_F_3d(double z1_min, double z1_max, double z1_step,
                              double z2_min, double z2_max, double z2_step,
                              double z3_min, double z3_max, double z3_step) {
  double z1, z2, z3;
  int k = 0;
  printf("F = [];\n\n");
  for (z3 = z3_min; z3 <= z3_max; z3 += z3_step) {
    k++;
    printf("F(:,:,%d) = [ ...\n", k);
    for (z1 = z1_min; z1 <= z1_max; z1 += z1_step) {
      for (z2 = z2_min; z2 <= z2_max; z2 += z2_step)
        printf("%f ", z1 <= z2 && z2 <= z3 ? bingham_F_3d(z1, z2, z3) : 0.0);
      printf("; ...\n");
    }
    printf("];\n\n");
  }
}


x86 assembly (clang, -O0):
<compute_all_bingham_F_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movl   $0x0,-0x5c(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     129d <compute_all_bingham_F_3d+0x17d>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     127b <compute_all_bingham_F_3d+0x15b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1259 <compute_all_bingham_F_3d+0x139>
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1225 <compute_all_bingham_F_3d+0x105>
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1225 <compute_all_bingham_F_3d+0x105>
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
call   1040 <bingham_F_3d@plt>
movsd  %xmm0,-0x68(%rbp)
jmp    1232 <compute_all_bingham_F_3d+0x112>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1232 <compute_all_bingham_F_3d+0x112>
movsd  -0x68(%rbp),%xmm0
lea    0xddf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11cb <compute_all_bingham_F_3d+0xab>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11ad <compute_all_bingham_F_3d+0x8d>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0x10(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1175 <compute_all_bingham_F_3d+0x55>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_all_bingham_F_3d>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
movsd  %xmm7,0x10(%rsp)
movsd  %xmm6,(%rsp)
movsd  %xmm5,0x48(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x40(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm0
ucomisd (%rsp),%xmm0
jae    1191 <compute_all_bingham_F_3d+0x61>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe68(%rip),%r14
lea    0xe7d(%rip),%r15
lea    0xe7a(%rip),%r12
lea    0xe66(%rip),%rbx
xor    %ebp,%ebp
jmp    11e7 <compute_all_bingham_F_3d+0xb7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm1
addsd  0x80(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  %xmm1,(%rsp)
ucomisd %xmm1,%xmm0
jb     1184 <compute_all_bingham_F_3d+0x54>
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
ucomisd 0x18(%rsp),%xmm0
jb     11c0 <compute_all_bingham_F_3d+0x90>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    124a <compute_all_bingham_F_3d+0x11a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm1
addsd  0x40(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
movsd  %xmm1,0x8(%rsp)
ucomisd %xmm1,%xmm0
jb     11c0 <compute_all_bingham_F_3d+0x90>
movsd  0x30(%rsp),%xmm0
ucomisd 0x28(%rsp),%xmm0
jb     1220 <compute_all_bingham_F_3d+0xf0>
movsd  0x28(%rsp),%xmm2
jmp    1282 <compute_all_bingham_F_3d+0x152>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm2
addsd  0x48(%rsp),%xmm2
movsd  0x30(%rsp),%xmm0
ucomisd %xmm2,%xmm0
jb     1220 <compute_all_bingham_F_3d+0xf0>
ucomisd 0x8(%rsp),%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm2,0x38(%rsp)
jb     1260 <compute_all_bingham_F_3d+0x130>
movsd  (%rsp),%xmm1
ucomisd %xmm2,%xmm1
jb     1260 <compute_all_bingham_F_3d+0x130>
movsd  0x8(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1050 <bingham_F_3d@plt>
jmp    1260 <compute_all_bingham_F_3d+0x130>

LLVM IR (-O0):
@.str = [10 x i8] c"F = [];\0A\0A\00"
@.str.1 = [19 x i8] c"F(:,:,%d) = [ ...\0A\00"
@.str.2 = [4 x i8] c"%f \00"
@.str.3 = [7 x i8] c"; ...\0A\00"
@.str.4 = [5 x i8] c"];\0A\0A\00"
define void @compute_all_bingham_F_3d(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca i32
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
store i32 0, i32* %22
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%24 = load double, double* %16
store double %24, double* %21
br label %25
25: ; preds = %74, %9
%26 = load double, double* %21
%27 = load double, double* %17
%28 = fcmp ole double %26, %27
br i1 %28, label %29, label %78
29: ; preds = %25
%30 = load i32, i32* %22
%31 = add nsw i32 %30, 1
store i32 %31, i32* %22
%32 = load i32, i32* %22
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = load double, double* %10
store double %34, double* %19
br label %35
35: ; preds = %68, %29
%36 = load double, double* %19
%37 = load double, double* %11
%38 = fcmp ole double %36, %37
br i1 %38, label %39, label %72
39: ; preds = %35
%40 = load double, double* %13
store double %40, double* %20
br label %41
41: ; preds = %62, %39
%42 = load double, double* %20
%43 = load double, double* %14
%44 = fcmp ole double %42, %43
br i1 %44, label %45, label %66
45: ; preds = %41
%46 = load double, double* %19
%47 = load double, double* %20
%48 = fcmp ole double %46, %47
br i1 %48, label %49, label %58
49: ; preds = %45
%50 = load double, double* %20
%51 = load double, double* %21
%52 = fcmp ole double %50, %51
br i1 %52, label %53, label %58
53: ; preds = %49
%54 = load double, double* %19
%55 = load double, double* %20
%56 = load double, double* %21
%57 = call double @bingham_F_3d(double %54, double %55, double %56)
br label %59
58: ; preds = %49, %45
br label %59
59: ; preds = %58, %53
%60 = phi double [ %57, %53 ], [ 0.000000e+00, %58 ]
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %60)
br label %62
62: ; preds = %59
%63 = load double, double* %15
%64 = load double, double* %20
%65 = fadd double %64, %63
store double %65, double* %20
br label %41
66: ; preds = %41
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %68
68: ; preds = %66
%69 = load double, double* %12
%70 = load double, double* %19
%71 = fadd double %70, %69
store double %71, double* %19
br label %35
72: ; preds = %35
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %74
74: ; preds = %72
%75 = load double, double* %18
%76 = load double, double* %21
%77 = fadd double %76, %75
store double %77, double* %21
br label %25
78: ; preds = %25
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"F(:,:,%d) = [ ...\0A\00"
@.str.2 = [4 x i8] c"%f \00"
@str = [9 x i8] c"F = [];\0A\00"
@str.5 = [4 x i8] c"];\0A\00"
@str.6 = [6 x i8] c"; ...\00"
define void @compute_all_bingham_F_3d(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%11 = fcmp ugt double %6, %7
br i1 %11, label %42, label %12
12: ; preds = %9
%13 = fcmp ugt double %0, %1
%14 = fcmp ugt double %3, %4
br label %15
15: ; preds = %12, %38
%16 = phi i32 [ 0, %12 ], [ %18, %38 ]
%17 = phi double [ %6, %12 ], [ %40, %38 ]
%18 = add nuw nsw i32 %16, 1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br i1 %13, label %38, label %20
20: ; preds = %15, %34
%21 = phi double [ %36, %34 ], [ %0, %15 ]
br i1 %14, label %34, label %22
22: ; preds = %20, %29
%23 = phi double [ %32, %29 ], [ %3, %20 ]
%24 = fcmp ugt double %21, %23
%25 = fcmp ugt double %23, %17
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %29, label %27
27: ; preds = %22
%28 = tail call double @bingham_F_3d(double %21, double %23, double %17)
br label %29
29: ; preds = %22, %27
%30 = phi double [ %28, %27 ], [ 0.000000e+00, %22 ]
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %30)
%32 = fadd double %23, %5
%33 = fcmp ugt double %32, %4
br i1 %33, label %34, label %22
34: ; preds = %29, %20
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.6, i64 0, i64 0))
%36 = fadd double %21, %2
%37 = fcmp ugt double %36, %1
br i1 %37, label %38, label %20
38: ; preds = %34, %15
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0))
%40 = fadd double %17, %8
%41 = fcmp ugt double %40, %7
br i1 %41, label %42, label %15
42: ; preds = %38, %9
ret void
}