#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 asin(int);
float atan2(int, int);
int cos(float);
int sin(float);
void pandg_back(float *lat, float *lon, float a, float b, float r) {
  float pr, gr, pm, gm;
  pr = (3.14159265 / 180.0) * *lat;
  gr = -(3.14159265 / 180.0) * *lon;
  pm = asin(cos(pr) * cos(gr));
  gm = atan2(cos(pr) * sin(gr), -sin(pr));
  *lat = (180.0 / 3.14159265) *
         asin(sin(a) * sin(pm) - cos(a) * cos(pm) * cos(gm - r));
  *lon = -(180.0 / 3.14159265) *
         (-b + atan2(cos(pm) * sin(gm - r),
                     sin(a) * cos(pm) * cos(gm - r) + cos(a) * sin(pm)));
  return;
}


x86 assembly (clang, -O0):
<pandg_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x64(%rbp)
movss  -0x24(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x64(%rbp),%edi
imul   %eax,%edi
call   1050 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x60(%rbp)
movss  -0x24(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x5c(%rbp)
movss  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x5c(%rbp),%edi
xor    %esi,%esi
sub    %eax,%esi
call   1030 <atan2@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x58(%rbp)
movss  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x50(%rbp)
movss  -0x14(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x54(%rbp)
movss  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4c(%rbp)
movss  -0x2c(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x50(%rbp),%edi
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
imul   %ecx,%eax
sub    %eax,%edi
call   1050 <asin@plt>
movaps %xmm0,%xmm1
movsd  0xd8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x48(%rbp)
movss  -0x2c(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x44(%rbp)
movss  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x40(%rbp)
movss  -0x2c(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x3c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x34(%rbp)
movss  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edi
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
imul   %ecx,%eax
add    %eax,%esi
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movss  -0x30(%rbp),%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pandg_back>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0x1c(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe8c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe7a(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x14(%rsp)
call   1060 <cos@plt>
mov    %eax,%ebp
movss  0x14(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebp
mov    %ebp,%edi
call   1050 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebp
movss  0x14(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%ebp
movss  0x8(%rsp),%xmm0
call   1040 <sin@plt>
neg    %eax
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <atan2@plt>
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ebp
movss  0xc(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%ebp
movss  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%r12d
movss  0xc(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
subss  0x18(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
call   1060 <cos@plt>
imul   %r12d,%eax
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%edi
call   1050 <asin@plt>
mulsd  0xdb6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15)
movss  0xc(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%r12d
movss  0x8(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%r12d
movss  0x10(%rsp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ebp
movss  0xc(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%r15d
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebp
imul   %r15d,%ebp
movss  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%ebx
add    %ebp,%ebx
mov    %r12d,%edi
mov    %ebx,%esi
call   1030 <atan2@plt>
subss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xd32(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @pandg_back(float* %0, float* %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%15 = load float*, float** %6
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = fmul double 0x3F91DF46A1FAE712, %17
%19 = fptrunc double %18 to float
store float %19, float* %11
%20 = load float*, float** %7
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = fmul double 0xBF91DF46A1FAE712, %22
%24 = fptrunc double %23 to float
store float %24, float* %12
%25 = load float, float* %11
%26 = call i32 @cos(float %25)
%27 = load float, float* %12
%28 = call i32 @cos(float %27)
%29 = mul nsw i32 %26, %28
%30 = call double @asin(i32 %29)
%31 = fptrunc double %30 to float
store float %31, float* %13
%32 = load float, float* %11
%33 = call i32 @cos(float %32)
%34 = load float, float* %12
%35 = call i32 @sin(float %34)
%36 = mul nsw i32 %33, %35
%37 = load float, float* %11
%38 = call i32 @sin(float %37)
%39 = sub nsw i32 0, %38
%40 = call float @atan2(i32 %36, i32 %39)
store float %40, float* %14
%41 = load float, float* %8
%42 = call i32 @sin(float %41)
%43 = load float, float* %13
%44 = call i32 @sin(float %43)
%45 = mul nsw i32 %42, %44
%46 = load float, float* %8
%47 = call i32 @cos(float %46)
%48 = load float, float* %13
%49 = call i32 @cos(float %48)
%50 = mul nsw i32 %47, %49
%51 = load float, float* %14
%52 = load float, float* %10
%53 = fsub float %51, %52
%54 = call i32 @cos(float %53)
%55 = mul nsw i32 %50, %54
%56 = sub nsw i32 %45, %55
%57 = call double @asin(i32 %56)
%58 = fmul double 0x404CA5DC1AF05A77, %57
%59 = fptrunc double %58 to float
%60 = load float*, float** %6
store float %59, float* %60
%61 = load float, float* %9
%62 = fneg float %61
%63 = load float, float* %13
%64 = call i32 @cos(float %63)
%65 = load float, float* %14
%66 = load float, float* %10
%67 = fsub float %65, %66
%68 = call i32 @sin(float %67)
%69 = mul nsw i32 %64, %68
%70 = load float, float* %8
%71 = call i32 @sin(float %70)
%72 = load float, float* %13
%73 = call i32 @cos(float %72)
%74 = mul nsw i32 %71, %73
%75 = load float, float* %14
%76 = load float, float* %10
%77 = fsub float %75, %76
%78 = call i32 @cos(float %77)
%79 = mul nsw i32 %74, %78
%80 = load float, float* %8
%81 = call i32 @cos(float %80)
%82 = load float, float* %13
%83 = call i32 @sin(float %82)
%84 = mul nsw i32 %81, %83
%85 = add nsw i32 %79, %84
%86 = call float @atan2(i32 %69, i32 %85)
%87 = fadd float %62, %86
%88 = fpext float %87 to double
%89 = fmul double 0xC04CA5DC1AF05A77, %88
%90 = fptrunc double %89 to float
%91 = load float*, float** %7
store float %90, float* %91
ret void
}

LLVM IR (-O2):
define void @pandg_back(float* nocapture %0, float* nocapture %1, float %2, float %3, float %4) {
%6 = load float, float* %0
%7 = fpext float %6 to double
%8 = fmul double %7, 0x3F91DF46A1FAE712
%9 = fptrunc double %8 to float
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul double %11, 0xBF91DF46A1FAE712
%13 = fptrunc double %12 to float
%14 = tail call i32 @cos(float %9)
%15 = tail call i32 @cos(float %13)
%16 = mul nsw i32 %15, %14
%17 = tail call double @asin(i32 %16)
%18 = fptrunc double %17 to float
%19 = tail call i32 @cos(float %9)
%20 = tail call i32 @sin(float %13)
%21 = mul nsw i32 %20, %19
%22 = tail call i32 @sin(float %9)
%23 = sub nsw i32 0, %22
%24 = tail call float @atan2(i32 %21, i32 %23)
%25 = tail call i32 @sin(float %2)
%26 = tail call i32 @sin(float %18)
%27 = mul nsw i32 %26, %25
%28 = tail call i32 @cos(float %2)
%29 = tail call i32 @cos(float %18)
%30 = mul nsw i32 %29, %28
%31 = fsub float %24, %4
%32 = tail call i32 @cos(float %31)
%33 = mul nsw i32 %30, %32
%34 = sub nsw i32 %27, %33
%35 = tail call double @asin(i32 %34)
%36 = fmul double %35, 0x404CA5DC1AF05A77
%37 = fptrunc double %36 to float
store float %37, float* %0
%38 = tail call i32 @cos(float %18)
%39 = tail call i32 @sin(float %31)
%40 = mul nsw i32 %39, %38
%41 = tail call i32 @sin(float %2)
%42 = tail call i32 @cos(float %18)
%43 = mul nsw i32 %42, %41
%44 = tail call i32 @cos(float %31)
%45 = mul nsw i32 %43, %44
%46 = tail call i32 @cos(float %2)
%47 = tail call i32 @sin(float %18)
%48 = mul nsw i32 %47, %46
%49 = add nsw i32 %48, %45
%50 = tail call float @atan2(i32 %40, i32 %49)
%51 = fsub float %50, %3
%52 = fpext float %51 to double
%53 = fmul double %52, 0xC04CA5DC1AF05A77
%54 = fptrunc double %53 to float
store float %54, float* %1
ret void
}