#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 */
int /*<<< orphan*/ rad(long double);
int sin(int /*<<< orphan*/);
int sqrt(int);
void gall_peter(long double *a, long double *A) {
  A[0] = 6371000. * 3.14159265358979323846264338327950288419716939937510582097 *
         a[1] / (180. * sqrt(2));
  A[1] = 6371000. * sqrt(2) * sin(rad(a[0]));
  return;
}


x86 assembly (clang, -O0):
<gall_peter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   0x10(%rax)
fldl   0xeb3(%rip)
fmulp  %st,%st(1)
fstpt  -0x38(%rbp)
mov    $0x2,%edi
mov    %edi,-0x2c(%rbp)
call   1050 <sqrt@plt>
fldt   -0x38(%rbp)
mov    -0x2c(%rbp),%edi
cvtsi2sd %eax,%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fdivrp %st,%st(1)
mov    -0x10(%rbp),%rax
fstpt  (%rax)
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
mov    -0x10(%rbp),%rax
fstpt  0x10(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gall_peter>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
fldt   0x10(%rdi)
fmull  0xeba(%rip)
fstpt  0x18(%rsp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xea8(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
fldt   0x18(%rsp)
fdivl  0x30(%rsp)
fstpt  (%r14)
mov    $0x2,%edi
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe86(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
fldt   (%rbx)
fstpt  (%rsp)
call   1040 <rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
fldl   0x28(%rsp)
fstpt  0x10(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gall_peter(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = getelementptr inbounds x86_fp80, x86_fp80* %5, i64 1
%7 = load x86_fp80, x86_fp80* %6
%8 = fmul x86_fp80 0xK401798B3F765E4008800, %7
%9 = call i32 @sqrt(i32 2)
%10 = sitofp i32 %9 to double
%11 = fmul double 1.800000e+02, %10
%12 = fpext double %11 to x86_fp80
%13 = fdiv x86_fp80 %8, %12
%14 = load x86_fp80*, x86_fp80** %4
%15 = getelementptr inbounds x86_fp80, x86_fp80* %14, i64 0
store x86_fp80 %13, x86_fp80* %15
%16 = call i32 @sqrt(i32 2)
%17 = sitofp i32 %16 to double
%18 = fmul double 6.371000e+06, %17
%19 = load x86_fp80*, x86_fp80** %3
%20 = getelementptr inbounds x86_fp80, x86_fp80* %19, i64 0
%21 = load x86_fp80, x86_fp80* %20
%22 = call i32 @rad(x86_fp80 %21)
%23 = call i32 @sin(i32 %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %18, %24
%26 = fpext double %25 to x86_fp80
%27 = load x86_fp80*, x86_fp80** %4
%28 = getelementptr inbounds x86_fp80, x86_fp80* %27, i64 1
store x86_fp80 %26, x86_fp80* %28
ret void
}

LLVM IR (-O2):
define void @gall_peter(x86_fp80* nocapture %0, x86_fp80* nocapture writeonly %1) {
%3 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 1
%4 = load x86_fp80, x86_fp80* %3
%5 = fmul x86_fp80 %4, 0xK401798B3F765E4008800
%6 = tail call i32 @sqrt(i32 2)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.800000e+02
%9 = fpext double %8 to x86_fp80
%10 = fdiv x86_fp80 %5, %9
store x86_fp80 %10, x86_fp80* %1
%11 = tail call i32 @sqrt(i32 2)
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 6.371000e+06
%14 = load x86_fp80, x86_fp80* %0
%15 = tail call i32 @rad(x86_fp80 %14)
%16 = tail call i32 @sin(i32 %15)
%17 = sitofp i32 %16 to double
%18 = fmul double %13, %17
%19 = fpext double %18 to x86_fp80
%20 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 1
store x86_fp80 %19, x86_fp80* %20
ret void
}