#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 sin(int);
double tan(int);
void ang2_H_L(double l_telemetre, double c_a, double s_a, double a, double *H,
              double *L) {
  double d;
  d = -1.0 * c_a / s_a;
  *H = (l_telemetre - 24.0 - d) * sin(2 * a);
  *L = 24.0 + d + *H / tan(2 * a);
}


x86 assembly (clang, -O0):
<ang2_H_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
subsd  %xmm1,%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe82(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe60(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe39(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <tan@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ang2_H_L>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
xorpd  0xed0(%rip),%xmm1
mov    %rsi,%r14
mov    %rdi,%rbx
divsd  %xmm2,%xmm1
movapd %xmm1,0x10(%rsp)
addsd  0xec8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  %xmm3,%xmm3
cvttsd2si %xmm3,%ebp
mov    %ebp,%edi
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,(%rbx)
movapd 0x10(%rsp),%xmm0
addsd  0xe99(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mov    %ebp,%edi
call   1040 <tan@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ang2_H_L(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%14 = load double, double* %8
%15 = fmul double -1.000000e+00, %14
%16 = load double, double* %9
%17 = fdiv double %15, %16
store double %17, double* %13
%18 = load double, double* %7
%19 = fsub double %18, 2.400000e+01
%20 = load double, double* %13
%21 = fsub double %19, %20
%22 = load double, double* %10
%23 = fmul double 2.000000e+00, %22
%24 = fptosi double %23 to i32
%25 = call double @sin(i32 %24)
%26 = fmul double %21, %25
%27 = load double*, double** %11
store double %26, double* %27
%28 = load double, double* %13
%29 = fadd double 2.400000e+01, %28
%30 = load double*, double** %11
%31 = load double, double* %30
%32 = load double, double* %10
%33 = fmul double 2.000000e+00, %32
%34 = fptosi double %33 to i32
%35 = call double @tan(i32 %34)
%36 = fdiv double %31, %35
%37 = fadd double %29, %36
%38 = load double*, double** %12
store double %37, double* %38
ret void
}

LLVM IR (-O2):
define void @ang2_H_L(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fneg double %1
%8 = fdiv double %7, %2
%9 = fadd double %0, -2.400000e+01
%10 = fsub double %9, %8
%11 = fmul double %3, 2.000000e+00
%12 = fptosi double %11 to i32
%13 = tail call double @sin(i32 %12)
%14 = fmul double %10, %13
store double %14, double* %4
%15 = fadd double %8, 2.400000e+01
%16 = tail call double @tan(i32 %12)
%17 = fdiv double %14, %16
%18 = fadd double %15, %17
store double %18, double* %5
ret void
}