#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 acosh(double);
double cos(double);
double cosh(double);
double sin(double);
double sinh(double);
double computec(double al, double be, char imag1, double ga, char imag2) {
  double t = imag2 ? cosh(ga) : cos(ga);
  if (imag1)
    return acosh((t + cosh(al) * cosh(be)) / (sinh(al) * sinh(be)));
  else
    return acosh((t + cos(al) * cos(be)) / (sin(al) * sin(be)));
}


x86 assembly (clang, -O0):
<computec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %sil,%al
mov    %dil,%cl
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %al,-0x29(%rbp)
movsbl -0x29(%rbp),%eax
cmp    $0x0,%eax
je     1197 <computec+0x47>
movsd  -0x28(%rbp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    11a6 <computec+0x56>
movsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpb   $0x0,-0x19(%rbp)
je     1234 <computec+0xe4>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cosh@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sinh@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1050 <acosh@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    12a9 <computec+0x159>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <sin@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1050 <acosh@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computec>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm2,%xmm0
test   %sil,%sil
je     1171 <computec+0x21>
call   1040 <cosh@plt>
jmp    1176 <computec+0x26>
call   1070 <cos@plt>
movsd  %xmm0,0x8(%rsp)
test   %bl,%bl
je     11c9 <computec+0x79>
movsd  (%rsp),%xmm0
call   1040 <cosh@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cosh@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sinh@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sinh@plt>
jmp    1210 <computec+0xc0>
movsd  (%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
jmp    1050 <acosh@plt>

LLVM IR (-O0):
define double @computec(double %0, double %1, i8 signext %2, double %3, i8 signext %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i8
%10 = alloca double
%11 = alloca i8
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store i8 %2, i8* %9
store double %3, double* %10
store i8 %4, i8* %11
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %5
%17 = load double, double* %10
%18 = call double @cosh(double %17)
br label %22
19: ; preds = %5
%20 = load double, double* %10
%21 = call double @cos(double %20)
br label %22
22: ; preds = %19, %16
%23 = phi double [ %18, %16 ], [ %21, %19 ]
store double %23, double* %12
%24 = load i8, i8* %9
%25 = icmp ne i8 %24, 0
br i1 %25, label %26, label %40
26: ; preds = %22
%27 = load double, double* %12
%28 = load double, double* %7
%29 = call double @cosh(double %28)
%30 = load double, double* %8
%31 = call double @cosh(double %30)
%32 = call double @llvm.fmuladd.f64(double %29, double %31, double %27)
%33 = load double, double* %7
%34 = call double @sinh(double %33)
%35 = load double, double* %8
%36 = call double @sinh(double %35)
%37 = fmul double %34, %36
%38 = fdiv double %32, %37
%39 = call double @acosh(double %38)
store double %39, double* %6
br label %54
40: ; preds = %22
%41 = load double, double* %12
%42 = load double, double* %7
%43 = call double @cos(double %42)
%44 = load double, double* %8
%45 = call double @cos(double %44)
%46 = call double @llvm.fmuladd.f64(double %43, double %45, double %41)
%47 = load double, double* %7
%48 = call double @sin(double %47)
%49 = load double, double* %8
%50 = call double @sin(double %49)
%51 = fmul double %48, %50
%52 = fdiv double %46, %51
%53 = call double @acosh(double %52)
store double %53, double* %6
br label %54
54: ; preds = %40, %26
%55 = load double, double* %6
ret double %55
}

LLVM IR (-O2):
define double @computec(double %0, double %1, i8 signext %2, double %3, i8 signext %4) {
%6 = icmp eq i8 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call double @cosh(double %3)
br label %11
9: ; preds = %5
%10 = tail call double @cos(double %3)
br label %11
11: ; preds = %9, %7
%12 = phi double [ %8, %7 ], [ %10, %9 ]
%13 = icmp eq i8 %2, 0
br i1 %13, label %22, label %14
14: ; preds = %11
%15 = tail call double @cosh(double %0)
%16 = tail call double @cosh(double %1)
%17 = tail call double @llvm.fmuladd.f64(double %15, double %16, double %12)
%18 = tail call double @sinh(double %0)
%19 = tail call double @sinh(double %1)
%20 = fmul double %18, %19
%21 = fdiv double %17, %20
br label %30
22: ; preds = %11
%23 = tail call double @cos(double %0)
%24 = tail call double @cos(double %1)
%25 = tail call double @llvm.fmuladd.f64(double %23, double %24, double %12)
%26 = tail call double @sin(double %0)
%27 = tail call double @sin(double %1)
%28 = fmul double %26, %27
%29 = fdiv double %25, %28
br label %30
30: ; preds = %22, %14
%31 = phi double [ %29, %22 ], [ %21, %14 ]
%32 = tail call double @acosh(double %31)
ret double %32
}