#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 M_PI;
double cos(double);
double tan(double);
void hpc2hpl(double tx, double ty, double *x, double *y) {
  double ttx, tty;
  ttx = M_PI / 180.0 / 3600.0 * tx;
  tty = M_PI / 180.0 / 3600.0 * ty;
  *x = 180.0 / M_PI * 3600.0 * tan(ttx);
  *y = 180.0 / M_PI * 3600.0 * tan(tty) / cos(ttx);
  return;
}


x86 assembly (clang, -O0):
<hpc2hpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    0x2ea7(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e7a(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe8e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7a(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe6c(%rip),%xmm0
mov    0x2e45(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe51(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe2a(%rip),%xmm0
mov    0x2e03(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe0f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpc2hpl>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r15
movsd  (%r15),%xmm2
movsd  0xebd(%rip),%xmm3
movapd %xmm3,%xmm4
divsd  %xmm2,%xmm4
divsd  %xmm3,%xmm2
movsd  0xeb1(%rip),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x18(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rsp)
call   1030 <tan@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0xe70(%rip),%xmm0
divsd  (%r15),%xmm0
mulsd  0xe6b(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <tan@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @hpc2hpl(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double, double* @M_PI
%12 = fdiv double %11, 1.800000e+02
%13 = fdiv double %12, 3.600000e+03
%14 = load double, double* %5
%15 = fmul double %13, %14
store double %15, double* %9
%16 = load double, double* @M_PI
%17 = fdiv double %16, 1.800000e+02
%18 = fdiv double %17, 3.600000e+03
%19 = load double, double* %6
%20 = fmul double %18, %19
store double %20, double* %10
%21 = load double, double* @M_PI
%22 = fdiv double 1.800000e+02, %21
%23 = fmul double %22, 3.600000e+03
%24 = load double, double* %9
%25 = call double @tan(double %24)
%26 = fmul double %23, %25
%27 = load double*, double** %7
store double %26, double* %27
%28 = load double, double* @M_PI
%29 = fdiv double 1.800000e+02, %28
%30 = fmul double %29, 3.600000e+03
%31 = load double, double* %10
%32 = call double @tan(double %31)
%33 = fmul double %30, %32
%34 = load double, double* %9
%35 = call double @cos(double %34)
%36 = fdiv double %33, %35
%37 = load double*, double** %8
store double %36, double* %37
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @hpc2hpl(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = load double, double* @M_PI
%6 = fdiv double %5, 1.800000e+02
%7 = fdiv double %6, 3.600000e+03
%8 = fmul double %7, %0
%9 = fmul double %7, %1
%10 = fdiv double 1.800000e+02, %5
%11 = fmul double %10, 3.600000e+03
%12 = tail call double @tan(double %8)
%13 = fmul double %12, %11
store double %13, double* %2
%14 = load double, double* @M_PI
%15 = fdiv double 1.800000e+02, %14
%16 = fmul double %15, 3.600000e+03
%17 = tail call double @tan(double %9)
%18 = fmul double %17, %16
%19 = tail call double @cos(double %8)
%20 = fdiv double %18, %19
store double %20, double* %3
ret void
}