#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*/ sla_mapqkz_(double *, double *, double *, double *,
                               double *);
void slaMapqkz(double rm, double dm, double amprms[21], double *ra,
               double *da) {
  double RM;
  double DM;
  double AMPRMS[21];
  double RA;
  double DA;
  int i;
  RM = rm;
  DM = dm;
  for (i = 0; i < 21; i++)
    AMPRMS[i] = amprms[i];
  sla_mapqkz_(&RM, &DM, (double *)AMPRMS, &RA, &DA);
  *ra = RA;
  *da = DA;
}


x86 assembly (clang, -O0):
<slaMapqkz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0xf4(%rbp)
cmpl   $0x15,-0xf4(%rbp)
jge    1190 <slaMapqkz+0x80>
mov    -0x18(%rbp),%rax
movslq -0xf4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xf4(%rbp),%rax
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    114f <slaMapqkz+0x3f>
lea    -0xe0(%rbp),%rdx
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0xe8(%rbp),%rcx
lea    -0xf0(%rbp),%r8
call   1030 <sla_mapqkz_@plt>
movsd  -0xe8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xf0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaMapqkz>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
movsd  %xmm0,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
lea    0x20(%rsp),%r15
mov    $0xa8,%edx
mov    %r15,%rdi
call   1040 <memcpy@plt>
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    %r15,%rdx
call   1030 <sla_mapqkz_@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @slaMapqkz(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca [21 x double]
%14 = alloca double
%15 = alloca double
%16 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%17 = load double, double* %6
store double %17, double* %11
%18 = load double, double* %7
store double %18, double* %12
store i32 0, i32* %16
br label %19
19: ; preds = %31, %5
%20 = load i32, i32* %16
%21 = icmp slt i32 %20, 21
br i1 %21, label %22, label %34
22: ; preds = %19
%23 = load double*, double** %8
%24 = load i32, i32* %16
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = load i32, i32* %16
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [21 x double], [21 x double]* %13, i64 0, i64 %29
store double %27, double* %30
br label %31
31: ; preds = %22
%32 = load i32, i32* %16
%33 = add nsw i32 %32, 1
store i32 %33, i32* %16
br label %19
34: ; preds = %19
%35 = getelementptr inbounds [21 x double], [21 x double]* %13, i64 0, i64 0
%36 = call i32 @sla_mapqkz_(double* %11, double* %12, double* %35, double* %14, double* %15)
%37 = load double, double* %14
%38 = load double*, double** %9
store double %37, double* %38
%39 = load double, double* %15
%40 = load double*, double** %10
store double %39, double* %40
ret void
}

LLVM IR (-O2):
define void @slaMapqkz(double %0, double %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = bitcast double* %2 to i8*
%7 = alloca double
%8 = alloca double
%9 = alloca [21 x double]
%10 = bitcast [21 x double]* %9 to i8*
%11 = alloca double
%12 = alloca double
%13 = bitcast double* %7 to i8*
%14 = bitcast double* %8 to i8*
%15 = bitcast double* %11 to i8*
%16 = bitcast double* %12 to i8*
store double %0, double* %7
store double %1, double* %8
%17 = getelementptr inbounds [21 x double], [21 x double]* %9, i64 0, i64 0
%18 = call i32 @sla_mapqkz_(double* %7, double* %8, double* %17, double* %11, double* %12)
%19 = load double, double* %11
store double %19, double* %3
%20 = load double, double* %12
store double %20, double* %4
ret void
}