#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 */
unsigned char *code_table_3_2_location(unsigned char **);
int /*<<< orphan*/ fatal_error(char *, char *);
int /*<<< orphan*/ fatal_error_i(char *, int);
int int4(unsigned char *);
double scaled2dbl(int, int);
double radius_earth(unsigned char **sec) {
  int table_3_2;
  double radius;
  unsigned char *p;
  int factor, value;
  p = code_table_3_2_location(sec);
  if (p == NULL)
    fatal_error("radius_earth: code_table 3.2 is unknown", "");
  table_3_2 = (int)*p;
  radius = 6367.47 * 1000.0;
  if (table_3_2 == 0)
    radius = 6367.47 * 1000.0;
  else if (table_3_2 == 1) {
    factor = ((p[1] & 0x80) ? -(int)(p[1] & 127) : (int)(p[1] & 127));
    value = int4(p + 2);
    radius = scaled2dbl(factor, value);
    if (radius < 6300000.0 || radius > 6400000.0)
      fatal_error_i("radius of earth is %d m", (int)radius);
  } else if (table_3_2 == 2)
    radius = (6378.160 + 6356.775) * 0.5 * 1000.0;
  else if (table_3_2 == 3 || table_3_2 == 7) {
    if (((int)(sec[3][5])) == 101)
      fatal_error(
          "Grid defintion 101 does not support user-defined major/minor axes",
          "");
    factor = ((p[6] & 0x80) ? -(int)(p[6] & 127) : (int)(p[6] & 127));
    value = int4(p + 7);
    radius = scaled2dbl(factor, value);
    factor = ((p[11] & 0x80) ? -(int)(p[11] & 127) : (int)(p[11] & 127));
    value = int4(p + 12);
    radius = (radius + scaled2dbl(factor, value)) * 0.5;
    if (table_3_2 == 3)
      radius *= 1000.0;
    if (radius < 6300000.0 || radius > 6400000.0)
      fatal_error_i("radius of earth is %d m", (int)radius);
  } else if (table_3_2 == 4)
    radius = (6378.137 + 6356.752314) * 0.5 * 1000.0;
  else if (table_3_2 == 5)
    radius = (6378.137 + 6356.752245) * 0.5 * 1000.0;
  else if (table_3_2 == 6)
    radius = 6371.2290 * 1000.0;
  else if (table_3_2 == 8)
    radius = 6371.200 * 1000.0;
  else if (table_3_2 == 9)
    radius = (6377563.396 + 6356256.909) * 0.5;
  return radius;
}


