#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 a0(int);
double atan(double);
double b0(int);
double cos(double);
int /*<<< orphan*/ fabs(double);
double pow(int /*<<< orphan*/, double);
double tan(double);
void metric(double phi, int k, double *gx, double *gy) {
  double beta;
  beta = atan(b0(k) * tan(phi) / a0(k));
  *gx = a0(k) * cos(beta);
  *gy = a0(k) * ((b0(k) / a0(k)) * (b0(k) / a0(k))) *
        pow(fabs(cos(beta) / cos(phi)), 3.0);
}


x86 assembly (clang, -O0):
<metric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <b0@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <a0@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <atan@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <a0@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc(%rbp),%edi
call   1090 <a0@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <b0@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <a0@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <b0@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <a0@plt>
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
movsd  0xd68(%rip),%xmm0
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  %xmm0,0x20(%rsp)
call   1040 <b0@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <tan@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1090 <a0@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <atan@plt>
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
call   1090 <a0@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
mov    %ebp,%edi
call   1090 <a0@plt>
movsd  %xmm0,0x28(%rsp)
mov    %ebp,%edi
call   1040 <b0@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%edi
call   1090 <a0@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %ebp,%edi
call   1040 <b0@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1090 <a0@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  0xd7e(%rip),%xmm0
mov    %eax,%edi
call   1080 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @metric(double %0, i32 %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load i32, i32* %6
%11 = call double @b0(i32 %10)
%12 = load double, double* %5
%13 = call double @tan(double %12)
%14 = fmul double %11, %13
%15 = load i32, i32* %6
%16 = call double @a0(i32 %15)
%17 = fdiv double %14, %16
%18 = call double @atan(double %17)
store double %18, double* %9
%19 = load i32, i32* %6
%20 = call double @a0(i32 %19)
%21 = load double, double* %9
%22 = call double @cos(double %21)
%23 = fmul double %20, %22
%24 = load double*, double** %7
store double %23, double* %24
%25 = load i32, i32* %6
%26 = call double @a0(i32 %25)
%27 = load i32, i32* %6
%28 = call double @b0(i32 %27)
%29 = load i32, i32* %6
%30 = call double @a0(i32 %29)
%31 = fdiv double %28, %30
%32 = load i32, i32* %6
%33 = call double @b0(i32 %32)
%34 = load i32, i32* %6
%35 = call double @a0(i32 %34)
%36 = fdiv double %33, %35
%37 = fmul double %31, %36
%38 = fmul double %26, %37
%39 = load double, double* %9
%40 = call double @cos(double %39)
%41 = load double, double* %5
%42 = call double @cos(double %41)
%43 = fdiv double %40, %42
%44 = call i32 @fabs(double %43)
%45 = call double @pow(i32 %44, double 3.000000e+00)
%46 = fmul double %38, %45
%47 = load double*, double** %8
store double %46, double* %47
ret void
}

LLVM IR (-O2):
define void @metric(double %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = tail call double @b0(i32 %1)
%6 = tail call double @tan(double %0)
%7 = fmul double %5, %6
%8 = tail call double @a0(i32 %1)
%9 = fdiv double %7, %8
%10 = tail call double @atan(double %9)
%11 = tail call double @a0(i32 %1)
%12 = tail call double @cos(double %10)
%13 = fmul double %11, %12
store double %13, double* %2
%14 = tail call double @a0(i32 %1)
%15 = tail call double @b0(i32 %1)
%16 = tail call double @a0(i32 %1)
%17 = fdiv double %15, %16
%18 = tail call double @b0(i32 %1)
%19 = tail call double @a0(i32 %1)
%20 = fdiv double %18, %19
%21 = fmul double %17, %20
%22 = fmul double %14, %21
%23 = tail call double @cos(double %10)
%24 = tail call double @cos(double %0)
%25 = fdiv double %23, %24
%26 = tail call i32 @fabs(double %25)
%27 = tail call double @pow(i32 %26, double 3.000000e+00)
%28 = fmul double %22, %27
store double %28, double* %3
ret void
}