#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);
double atan2(int, int);
int cos(float);
int sin(float);
void pandg_for(float *lat, float *lon, float a, float b, float r) {
  float p1, g1, p, g;
  p1 = (3.14159265 / 180.0) * *lat;
  g1 = -(3.14159265 / 180.0) * *lon;
  p = asin(sin(a) * sin(p1) + cos(a) * cos(p1) * cos(g1 + b));
  g = r + atan2(cos(p1) * sin(g1 + b),
                sin(a) * cos(p1) * cos(g1 + b) - cos(a) * sin(p1));
  *lat = (180.0 / 3.14159265) * asin(-cos(p) * cos(g));
  *lon = -(180.0 / 3.14159265) * atan2(cos(p) * sin(g), sin(p));
  return;
}


x86 assembly (clang, -O0):
<pandg_for>:
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  -0x14(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x68(%rbp)
movss  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x60(%rbp)
movss  -0x14(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x64(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x5c(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x60(%rbp),%edi
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1050 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x58(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x48(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,-0x54(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x50(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x44(%rbp)
movss  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x4c(%rbp),%esi
mov    -0x48(%rbp),%edi
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
imul   %ecx,%eax
sub    %eax,%esi
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x38(%rbp),%edi
imul   %eax,%edi
call   1050 <asin@plt>
movaps %xmm0,%xmm1
movsd  0xd14(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x34(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  0xcbb(%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_for>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x14(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
movss  (%rdi),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe8c(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x8(%rsp)
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe7a(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x10(%rsp)
call   1040 <sin@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%ebx
movss  0x14(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebp
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebp
movss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
call   1060 <cos@plt>
imul   %eax,%ebp
add    %ebx,%ebp
mov    %ebp,%edi
call   1050 <asin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%r12d
movss  0x10(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%r12d
movss  0x14(%rsp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebx
movss  0x10(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebx
movss  0x14(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebp
movss  0x8(%rsp),%xmm0
call   1040 <sin@plt>
imul   %ebp,%eax
sub    %eax,%ebx
mov    %r12d,%edi
mov    %ebx,%esi
call   1030 <atan2@plt>
addsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebx
neg    %ebx
mov    %ebx,%edi
call   1050 <asin@plt>
mulsd  0xd62(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15)
movss  0xc(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
call   1040 <sin@plt>
imul   %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1040 <sin@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <atan2@plt>
mulsd  0xd2a(%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_for(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* %8
%26 = call i32 @sin(float %25)
%27 = load float, float* %11
%28 = call i32 @sin(float %27)
%29 = mul nsw i32 %26, %28
%30 = load float, float* %8
%31 = call i32 @cos(float %30)
%32 = load float, float* %11
%33 = call i32 @cos(float %32)
%34 = mul nsw i32 %31, %33
%35 = load float, float* %12
%36 = load float, float* %9
%37 = fadd float %35, %36
%38 = call i32 @cos(float %37)
%39 = mul nsw i32 %34, %38
%40 = add nsw i32 %29, %39
%41 = call double @asin(i32 %40)
%42 = fptrunc double %41 to float
store float %42, float* %13
%43 = load float, float* %10
%44 = fpext float %43 to double
%45 = load float, float* %11
%46 = call i32 @cos(float %45)
%47 = load float, float* %12
%48 = load float, float* %9
%49 = fadd float %47, %48
%50 = call i32 @sin(float %49)
%51 = mul nsw i32 %46, %50
%52 = load float, float* %8
%53 = call i32 @sin(float %52)
%54 = load float, float* %11
%55 = call i32 @cos(float %54)
%56 = mul nsw i32 %53, %55
%57 = load float, float* %12
%58 = load float, float* %9
%59 = fadd float %57, %58
%60 = call i32 @cos(float %59)
%61 = mul nsw i32 %56, %60
%62 = load float, float* %8
%63 = call i32 @cos(float %62)
%64 = load float, float* %11
%65 = call i32 @sin(float %64)
%66 = mul nsw i32 %63, %65
%67 = sub nsw i32 %61, %66
%68 = call double @atan2(i32 %51, i32 %67)
%69 = fadd double %44, %68
%70 = fptrunc double %69 to float
store float %70, float* %14
%71 = load float, float* %13
%72 = call i32 @cos(float %71)
%73 = sub nsw i32 0, %72
%74 = load float, float* %14
%75 = call i32 @cos(float %74)
%76 = mul nsw i32 %73, %75
%77 = call double @asin(i32 %76)
%78 = fmul double 0x404CA5DC1AF05A77, %77
%79 = fptrunc double %78 to float
%80 = load float*, float** %6
store float %79, float* %80
%81 = load float, float* %13
%82 = call i32 @cos(float %81)
%83 = load float, float* %14
%84 = call i32 @sin(float %83)
%85 = mul nsw i32 %82, %84
%86 = load float, float* %13
%87 = call i32 @sin(float %86)
%88 = call double @atan2(i32 %85, i32 %87)
%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_for(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 @sin(float %2)
%15 = tail call i32 @sin(float %9)
%16 = mul nsw i32 %15, %14
%17 = tail call i32 @cos(float %2)
%18 = tail call i32 @cos(float %9)
%19 = mul nsw i32 %18, %17
%20 = fadd float %13, %3
%21 = tail call i32 @cos(float %20)
%22 = mul nsw i32 %19, %21
%23 = add nsw i32 %22, %16
%24 = tail call double @asin(i32 %23)
%25 = fptrunc double %24 to float
%26 = fpext float %4 to double
%27 = tail call i32 @cos(float %9)
%28 = tail call i32 @sin(float %20)
%29 = mul nsw i32 %28, %27
%30 = tail call i32 @sin(float %2)
%31 = tail call i32 @cos(float %9)
%32 = mul nsw i32 %31, %30
%33 = tail call i32 @cos(float %20)
%34 = mul nsw i32 %32, %33
%35 = tail call i32 @cos(float %2)
%36 = tail call i32 @sin(float %9)
%37 = mul nsw i32 %36, %35
%38 = sub nsw i32 %34, %37
%39 = tail call double @atan2(i32 %29, i32 %38)
%40 = fadd double %39, %26
%41 = fptrunc double %40 to float
%42 = tail call i32 @cos(float %25)
%43 = tail call i32 @cos(float %41)
%44 = mul i32 %42, %43
%45 = sub i32 0, %44
%46 = tail call double @asin(i32 %45)
%47 = fmul double %46, 0x404CA5DC1AF05A77
%48 = fptrunc double %47 to float
store float %48, float* %0
%49 = tail call i32 @cos(float %25)
%50 = tail call i32 @sin(float %41)
%51 = mul nsw i32 %50, %49
%52 = tail call i32 @sin(float %25)
%53 = tail call double @atan2(i32 %51, i32 %52)
%54 = fmul double %53, 0xC04CA5DC1AF05A77
%55 = fptrunc double %54 to float
store float %55, float* %1
ret void
}