#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 compute_1F1_3d(int, double, double, double, int);
scalar_t__ fabs(double);
double bingham_F_3d(double z1, double z2, double z3) {
  int iter =
      (((int)((((fabs(z1)) > (fabs(z2)) ? (fabs(z1)) : (fabs(z2)))) > (fabs(z3))
                  ? (((fabs(z1)) > (fabs(z2)) ? (fabs(z1)) : (fabs(z2))))
                  : (fabs(z3))) *
        10) > (10)
           ? ((int)((((fabs(z1)) > (fabs(z2)) ? (fabs(z1)) : (fabs(z2)))) >
                            (fabs(z3))
                        ? (((fabs(z1)) > (fabs(z2)) ? (fabs(z1)) : (fabs(z2))))
                        : (fabs(z3))) *
              10)
           : (10));
  return compute_1F1_3d(3, z1, z2, z3, iter);
}


x86 assembly (clang, -O0):
<bingham_F_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jle    1175 <bingham_F_3d+0x55>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x30(%rbp)
jmp    1183 <bingham_F_3d+0x63>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
jle    11fb <bingham_F_3d+0xdb>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
cmp    %rcx,%rax
jle    11e0 <bingham_F_3d+0xc0>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x48(%rbp)
jmp    11ee <bingham_F_3d+0xce>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    1209 <bingham_F_3d+0xe9>
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
imul   $0xa,%eax,%eax
cmp    $0xa,%eax
jle    12fa <bingham_F_3d+0x1da>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmp    %rcx,%rax
jle    1254 <bingham_F_3d+0x134>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x60(%rbp)
jmp    1262 <bingham_F_3d+0x142>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
cmp    %rcx,%rax
jle    12da <bingham_F_3d+0x1ba>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
cmp    %rcx,%rax
jle    12bf <bingham_F_3d+0x19f>
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x78(%rbp)
jmp    12cd <bingham_F_3d+0x1ad>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x80(%rbp)
jmp    12e8 <bingham_F_3d+0x1c8>
movsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
imul   $0xa,%eax,%eax
mov    %eax,-0x84(%rbp)
jmp    130a <bingham_F_3d+0x1ea>
mov    $0xa,%eax
mov    %eax,-0x84(%rbp)
jmp    130a <bingham_F_3d+0x1ea>
mov    -0x84(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x1c(%rbp),%esi
mov    $0x3,%edi
call   1030 <compute_1F1_3d@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bingham_F_3d>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm0
cmp    %rax,%rbx
jg     115b <bingham_F_3d+0x3b>
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x18(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x18(%rsp),%xmm0
cmp    %rax,%rbx
jle    11a3 <bingham_F_3d+0x83>
movsd  0x10(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm0
cmp    %rax,%rbx
jg     11a3 <bingham_F_3d+0x83>
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    $0xa,%esi
cmp    $0xb,%eax
jl     1233 <bingham_F_3d+0x113>
movsd  0x10(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm0
cmp    %rax,%rbx
jg     11e1 <bingham_F_3d+0xc1>
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x18(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x18(%rsp),%xmm0
cmp    %rax,%rbx
jle    1229 <bingham_F_3d+0x109>
movsd  0x10(%rsp),%xmm0
call   1040 <fabs@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
movsd  0x10(%rsp),%xmm0
cmp    %rax,%rbx
jg     1229 <bingham_F_3d+0x109>
movsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%esi
mov    $0x3,%edi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
add    $0x20,%rsp
pop    %rbx
jmp    1030 <compute_1F1_3d@plt>

LLVM IR (-O0):
define double @bingham_F_3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = call i64 @fabs(double %8)
%10 = load double, double* %5
%11 = call i64 @fabs(double %10)
%12 = icmp sgt i64 %9, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load double, double* %4
%15 = call i64 @fabs(double %14)
br label %19
16: ; preds = %3
%17 = load double, double* %5
%18 = call i64 @fabs(double %17)
br label %19
19: ; preds = %16, %13
%20 = phi i64 [ %15, %13 ], [ %18, %16 ]
%21 = load double, double* %6
%22 = call i64 @fabs(double %21)
%23 = icmp sgt i64 %20, %22
br i1 %23, label %24, label %38
24: ; preds = %19
%25 = load double, double* %4
%26 = call i64 @fabs(double %25)
%27 = load double, double* %5
%28 = call i64 @fabs(double %27)
%29 = icmp sgt i64 %26, %28
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = load double, double* %4
%32 = call i64 @fabs(double %31)
br label %36
33: ; preds = %24
%34 = load double, double* %5
%35 = call i64 @fabs(double %34)
br label %36
36: ; preds = %33, %30
%37 = phi i64 [ %32, %30 ], [ %35, %33 ]
br label %41
38: ; preds = %19
%39 = load double, double* %6
%40 = call i64 @fabs(double %39)
br label %41
41: ; preds = %38, %36
%42 = phi i64 [ %37, %36 ], [ %40, %38 ]
%43 = trunc i64 %42 to i32
%44 = mul nsw i32 %43, 10
%45 = icmp sgt i32 %44, 10
br i1 %45, label %46, label %84
46: ; preds = %41
%47 = load double, double* %4
%48 = call i64 @fabs(double %47)
%49 = load double, double* %5
%50 = call i64 @fabs(double %49)
%51 = icmp sgt i64 %48, %50
br i1 %51, label %52, label %55
52: ; preds = %46
%53 = load double, double* %4
%54 = call i64 @fabs(double %53)
br label %58
55: ; preds = %46
%56 = load double, double* %5
%57 = call i64 @fabs(double %56)
br label %58
58: ; preds = %55, %52
%59 = phi i64 [ %54, %52 ], [ %57, %55 ]
%60 = load double, double* %6
%61 = call i64 @fabs(double %60)
%62 = icmp sgt i64 %59, %61
br i1 %62, label %63, label %77
63: ; preds = %58
%64 = load double, double* %4
%65 = call i64 @fabs(double %64)
%66 = load double, double* %5
%67 = call i64 @fabs(double %66)
%68 = icmp sgt i64 %65, %67
br i1 %68, label %69, label %72
69: ; preds = %63
%70 = load double, double* %4
%71 = call i64 @fabs(double %70)
br label %75
72: ; preds = %63
%73 = load double, double* %5
%74 = call i64 @fabs(double %73)
br label %75
75: ; preds = %72, %69
%76 = phi i64 [ %71, %69 ], [ %74, %72 ]
br label %80
77: ; preds = %58
%78 = load double, double* %6
%79 = call i64 @fabs(double %78)
br label %80
80: ; preds = %77, %75
%81 = phi i64 [ %76, %75 ], [ %79, %77 ]
%82 = trunc i64 %81 to i32
%83 = mul nsw i32 %82, 10
br label %85
84: ; preds = %41
br label %85
85: ; preds = %84, %80
%86 = phi i32 [ %83, %80 ], [ 10, %84 ]
store i32 %86, i32* %7
%87 = load double, double* %4
%88 = load double, double* %5
%89 = load double, double* %6
%90 = load i32, i32* %7
%91 = call double @compute_1F1_3d(i32 3, double %87, double %88, double %89, i32 %90)
ret double %91
}

LLVM IR (-O2):
define double @bingham_F_3d(double %0, double %1, double %2) {
%4 = tail call i64 @fabs(double %0)
%5 = tail call i64 @fabs(double %1)
%6 = icmp sgt i64 %4, %5
%7 = select i1 %6, double %0, double %1
%8 = tail call i64 @fabs(double %7)
%9 = tail call i64 @fabs(double %2)
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = tail call i64 @fabs(double %0)
%13 = tail call i64 @fabs(double %1)
%14 = icmp sgt i64 %12, %13
%15 = select i1 %14, double %0, double %1
br label %16
16: ; preds = %3, %11
%17 = phi double [ %15, %11 ], [ %2, %3 ]
%18 = tail call i64 @fabs(double %17)
%19 = trunc i64 %18 to i32
%20 = mul nsw i32 %19, 10
%21 = icmp sgt i32 %20, 10
br i1 %21, label %22, label %40
22: ; preds = %16
%23 = tail call i64 @fabs(double %0)
%24 = tail call i64 @fabs(double %1)
%25 = icmp sgt i64 %23, %24
%26 = select i1 %25, double %0, double %1
%27 = tail call i64 @fabs(double %26)
%28 = tail call i64 @fabs(double %2)
%29 = icmp sgt i64 %27, %28
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = tail call i64 @fabs(double %0)
%32 = tail call i64 @fabs(double %1)
%33 = icmp sgt i64 %31, %32
%34 = select i1 %33, double %0, double %1
br label %35
35: ; preds = %22, %30
%36 = phi double [ %34, %30 ], [ %2, %22 ]
%37 = tail call i64 @fabs(double %36)
%38 = trunc i64 %37 to i32
%39 = mul nsw i32 %38, 10
br label %40
40: ; preds = %16, %35
%41 = phi i32 [ %39, %35 ], [ 10, %16 ]
%42 = tail call double @compute_1F1_3d(i32 3, double %0, double %1, double %2, i32 %41)
ret double %42
}