#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 atan(double);
double sqrt(double);
void hpl2hpc(double x, double y, double *tx, double *ty) {
  double xx, yy;
  double g;
  xx = M_PI / 180.0 / 3600.0 * x;
  yy = M_PI / 180.0 / 3600.0 * y;
  g = yy / sqrt(1.0 + xx * xx);
  *tx = 180.0 / M_PI * 3600.0 * atan(xx);
  *ty = 180.0 / M_PI * 3600.0 * atan(g);
  return;
}


x86 assembly (clang, -O0):
<hpl2hpc>:
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  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe32(%rip),%xmm0
mov    0x2e0b(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xe17(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xdf0(%rip),%xmm0
mov    0x2dc9(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xdd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpl2hpc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movapd %xmm0,%xmm3
mov    0x2eae(%rip),%rbx
movsd  (%rbx),%xmm2
divsd  0xeba(%rip),%xmm2
divsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117c <hpl2hpc+0x5c>
sqrtsd %xmm0,%xmm0
jmp    118b <hpl2hpc+0x6b>
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe5d(%rip),%xmm0
divsd  (%rbx),%xmm0
mulsd  0xe59(%rip),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm3,%xmm0
call   1030 <atan@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0xe31(%rip),%xmm0
divsd  (%rbx),%xmm0
mulsd  0xe2d(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <atan@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @hpl2hpc(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
%11 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%12 = load double, double* @M_PI
%13 = fdiv double %12, 1.800000e+02
%14 = fdiv double %13, 3.600000e+03
%15 = load double, double* %5
%16 = fmul double %14, %15
store double %16, double* %9
%17 = load double, double* @M_PI
%18 = fdiv double %17, 1.800000e+02
%19 = fdiv double %18, 3.600000e+03
%20 = load double, double* %6
%21 = fmul double %19, %20
store double %21, double* %10
%22 = load double, double* %10
%23 = load double, double* %9
%24 = load double, double* %9
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double 1.000000e+00)
%26 = call double @sqrt(double %25)
%27 = fdiv double %22, %26
store double %27, double* %11
%28 = load double, double* @M_PI
%29 = fdiv double 1.800000e+02, %28
%30 = fmul double %29, 3.600000e+03
%31 = load double, double* %9
%32 = call double @atan(double %31)
%33 = fmul double %30, %32
%34 = load double*, double** %7
store double %33, double* %34
%35 = load double, double* @M_PI
%36 = fdiv double 1.800000e+02, %35
%37 = fmul double %36, 3.600000e+03
%38 = load double, double* %11
%39 = call double @atan(double %38)
%40 = fmul double %37, %39
%41 = load double*, double** %8
store double %40, double* %41
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @hpl2hpc(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 = tail call double @llvm.fmuladd.f64(double %8, double %8, double 1.000000e+00)
%11 = tail call double @sqrt(double %10)
%12 = fdiv double %9, %11
%13 = load double, double* @M_PI
%14 = fdiv double 1.800000e+02, %13
%15 = fmul double %14, 3.600000e+03
%16 = tail call double @atan(double %8)
%17 = fmul double %16, %15
store double %17, double* %2
%18 = load double, double* @M_PI
%19 = fdiv double 1.800000e+02, %18
%20 = fmul double %19, 3.600000e+03
%21 = tail call double @atan(double %12)
%22 = fmul double %21, %20
store double %22, double* %3
ret void
}