#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*/ RPosCalcVector(double, double, double, double, double *,
                                  double *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  double alat = 58.0;
  double alon = 140.0;
  double mag = 1500.0;
  double azm = 18.0;
  double blat, blon;
  RPosCalcVector(alat, alon, mag, azm, &blat, &blon);
  fprintf(stdout, "RPosCalcVector\n");
  fprintf(stdout, "alat=%g, alon=%g, mag=%g, azm=%g\n", alat, alon, mag, azm);
  fprintf(stdout, "blat=%g blon=%g\n", blat, blon);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <RPosCalcVector@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xe6a(%rip),%rsi
mov    $0x4,%al
call   1040 <fprintf@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xe6b(%rip),%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
movsd  0xed3(%rip),%xmm2
movsd  0xed3(%rip),%xmm3
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <RPosCalcVector@plt>
mov    0x2e87(%rip),%rbx
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
movsd  0xe86(%rip),%xmm0
movsd  0xe86(%rip),%xmm1
movsd  0xe86(%rip),%xmm2
movsd  0xe86(%rip),%xmm3
mov    $0x4,%al
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
lea    0xea5(%rip),%rsi
mov    $0x2,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"RPosCalcVector\0A\00"
@.str.1 = [34 x i8] c"alat=%g, alon=%g, mag=%g, azm=%g\0A\00"
@.str.2 = [17 x i8] c"blat=%g blon=%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.800000e+01, double* %6
store double 1.400000e+02, double* %7
store double 1.500000e+03, double* %8
store double 1.800000e+01, double* %9
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = call i32 @RPosCalcVector(double %12, double %13, double %14, double %15, double* %10, double* %11)
%17 = load i32, i32* @stdout
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = load double, double* %6
%21 = load double, double* %7
%22 = load double, double* %8
%23 = load double, double* %9
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %20, double %21, double %22, double %23)
%25 = load i32, i32* @stdout
%26 = load double, double* %10
%27 = load double, double* %11
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %26, double %27)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"RPosCalcVector\0A\00"
@.str.1 = [34 x i8] c"alat=%g, alon=%g, mag=%g, azm=%g\0A\00"
@.str.2 = [17 x i8] c"blat=%g blon=%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @RPosCalcVector(double 5.800000e+01, double 1.400000e+02, double 1.500000e+03, double 1.800000e+01, double* %3, double* %4)
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double 5.800000e+01, double 1.400000e+02, double 1.500000e+03, double 1.800000e+01)
%12 = load i32, i32* @stdout
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %13, double %14)
ret i32 0
}