void datum2earth_radius(int datum, double *re_major, double *re_minor) {
  static double major[20] = {6378206.4, 6378249.145, 6377397.155,  6378157.5,
                             6378388.0, 6378135.0,   6377276.3452, 6378145.0,
                             6378137.0, 6377563.396, 6377304.063,  6377340.189,
                             6378137.0, 6378155.0,   6378160.0,    6378245.0,
                             6378270.0, 6378166.0,   6378150.0,    6370997.0};
  static double minor[20] = {
      6356583.8,      6356514.86955,  6356078.96284,  6356772.2,
      6356911.94613,  6356750.519915, 6356075.4133,   6356759.769356,
      6356752.31414,  6356256.91,     6356103.039,    6356034.448,
      6356752.314245, 6356773.3205,   6356774.719,    6356863.0188,
      6356794.343479, 6356784.283666, 6356768.337303, 6370997.0};
  *re_major = major[datum];
  *re_minor = minor[datum];
}


x86 assembly (clang, -O0):
<datum2earth_radius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f16(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movslq -0x4(%rbp),%rcx
lea    0x2f9e(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<datum2earth_radius>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsi)
lea    0xf86(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
@datum2earth_radius.major = internal global [20 x double] [double 0x415854B79999999A, double 0x415854C24947AE14, double 0x415853ED49EB851F, double 0x415854AB60000000, double 0x415854E500000000, double 0x415854A5C0000000, double 0x415853CF1617C1BE, double 0x415854A840000000, double 0x415854A640000000, double 0x41585416D9581062, double 0x415853D604083127, double 0x415853DF0C189375, double 0x415854A640000000, double 0x415854AAC0000000, double 6.378160e+06, double 0x415854C140000000, double 6.378270e+06, double 0x415854AD80000000, double 6.378150e+06, double 0x41584DAD40000000]
@datum2earth_radius.minor = internal global [20 x double] [double 0x41583F99F3333333, double 0x41583F88B7A6B50B, double 0x41583F1BBD9F2BAA, double 0x41583FC90CCCCCCD, double 0x41583FEBFC8D64D8, double 0x41583FC3A1464990, double 0x41583F1ADA7381D8, double 0x41583FC5F13D20F3, double 0x41583FC4141ADEA9, double 0x41583F483A3D70A4, double 0x41583F21C27EF9DB, double 0x41583F109CAC0831, double 0x41583FC4141C970F, double 0x41583FC95483126F, double 0x41583FC9AE041893, double 0x41583FDFC13404EA, double 0x41583FCE95FB8F58, double 0x41583FCC12279570, double 0x41583FC815965F52, double 0x41584DAD40000000]
define void @datum2earth_radius(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [20 x double], [20 x double]* @datum2earth_radius.major, i64 0, i64 %8
%10 = load double, double* %9
%11 = load double*, double** %5
store double %10, double* %11
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [20 x double], [20 x double]* @datum2earth_radius.minor, i64 0, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %6
store double %15, double* %16
ret void
}

LLVM IR (-O2):
@datum2earth_radius.major = internal unnamed_addr constant [20 x double] [double 0x415854B79999999A, double 0x415854C24947AE14, double 0x415853ED49EB851F, double 0x415854AB60000000, double 0x415854E500000000, double 0x415854A5C0000000, double 0x415853CF1617C1BE, double 0x415854A840000000, double 0x415854A640000000, double 0x41585416D9581062, double 0x415853D604083127, double 0x415853DF0C189375, double 0x415854A640000000, double 0x415854AAC0000000, double 6.378160e+06, double 0x415854C140000000, double 6.378270e+06, double 0x415854AD80000000, double 6.378150e+06, double 0x41584DAD40000000]
@datum2earth_radius.minor = internal unnamed_addr constant [20 x double] [double 0x41583F99F3333333, double 0x41583F88B7A6B50B, double 0x41583F1BBD9F2BAA, double 0x41583FC90CCCCCCD, double 0x41583FEBFC8D64D8, double 0x41583FC3A1464990, double 0x41583F1ADA7381D8, double 0x41583FC5F13D20F3, double 0x41583FC4141ADEA9, double 0x41583F483A3D70A4, double 0x41583F21C27EF9DB, double 0x41583F109CAC0831, double 0x41583FC4141C970F, double 0x41583FC95483126F, double 0x41583FC9AE041893, double 0x41583FDFC13404EA, double 0x41583FCE95FB8F58, double 0x41583FCC12279570, double 0x41583FC815965F52, double 0x41584DAD40000000]
define void @datum2earth_radius(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [20 x double], [20 x double]* @datum2earth_radius.major, i64 0, i64 %4
%6 = load double, double* %5
store double %6, double* %1
%7 = getelementptr inbounds [20 x double], [20 x double]* @datum2earth_radius.minor, i64 0, i64 %4
%8 = load double, double* %7
store double %8, double* %2
ret void
}