x86 assembly (clang, -O0):
<radius_earth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <code_table_3_2_location@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1187 <radius_earth+0x37>
lea    0xedd(%rip),%rdi
lea    0xf15(%rip),%rsi
call   1060 <fatal_error@plt>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
movsd  0xe67(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11ba <radius_earth+0x6a>
movsd  0xe50(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    14ac <radius_earth+0x35c>
cmpl   $0x1,-0xc(%rbp)
jne    1265 <radius_earth+0x115>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11f1 <radius_earth+0xa1>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ff <radius_earth+0xaf>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x2,%rdi
call   1040 <int4@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1070 <scaled2dbl@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe13(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     124f <radius_earth+0xff>
movsd  -0x18(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1260 <radius_earth+0x110>
cvttsd2si -0x18(%rbp),%esi
lea    0xe25(%rip),%rdi
call   1030 <fatal_error_i@plt>
jmp    14a7 <radius_earth+0x357>
cmpl   $0x2,-0xc(%rbp)
jne    1281 <radius_earth+0x131>
movsd  0xdd9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    14a2 <radius_earth+0x352>
cmpl   $0x3,-0xc(%rbp)
je     1295 <radius_earth+0x145>
cmpl   $0x7,-0xc(%rbp)
jne    13fd <radius_earth+0x2ad>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movzbl 0x5(%rax),%eax
cmp    $0x65,%eax
jne    12bd <radius_earth+0x16d>
lea    0xde7(%rip),%rdi
lea    0xddf(%rip),%rsi
call   1060 <fatal_error@plt>
mov    -0x20(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     12ea <radius_earth+0x19a>
mov    -0x20(%rbp),%rax
movzbl 0x6(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x30(%rbp)
jmp    12f8 <radius_earth+0x1a8>
mov    -0x20(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x7,%rdi
call   1040 <int4@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1070 <scaled2dbl@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movzbl 0xb(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     134b <radius_earth+0x1fb>
mov    -0x20(%rbp),%rax
movzbl 0xb(%rax),%ecx
and    $0x7f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
jmp    1359 <radius_earth+0x209>
mov    -0x20(%rbp),%rax
movzbl 0xb(%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
add    $0xc,%rdi
call   1040 <int4@plt>
mov    %eax,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1070 <scaled2dbl@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xc98(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    13bd <radius_earth+0x26d>
movsd  0xc85(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xc7b(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     13e7 <radius_earth+0x297>
movsd  -0x18(%rbp),%xmm0
movsd  0xc6b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13f8 <radius_earth+0x2a8>
cvttsd2si -0x18(%rbp),%esi
lea    0xc8d(%rip),%rdi
call   1030 <fatal_error_i@plt>
jmp    149d <radius_earth+0x34d>
cmpl   $0x4,-0xc(%rbp)
jne    1419 <radius_earth+0x2c9>
movsd  0xc19(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1498 <radius_earth+0x348>
cmpl   $0x5,-0xc(%rbp)
jne    1435 <radius_earth+0x2e5>
movsd  0xbf5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1493 <radius_earth+0x343>
cmpl   $0x6,-0xc(%rbp)
jne    1451 <radius_earth+0x301>
movsd  0xbd1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    148e <radius_earth+0x33e>
cmpl   $0x8,-0xc(%rbp)
jne    146d <radius_earth+0x31d>
movsd  0xbad(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1489 <radius_earth+0x339>
cmpl   $0x9,-0xc(%rbp)
jne    1484 <radius_earth+0x334>
movsd  0xb89(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1489 <radius_earth+0x339>
jmp    148e <radius_earth+0x33e>
jmp    1493 <radius_earth+0x343>
jmp    1498 <radius_earth+0x348>
jmp    149d <radius_earth+0x34d>
jmp    14a2 <radius_earth+0x352>
jmp    14a7 <radius_earth+0x357>
jmp    14ac <radius_earth+0x35c>
movsd  -0x18(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_earth>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <code_table_3_2_location@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    117a <radius_earth+0x2a>
lea    0xec2(%rip),%rdi
lea    0xefa(%rip),%rsi
call   1060 <fatal_error@plt>
mov    (%rbx),%r15b
movsd  0xe7b(%rip),%xmm0
test   %r15b,%r15b
je     12b6 <radius_earth+0x166>
cmp    $0x2,%r15b
je     11c6 <radius_earth+0x76>
cmp    $0x1,%r15b
jne    11d3 <radius_earth+0x83>
movzbl 0x1(%rbx),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebp
neg    %ebp
test   $0x80,%al
cmove  %ecx,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1040 <int4@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <scaled2dbl@plt>
jmp    1268 <radius_earth+0x118>
movsd  0xe3a(%rip),%xmm0
jmp    12b6 <radius_earth+0x166>
mov    %r15d,%eax
and    $0xfb,%al
cmp    $0x3,%al
jne    129c <radius_earth+0x14c>
mov    0x18(%r14),%rax
cmpb   $0x65,0x5(%rax)
jne    11fd <radius_earth+0xad>
lea    0xe7f(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1060 <fatal_error@plt>
movzbl 0x6(%rbx),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebp
neg    %ebp
test   $0x80,%al
cmove  %ecx,%ebp
lea    0x7(%rbx),%rdi
call   1040 <int4@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <scaled2dbl@plt>
movsd  %xmm0,(%rsp)
movzbl 0xb(%rbx),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,%ebp
neg    %ebp
test   $0x80,%al
cmove  %ecx,%ebp
add    $0xc,%rbx
mov    %rbx,%rdi
call   1040 <int4@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <scaled2dbl@plt>
addsd  (%rsp),%xmm0
mulsd  0xdc6(%rip),%xmm0
cmp    $0x3,%r15b
jne    1268 <radius_earth+0x118>
mulsd  0xdc0(%rip),%xmm0
movsd  0xda0(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1280 <radius_earth+0x130>
ucomisd 0xd9a(%rip),%xmm0
jbe    12b6 <radius_earth+0x166>
cvttsd2si %xmm0,%esi
lea    0xdcd(%rip),%rdi
movsd  %xmm0,(%rsp)
call   1030 <fatal_error_i@plt>
movsd  (%rsp),%xmm0
jmp    12b6 <radius_earth+0x166>
add    $0xfc,%r15b
cmp    $0x5,%r15b
ja     12b6 <radius_earth+0x166>
movsbq %r15b,%rax
lea    0xe07(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"radius_earth: code_table 3.2 is unknown\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [24 x i8] c"radius of earth is %d m\00"
@.str.3 = [66 x i8] c"Grid defintion 101 does not support user-defined major/minor axes\00"
define double @radius_earth(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca double
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %2
%8 = load i8**, i8*** %2
%9 = call i8* @code_table_3_2_location(i8** %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @fatal_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
store i32 %17, i32* %3
store double 6.367470e+06, double* %4
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store double 6.367470e+06, double* %4
br label %184
21: ; preds = %14
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %62
24: ; preds = %21
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %28, 128
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %24
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = and i32 %35, 127
%37 = sub nsw i32 0, %36
br label %44
38: ; preds = %24
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %42, 127
br label %44
44: ; preds = %38, %31
%45 = phi i32 [ %37, %31 ], [ %43, %38 ]
store i32 %45, i32* %6
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i64 2
%48 = call i32 @int4(i8* %47)
store i32 %48, i32* %7
%49 = load i32, i32* %6
%50 = load i32, i32* %7
%51 = call double @scaled2dbl(i32 %49, i32 %50)
store double %51, double* %4
%52 = load double, double* %4
%53 = fcmp olt double %52, 6.300000e+06
br i1 %53, label %57, label %54
54: ; preds = %44
%55 = load double, double* %4
%56 = fcmp ogt double %55, 6.400000e+06
br i1 %56, label %57, label %61
57: ; preds = %54, %44
%58 = load double, double* %4
%59 = fptosi double %58 to i32
%60 = call i32 @fatal_error_i(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %57, %54
br label %183
62: ; preds = %21
%63 = load i32, i32* %3
%64 = icmp eq i32 %63, 2
br i1 %64, label %65, label %66
65: ; preds = %62
store double 0x41584A3AE0000000, double* %4
br label %182
66: ; preds = %62
%67 = load i32, i32* %3
%68 = icmp eq i32 %67, 3
br i1 %68, label %72, label %69
69: ; preds = %66
%70 = load i32, i32* %3
%71 = icmp eq i32 %70, 7
br i1 %71, label %72, label %156
72: ; preds = %69, %66
%73 = load i8**, i8*** %2
%74 = getelementptr inbounds i8*, i8** %73, i64 3
%75 = load i8*, i8** %74
%76 = getelementptr inbounds i8, i8* %75, i64 5
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = icmp eq i32 %78, 101
br i1 %79, label %80, label %82
80: ; preds = %72
%81 = call i32 @fatal_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %82
82: ; preds = %80, %72
%83 = load i8*, i8** %5
%84 = getelementptr inbounds i8, i8* %83, i64 6
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = and i32 %86, 128
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %96
89: ; preds = %82
%90 = load i8*, i8** %5
%91 = getelementptr inbounds i8, i8* %90, i64 6
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = and i32 %93, 127
%95 = sub nsw i32 0, %94
br label %102
96: ; preds = %82
%97 = load i8*, i8** %5
%98 = getelementptr inbounds i8, i8* %97, i64 6
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = and i32 %100, 127
br label %102
102: ; preds = %96, %89
%103 = phi i32 [ %95, %89 ], [ %101, %96 ]
store i32 %103, i32* %6
%104 = load i8*, i8** %5
%105 = getelementptr inbounds i8, i8* %104, i64 7
%106 = call i32 @int4(i8* %105)
store i32 %106, i32* %7
%107 = load i32, i32* %6
%108 = load i32, i32* %7
%109 = call double @scaled2dbl(i32 %107, i32 %108)
store double %109, double* %4
%110 = load i8*, i8** %5
%111 = getelementptr inbounds i8, i8* %110, i64 11
%112 = load i8, i8* %111
%113 = zext i8 %112 to i32
%114 = and i32 %113, 128
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %123
116: ; preds = %102
%117 = load i8*, i8** %5
%118 = getelementptr inbounds i8, i8* %117, i64 11
%119 = load i8, i8* %118
%120 = zext i8 %119 to i32
%121 = and i32 %120, 127
%122 = sub nsw i32 0, %121
br label %129
123: ; preds = %102
%124 = load i8*, i8** %5
%125 = getelementptr inbounds i8, i8* %124, i64 11
%126 = load i8, i8* %125
%127 = zext i8 %126 to i32
%128 = and i32 %127, 127
br label %129
129: ; preds = %123, %116
%130 = phi i32 [ %122, %116 ], [ %128, %123 ]
store i32 %130, i32* %6
%131 = load i8*, i8** %5
%132 = getelementptr inbounds i8, i8* %131, i64 12
%133 = call i32 @int4(i8* %132)
store i32 %133, i32* %7
%134 = load double, double* %4
%135 = load i32, i32* %6
%136 = load i32, i32* %7
%137 = call double @scaled2dbl(i32 %135, i32 %136)
%138 = fadd double %134, %137
%139 = fmul double %138, 5.000000e-01
store double %139, double* %4
%140 = load i32, i32* %3
%141 = icmp eq i32 %140, 3
br i1 %141, label %142, label %145
142: ; preds = %129
%143 = load double, double* %4
%144 = fmul double %143, 1.000000e+03
store double %144, double* %4
br label %145
145: ; preds = %142, %129
%146 = load double, double* %4
%147 = fcmp olt double %146, 6.300000e+06
br i1 %147, label %151, label %148
148: ; preds = %145
%149 = load double, double* %4
%150 = fcmp ogt double %149, 6.400000e+06
br i1 %150, label %151, label %155
151: ; preds = %148, %145
%152 = load double, double* %4
%153 = fptosi double %152 to i32
%154 = call i32 @fatal_error_i(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %153)
br label %155
155: ; preds = %151, %148
br label %181
156: ; preds = %69
%157 = load i32, i32* %3
%158 = icmp eq i32 %157, 4
br i1 %158, label %159, label %160
159: ; preds = %156
store double 0x41584A352A0C49BA, double* %4
br label %180
160: ; preds = %156
%161 = load i32, i32* %3
%162 = icmp eq i32 %161, 5
br i1 %162, label %163, label %164
163: ; preds = %160
store double 0x41584A3527D70A3D, double* %4
br label %179
164: ; preds = %160
%165 = load i32, i32* %3
%166 = icmp eq i32 %165, 6
br i1 %166, label %167, label %168
167: ; preds = %164
store double 0x41584DE740000000, double* %4
br label %178
168: ; preds = %164
%169 = load i32, i32* %3
%170 = icmp eq i32 %169, 8
br i1 %170, label %171, label %172
171: ; preds = %168
store double 6.371200e+06, double* %4
br label %177
172: ; preds = %168
%173 = load i32, i32* %3
%174 = icmp eq i32 %173, 9
br i1 %174, label %175, label %176
175: ; preds = %172
store double 0x415849AF89C28F5C, double* %4
br label %176
176: ; preds = %175, %172
br label %177
177: ; preds = %176, %171
br label %178
178: ; preds = %177, %167
br label %179
179: ; preds = %178, %163
br label %180
180: ; preds = %179, %159
br label %181
181: ; preds = %180, %155
br label %182
182: ; preds = %181, %65
br label %183
183: ; preds = %182, %61
br label %184
184: ; preds = %183, %20
%185 = load double, double* %4
ret double %185
}

LLVM IR (-O2):
@.str = [40 x i8] c"radius_earth: code_table 3.2 is unknown\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [24 x i8] c"radius of earth is %d m\00"
@.str.3 = [66 x i8] c"Grid defintion 101 does not support user-defined major/minor axes\00"
@switch.table.radius_earth = [6 x double] [double 0x41584A352A0C49BA, double 0x41584A3527D70A3D, double 0x41584DE740000000, double 6.367470e+06, double 6.371200e+06, double 0x415849AF89C28F5C]
define double @radius_earth(i8** %0) {
%2 = tail call i8* @code_table_3_2_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i8, i8* %2
switch i8 %7, label %27 [
i8 0, label %79
i8 1, label %8
i8 2, label %26
]
8: ; preds = %6
%9 = getelementptr inbounds i8, i8* %2, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 128
%13 = icmp eq i32 %12, 0
%14 = and i32 %11, 127
%15 = sub nsw i32 0, %14
%16 = select i1 %13, i32 %14, i32 %15
%17 = getelementptr inbounds i8, i8* %2, i64 2
%18 = tail call i32 @int4(i8* %17)
%19 = tail call double @scaled2dbl(i32 %16, i32 %18)
%20 = fcmp olt double %19, 6.300000e+06
%21 = fcmp ogt double %19, 6.400000e+06
%22 = or i1 %20, %21
br i1 %22, label %23, label %79
23: ; preds = %8
%24 = fptosi double %19 to i32
%25 = tail call i32 @fatal_error_i(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %79
26: ; preds = %6
br label %79
27: ; preds = %6
%28 = icmp eq i8 %7, 3
%29 = and i8 %7, -5
%30 = icmp eq i8 %29, 3
br i1 %30, label %31, label %72
31: ; preds = %27
%32 = getelementptr inbounds i8*, i8** %0, i64 3
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8, i8* %33, i64 5
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 101
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = tail call i32 @fatal_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %31
%40 = getelementptr inbounds i8, i8* %2, i64 6
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %42, 128
%44 = icmp eq i32 %43, 0
%45 = and i32 %42, 127
%46 = sub nsw i32 0, %45
%47 = select i1 %44, i32 %45, i32 %46
%48 = getelementptr inbounds i8, i8* %2, i64 7
%49 = tail call i32 @int4(i8* %48)
%50 = tail call double @scaled2dbl(i32 %47, i32 %49)
%51 = getelementptr inbounds i8, i8* %2, i64 11
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = and i32 %53, 128
%55 = icmp eq i32 %54, 0
%56 = and i32 %53, 127
%57 = sub nsw i32 0, %56
%58 = select i1 %55, i32 %56, i32 %57
%59 = getelementptr inbounds i8, i8* %2, i64 12
%60 = tail call i32 @int4(i8* %59)
%61 = tail call double @scaled2dbl(i32 %58, i32 %60)
%62 = fadd double %50, %61
%63 = fmul double %62, 5.000000e-01
%64 = fmul double %63, 1.000000e+03
%65 = select i1 %28, double %64, double %63
%66 = fcmp olt double %65, 6.300000e+06
%67 = fcmp ogt double %65, 6.400000e+06
%68 = or i1 %66, %67
br i1 %68, label %69, label %79
69: ; preds = %39
%70 = fptosi double %65 to i32
%71 = tail call i32 @fatal_error_i(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %70)
br label %79
72: ; preds = %27
%73 = add i8 %7, -4
%74 = icmp ult i8 %73, 6
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = sext i8 %73 to i64
%77 = getelementptr inbounds [6 x double], [6 x double]* @switch.table.radius_earth, i64 0, i64 %76
%78 = load double, double* %77
br label %79
79: ; preds = %72, %75, %6, %8, %23, %39, %69, %26
%80 = phi double [ %19, %23 ], [ %19, %8 ], [ 0x41584A3AE0000000, %26 ], [ %65, %69 ], [ %65, %39 ], [ 6.367470e+06, %6 ], [ %78, %75 ], [ 6.367470e+06, %72 ]
ret double %80
}