#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*/ best_scaled_value(double, int *, int *);
unsigned char *code_table_3_2_location(unsigned char **);
int /*<<< orphan*/ fatal_error(char *, char const *);
int /*<<< orphan*/ sprintf(char *, char *);
int sscanf(char const *, char *, int *, double *, double *);
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ uint_char(int, unsigned char *);
int f_set_radius(int mode, unsigned char **sec, float *data, unsigned int ndata,
                 char *inv_out, void **local, const char *arg1) {
  unsigned char *p;
  int i, v3_2, scale, val;
  double major, minor;
  if (mode >= 0) {
    p = code_table_3_2_location(sec);
    if (p == NULL) {
      sprintf(inv_out, "earth radius can not be set");
      return 0;
    }
    if (strcmp(arg1, "0") == 0) {
      *p = 0;
      return 0;
    }
    if (strcmp(arg1, "2") == 0) {
      *p = 2;
      return 0;
    }
    if (strcmp(arg1, "4") == 0) {
      *p = 4;
      return 0;
    }
    if (strcmp(arg1, "5") == 0) {
      *p = 5;
      return 0;
    }
    if (strcmp(arg1, "6") == 0) {
      *p = 6;
      return 0;
    }
    if (strcmp(arg1, "8") == 0) {
      *p = 8;
      return 0;
    }
    if (strcmp(arg1, "9") == 0) {
      *p = 9;
      return 0;
    }
    i = sscanf(arg1, "%d:%lf:%lf", &v3_2, &major, &minor);
    if (i == 2 && v3_2 == 1) {
      if (((int)(sec[3][5])) == 101)
        fatal_error("Grid defintion 101 does not support user-defined radius",
                    "");
      *p = 1;
      if (major > 6400000.0 || major < 6300000.0)
        fatal_error("set_radius: radius must be in meters", "");
      best_scaled_value(major, &scale, &val);
      p[1] = scale & 255;
      uint_char(val, p + 2);
      return 0;
    }
    if (i == 3 && (v3_2 == 3 || v3_2 == 7)) {
      if (((int)(sec[3][5])) == 101)
        fatal_error(
            "Grid defintion 101 does not support user-defined major/minor axes",
            "");
      if (v3_2 == 7) {
        if (major > 6400000.0 || major < 6300000.0)
          fatal_error("set_radius: major must be in meters", "");
        if (minor > 6400000.0 || minor < 6300000.0)
          fatal_error("set_radius: minor must be in meters", "");
        if (major < minor)
          fatal_error("set_radius: minor must be less than major", "");
        *p = 7;
      } else {
        if (major > 6400.0 || major < 6300.0)
          fatal_error("set_radius: major must be in km", "");
        if (minor > 6400.0 || minor < 6300.0)
          fatal_error("set_radius: minor must be in km", "");
        if (major < minor)
          fatal_error("set_radius: minor must be less than major", "");
        *p = 3;
      }
      best_scaled_value(major, &scale, &val);
      p[6] = scale & 255;
      uint_char(val, p + 7);
      best_scaled_value(minor, &scale, &val);
      p[11] = scale & 255;
      uint_char(val, p + 12);
      return 0;
    }
    fatal_error("set_radius: unknown argument %s", arg1);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_set_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     161c <f_set_radius+0x4ac>
mov    -0x10(%rbp),%rdi
call   1040 <code_table_3_2_location@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11d0 <f_set_radius+0x60>
mov    -0x28(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1080 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11fd <f_set_radius+0x8d>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xe36(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    122a <f_set_radius+0xba>
mov    -0x38(%rbp),%rax
movb   $0x2,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xe0b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1257 <f_set_radius+0xe7>
mov    -0x38(%rbp),%rax
movb   $0x4,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1284 <f_set_radius+0x114>
mov    -0x38(%rbp),%rax
movb   $0x5,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xdb5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12b1 <f_set_radius+0x141>
mov    -0x38(%rbp),%rax
movb   $0x6,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12de <f_set_radius+0x16e>
mov    -0x38(%rbp),%rax
movb   $0x8,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xd5f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    130b <f_set_radius+0x19b>
mov    -0x38(%rbp),%rax
movb   $0x9,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rdi
lea    0xd34(%rip),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x58(%rbp),%r8
call   1070 <sscanf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jne    13e9 <f_set_radius+0x279>
cmpl   $0x1,-0x40(%rbp)
jne    13e9 <f_set_radius+0x279>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movzbl 0x5(%rax),%eax
cmp    $0x65,%eax
jne    1366 <f_set_radius+0x1f6>
lea    0xcfb(%rip),%rdi
lea    0xcdc(%rip),%rsi
call   1060 <fatal_error@plt>
mov    -0x38(%rbp),%rax
movb   $0x1,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xc96(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1397 <f_set_radius+0x227>
movsd  0xc8c(%rip),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    13aa <f_set_radius+0x23a>
lea    0xcef(%rip),%rdi
lea    0xc98(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  -0x50(%rbp),%xmm0
lea    -0x44(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1090 <best_scaled_value@plt>
mov    -0x44(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x48(%rbp),%edi
mov    -0x38(%rbp),%rsi
add    $0x2,%rsi
call   1030 <uint_char@plt>
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
cmpl   $0x3,-0x3c(%rbp)
jne    1600 <f_set_radius+0x490>
cmpl   $0x3,-0x40(%rbp)
je     1407 <f_set_radius+0x297>
cmpl   $0x7,-0x40(%rbp)
jne    1600 <f_set_radius+0x490>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movzbl 0x5(%rax),%eax
cmp    $0x65,%eax
jne    142f <f_set_radius+0x2bf>
lea    0xc8f(%rip),%rdi
lea    0xc13(%rip),%rsi
call   1060 <fatal_error@plt>
cmpl   $0x7,-0x40(%rbp)
jne    14e6 <f_set_radius+0x376>
movsd  -0x50(%rbp),%xmm0
movsd  0xbca(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1463 <f_set_radius+0x2f3>
movsd  0xbc0(%rip),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1476 <f_set_radius+0x306>
lea    0xc8a(%rip),%rdi
lea    0xbcc(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  -0x58(%rbp),%xmm0
movsd  0xb8d(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     14a0 <f_set_radius+0x330>
movsd  0xb83(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    14b3 <f_set_radius+0x343>
lea    0xc71(%rip),%rdi
lea    0xb8f(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14da <f_set_radius+0x36a>
lea    0xc6e(%rip),%rdi
lea    0xb68(%rip),%rsi
call   1060 <fatal_error@plt>
mov    -0x38(%rbp),%rax
movb   $0x7,(%rax)
jmp    158e <f_set_radius+0x41e>
movsd  -0x50(%rbp),%xmm0
movsd  0xb0d(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1510 <f_set_radius+0x3a0>
movsd  0xb03(%rip),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1523 <f_set_radius+0x3b3>
lea    0xc4f(%rip),%rdi
lea    0xb1f(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  -0x58(%rbp),%xmm0
movsd  0xad0(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     154d <f_set_radius+0x3dd>
movsd  0xac6(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1560 <f_set_radius+0x3f0>
lea    0xc32(%rip),%rdi
lea    0xae2(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1587 <f_set_radius+0x417>
lea    0xbc1(%rip),%rdi
lea    0xabb(%rip),%rsi
call   1060 <fatal_error@plt>
mov    -0x38(%rbp),%rax
movb   $0x3,(%rax)
movsd  -0x50(%rbp),%xmm0
lea    -0x44(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1090 <best_scaled_value@plt>
mov    -0x44(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x48(%rbp),%edi
mov    -0x38(%rbp),%rsi
add    $0x7,%rsi
call   1030 <uint_char@plt>
movsd  -0x58(%rbp),%xmm0
lea    -0x44(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1090 <best_scaled_value@plt>
mov    -0x44(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %cl,0xb(%rax)
mov    -0x48(%rbp),%edi
mov    -0x38(%rbp),%rsi
add    $0xc,%rsi
call   1030 <uint_char@plt>
movl   $0x0,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
mov    0x10(%rbp),%rsi
lea    0xb9b(%rip),%rdi
call   1060 <fatal_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    1623 <f_set_radius+0x4b3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_set_radius>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
xor    %r15d,%r15d
test   %edi,%edi
js     14ea <f_set_radius+0x38a>
mov    %r8,%rbp
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <code_table_3_2_location@plt>
test   %rax,%rax
je     12ec <f_set_radius+0x18c>
mov    %rax,%r14
mov    0x50(%rsp),%rbp
lea    0xea1(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1309 <f_set_radius+0x1a9>
lea    0xe8b(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1312 <f_set_radius+0x1b2>
lea    0xe75(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     131b <f_set_radius+0x1bb>
lea    0xe5f(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1324 <f_set_radius+0x1c4>
lea    0xe49(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     132d <f_set_radius+0x1cd>
lea    0xe33(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1336 <f_set_radius+0x1d6>
lea    0xe1d(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     133f <f_set_radius+0x1df>
lea    0xe07(%rip),%rsi
lea    0x24(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x18(%rsp),%r8
mov    %rbp,%rdi
call   1070 <sscanf@plt>
mov    0x24(%rsp),%ecx
cmp    $0x2,%eax
jne    1348 <f_set_radius+0x1e8>
cmp    $0x1,%ecx
jne    1348 <f_set_radius+0x1e8>
mov    0x18(%rbx),%rax
cmpb   $0x65,0x5(%rax)
jne    128d <f_set_radius+0x12d>
lea    0xdd4(%rip),%rdi
lea    0xdb5(%rip),%rsi
call   1060 <fatal_error@plt>
movb   $0x1,(%r14)
movsd  0x10(%rsp),%xmm0
ucomisd 0xd71(%rip),%xmm0
ja     12af <f_set_radius+0x14f>
movsd  0xd6f(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    12c8 <f_set_radius+0x168>
lea    0xdd7(%rip),%rdi
lea    0xd80(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  0x10(%rsp),%xmm0
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1080 <best_scaled_value@plt>
mov    0xc(%rsp),%al
mov    %al,0x1(%r14)
mov    0x8(%rsp),%edi
add    $0x2,%r14
jmp    14e2 <f_set_radius+0x382>
movups 0xd39(%rip),%xmm0
movups %xmm0,0xc(%rbp)
movupd 0xd21(%rip),%xmm0
movupd %xmm0,0x0(%rbp)
jmp    14ea <f_set_radius+0x38a>
movb   $0x0,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x2,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x4,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x5,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x6,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x8,(%r14)
jmp    14ea <f_set_radius+0x38a>
movb   $0x9,(%r14)
jmp    14ea <f_set_radius+0x38a>
cmp    $0x3,%eax
jne    13f5 <f_set_radius+0x295>
mov    %ecx,%eax
and    $0xfffffffb,%eax
cmp    $0x3,%eax
jne    13f5 <f_set_radius+0x295>
mov    0x18(%rbx),%rax
cmpb   $0x65,0x5(%rax)
jne    1380 <f_set_radius+0x220>
lea    0xd42(%rip),%rdi
lea    0xcc6(%rip),%rsi
call   1060 <fatal_error@plt>
mov    0x24(%rsp),%ecx
movsd  0x10(%rsp),%xmm0
cmp    $0x7,%ecx
jne    140f <f_set_radius+0x2af>
ucomisd 0xc79(%rip),%xmm0
ja     13a7 <f_set_radius+0x247>
movsd  0xc77(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    13ba <f_set_radius+0x25a>
lea    0xd46(%rip),%rdi
lea    0xc88(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xc48(%rip),%xmm0
ja     13d8 <f_set_radius+0x278>
movsd  0xc46(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    13f1 <f_set_radius+0x291>
lea    0xd39(%rip),%rdi
lea    0xc57(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  0x18(%rsp),%xmm0
mov    $0x7,%bl
jmp    1473 <f_set_radius+0x313>
lea    0xdaa(%rip),%rdi
mov    %rbp,%rsi
call   1060 <fatal_error@plt>
mov    $0x1,%r15d
jmp    14ea <f_set_radius+0x38a>
ucomisd 0xbe9(%rip),%xmm0
ja     1427 <f_set_radius+0x2c7>
movsd  0xbe7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143a <f_set_radius+0x2da>
lea    0xd38(%rip),%rdi
lea    0xc08(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xbb8(%rip),%xmm0
ja     1458 <f_set_radius+0x2f8>
movsd  0xbb6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1471 <f_set_radius+0x311>
lea    0xd27(%rip),%rdi
lea    0xbd7(%rip),%rsi
call   1060 <fatal_error@plt>
movsd  0x18(%rsp),%xmm0
mov    $0x3,%bl
ucomisd 0x10(%rsp),%xmm0
jbe    148e <f_set_radius+0x32e>
lea    0xcba(%rip),%rdi
lea    0xbb4(%rip),%rsi
call   1060 <fatal_error@plt>
mov    %bl,(%r14)
movsd  0x10(%rsp),%xmm0
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <best_scaled_value@plt>
mov    0xc(%rsp),%al
mov    %al,0x6(%r14)
mov    0x8(%rsp),%edi
lea    0x7(%r14),%rsi
call   1030 <uint_char@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <best_scaled_value@plt>
mov    0xc(%rsp),%al
mov    %al,0xb(%r14)
mov    0x8(%rsp),%edi
add    $0xc,%r14
mov    %r14,%rsi
call   1030 <uint_char@plt>
mov    %r15d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"earth radius can not be set\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"4\00"
@.str.4 = [2 x i8] c"5\00"
@.str.5 = [2 x i8] c"6\00"
@.str.6 = [2 x i8] c"8\00"
@.str.7 = [2 x i8] c"9\00"
@.str.8 = [11 x i8] c"%d:%lf:%lf\00"
@.str.9 = [56 x i8] c"Grid defintion 101 does not support user-defined radius\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [37 x i8] c"set_radius: radius must be in meters\00"
@.str.12 = [66 x i8] c"Grid defintion 101 does not support user-defined major/minor axes\00"
@.str.13 = [36 x i8] c"set_radius: major must be in meters\00"
@.str.14 = [36 x i8] c"set_radius: minor must be in meters\00"
@.str.15 = [42 x i8] c"set_radius: minor must be less than major\00"
@.str.16 = [32 x i8] c"set_radius: major must be in km\00"
@.str.17 = [32 x i8] c"set_radius: minor must be in km\00"
@.str.18 = [32 x i8] c"set_radius: unknown argument %s\00"
define i32 @f_set_radius(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
%23 = load i32, i32* %9
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %210
25: ; preds = %7
%26 = load i8**, i8*** %10
%27 = call i8* @code_table_3_2_location(i8** %26)
store i8* %27, i8** %16
%28 = load i8*, i8** %16
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i8*, i8** %13
%32 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %211
33: ; preds = %25
%34 = load i8*, i8** %15
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load i8*, i8** %16
store i8 0, i8* %38
store i32 0, i32* %8
br label %211
39: ; preds = %33
%40 = load i8*, i8** %15
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i8*, i8** %16
store i8 2, i8* %44
store i32 0, i32* %8
br label %211
45: ; preds = %39
%46 = load i8*, i8** %15
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = load i8*, i8** %16
store i8 4, i8* %50
store i32 0, i32* %8
br label %211
51: ; preds = %45
%52 = load i8*, i8** %15
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = load i8*, i8** %16
store i8 5, i8* %56
store i32 0, i32* %8
br label %211
57: ; preds = %51
%58 = load i8*, i8** %15
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = load i8*, i8** %16
store i8 6, i8* %62
store i32 0, i32* %8
br label %211
63: ; preds = %57
%64 = load i8*, i8** %15
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = load i8*, i8** %16
store i8 8, i8* %68
store i32 0, i32* %8
br label %211
69: ; preds = %63
%70 = load i8*, i8** %15
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = load i8*, i8** %16
store i8 9, i8* %74
store i32 0, i32* %8
br label %211
75: ; preds = %69
%76 = load i8*, i8** %15
%77 = call i32 @sscanf(i8* %76, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32* %18, double* %21, double* %22)
store i32 %77, i32* %17
%78 = load i32, i32* %17
%79 = icmp eq i32 %78, 2
br i1 %79, label %80, label %114
80: ; preds = %75
%81 = load i32, i32* %18
%82 = icmp eq i32 %81, 1
br i1 %82, label %83, label %114
83: ; preds = %80
%84 = load i8**, i8*** %10
%85 = getelementptr inbounds i8*, i8** %84, i64 3
%86 = load i8*, i8** %85
%87 = getelementptr inbounds i8, i8* %86, i64 5
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = icmp eq i32 %89, 101
br i1 %90, label %91, label %93
91: ; preds = %83
%92 = call i32 @fatal_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %93
93: ; preds = %91, %83
%94 = load i8*, i8** %16
store i8 1, i8* %94
%95 = load double, double* %21
%96 = fcmp ogt double %95, 6.400000e+06
br i1 %96, label %100, label %97
97: ; preds = %93
%98 = load double, double* %21
%99 = fcmp olt double %98, 6.300000e+06
br i1 %99, label %100, label %102
100: ; preds = %97, %93
%101 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %102
102: ; preds = %100, %97
%103 = load double, double* %21
%104 = call i32 @best_scaled_value(double %103, i32* %19, i32* %20)
%105 = load i32, i32* %19
%106 = and i32 %105, 255
%107 = trunc i32 %106 to i8
%108 = load i8*, i8** %16
%109 = getelementptr inbounds i8, i8* %108, i64 1
store i8 %107, i8* %109
%110 = load i32, i32* %20
%111 = load i8*, i8** %16
%112 = getelementptr inbounds i8, i8* %111, i64 2
%113 = call i32 @uint_char(i32 %110, i8* %112)
store i32 0, i32* %8
br label %211
114: ; preds = %80, %75
%115 = load i32, i32* %17
%116 = icmp eq i32 %115, 3
br i1 %116, label %117, label %207
117: ; preds = %114
%118 = load i32, i32* %18
%119 = icmp eq i32 %118, 3
br i1 %119, label %123, label %120
120: ; preds = %117
%121 = load i32, i32* %18
%122 = icmp eq i32 %121, 7
br i1 %122, label %123, label %207
123: ; preds = %120, %117
%124 = load i8**, i8*** %10
%125 = getelementptr inbounds i8*, i8** %124, i64 3
%126 = load i8*, i8** %125
%127 = getelementptr inbounds i8, i8* %126, i64 5
%128 = load i8, i8* %127
%129 = zext i8 %128 to i32
%130 = icmp eq i32 %129, 101
br i1 %130, label %131, label %133
131: ; preds = %123
%132 = call i32 @fatal_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %133
133: ; preds = %131, %123
%134 = load i32, i32* %18
%135 = icmp eq i32 %134, 7
br i1 %135, label %136, label %160
136: ; preds = %133
%137 = load double, double* %21
%138 = fcmp ogt double %137, 6.400000e+06
br i1 %138, label %142, label %139
139: ; preds = %136
%140 = load double, double* %21
%141 = fcmp olt double %140, 6.300000e+06
br i1 %141, label %142, label %144
142: ; preds = %139, %136
%143 = call i32 @fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %144
144: ; preds = %142, %139
%145 = load double, double* %22
%146 = fcmp ogt double %145, 6.400000e+06
br i1 %146, label %150, label %147
147: ; preds = %144
%148 = load double, double* %22
%149 = fcmp olt double %148, 6.300000e+06
br i1 %149, label %150, label %152
150: ; preds = %147, %144
%151 = call i32 @fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %152
152: ; preds = %150, %147
%153 = load double, double* %21
%154 = load double, double* %22
%155 = fcmp olt double %153, %154
br i1 %155, label %156, label %158
156: ; preds = %152
%157 = call i32 @fatal_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %158
158: ; preds = %156, %152
%159 = load i8*, i8** %16
store i8 7, i8* %159
br label %184
160: ; preds = %133
%161 = load double, double* %21
%162 = fcmp ogt double %161, 6.400000e+03
br i1 %162, label %166, label %163
163: ; preds = %160
%164 = load double, double* %21
%165 = fcmp olt double %164, 6.300000e+03
br i1 %165, label %166, label %168
166: ; preds = %163, %160
%167 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %168
168: ; preds = %166, %163
%169 = load double, double* %22
%170 = fcmp ogt double %169, 6.400000e+03
br i1 %170, label %174, label %171
171: ; preds = %168
%172 = load double, double* %22
%173 = fcmp olt double %172, 6.300000e+03
br i1 %173, label %174, label %176
174: ; preds = %171, %168
%175 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %176
176: ; preds = %174, %171
%177 = load double, double* %21
%178 = load double, double* %22
%179 = fcmp olt double %177, %178
br i1 %179, label %180, label %182
180: ; preds = %176
%181 = call i32 @fatal_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %182
182: ; preds = %180, %176
%183 = load i8*, i8** %16
store i8 3, i8* %183
br label %184
184: ; preds = %182, %158
%185 = load double, double* %21
%186 = call i32 @best_scaled_value(double %185, i32* %19, i32* %20)
%187 = load i32, i32* %19
%188 = and i32 %187, 255
%189 = trunc i32 %188 to i8
%190 = load i8*, i8** %16
%191 = getelementptr inbounds i8, i8* %190, i64 6
store i8 %189, i8* %191
%192 = load i32, i32* %20
%193 = load i8*, i8** %16
%194 = getelementptr inbounds i8, i8* %193, i64 7
%195 = call i32 @uint_char(i32 %192, i8* %194)
%196 = load double, double* %22
%197 = call i32 @best_scaled_value(double %196, i32* %19, i32* %20)
%198 = load i32, i32* %19
%199 = and i32 %198, 255
%200 = trunc i32 %199 to i8
%201 = load i8*, i8** %16
%202 = getelementptr inbounds i8, i8* %201, i64 11
store i8 %200, i8* %202
%203 = load i32, i32* %20
%204 = load i8*, i8** %16
%205 = getelementptr inbounds i8, i8* %204, i64 12
%206 = call i32 @uint_char(i32 %203, i8* %205)
store i32 0, i32* %8
br label %211
207: ; preds = %120, %114
%208 = load i8*, i8** %15
%209 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i8* %208)
store i32 1, i32* %8
br label %211
210: ; preds = %7
store i32 0, i32* %8
br label %211
211: ; preds = %210, %207, %184, %102, %73, %67, %61, %55, %49, %43, %37, %30
%212 = load i32, i32* %8
ret i32 %212
}

LLVM IR (-O2):
@.str = [28 x i8] c"earth radius can not be set\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"4\00"
@.str.4 = [2 x i8] c"5\00"
@.str.5 = [2 x i8] c"6\00"
@.str.6 = [2 x i8] c"8\00"
@.str.7 = [2 x i8] c"9\00"
@.str.8 = [11 x i8] c"%d:%lf:%lf\00"
@.str.9 = [56 x i8] c"Grid defintion 101 does not support user-defined radius\00"
@.str.10 = [1 x i8] zeroinitializer
@.str.11 = [37 x i8] c"set_radius: radius must be in meters\00"
@.str.12 = [66 x i8] c"Grid defintion 101 does not support user-defined major/minor axes\00"
@.str.13 = [36 x i8] c"set_radius: major must be in meters\00"
@.str.14 = [36 x i8] c"set_radius: minor must be in meters\00"
@.str.15 = [42 x i8] c"set_radius: minor must be less than major\00"
@.str.16 = [32 x i8] c"set_radius: major must be in km\00"
@.str.17 = [32 x i8] c"set_radius: minor must be in km\00"
@.str.18 = [32 x i8] c"set_radius: unknown argument %s\00"
define i32 @f_set_radius(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32* %9 to i8*
%15 = bitcast i32* %10 to i8*
%16 = bitcast double* %11 to i8*
%17 = bitcast double* %12 to i8*
%18 = icmp sgt i32 %0, -1
br i1 %18, label %19, label %159
19: ; preds = %7
%20 = tail call i8* @code_table_3_2_location(i8** %1)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %23
22: ; preds = %19
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(28) %4, i8* align 1 dereferenceable(28) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 28, i1 false)
br label %159
23: ; preds = %19
%24 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
store i8 0, i8* %20
br label %159
27: ; preds = %23
%28 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27
store i8 2, i8* %20
br label %159
31: ; preds = %27
%32 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %31
store i8 4, i8* %20
br label %159
35: ; preds = %31
%36 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35
store i8 5, i8* %20
br label %159
39: ; preds = %35
%40 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %39
store i8 6, i8* %20
br label %159
43: ; preds = %39
%44 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %43
store i8 8, i8* %20
br label %159
47: ; preds = %43
%48 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %47
store i8 9, i8* %20
br label %159
51: ; preds = %47
%52 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32* %8, double* %11, double* %12)
%53 = icmp eq i32 %52, 2
%54 = load i32, i32* %8
%55 = icmp eq i32 %54, 1
%56 = select i1 %53, i1 %55, i1 false
br i1 %56, label %57, label %82
57: ; preds = %51
%58 = getelementptr inbounds i8*, i8** %1, i64 3
%59 = load i8*, i8** %58
%60 = getelementptr inbounds i8, i8* %59, i64 5
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 101
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 @fatal_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %65
65: ; preds = %63, %57
store i8 1, i8* %20
%66 = load double, double* %11
%67 = fcmp ogt double %66, 6.400000e+06
%68 = fcmp olt double %66, 6.300000e+06
%69 = or i1 %67, %68
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%72 = load double, double* %11
br label %73
73: ; preds = %65, %70
%74 = phi double [ %66, %65 ], [ %72, %70 ]
%75 = call i32 @best_scaled_value(double %74, i32* %9, i32* %10)
%76 = load i32, i32* %9
%77 = trunc i32 %76 to i8
%78 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %77, i8* %78
%79 = load i32, i32* %10
%80 = getelementptr inbounds i8, i8* %20, i64 2
%81 = call i32 @uint_char(i32 %79, i8* %80)
br label %159
82: ; preds = %51
%83 = icmp eq i32 %52, 3
%84 = and i32 %54, -5
%85 = icmp eq i32 %84, 3
%86 = select i1 %83, i1 %85, i1 false
br i1 %86, label %87, label %157
87: ; preds = %82
%88 = getelementptr inbounds i8*, i8** %1, i64 3
%89 = load i8*, i8** %88
%90 = getelementptr inbounds i8, i8* %89, i64 5
%91 = load i8, i8* %90
%92 = icmp eq i8 %91, 101
br i1 %92, label %93, label %96
93: ; preds = %87
%94 = call i32 @fatal_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%95 = load i32, i32* %8
br label %96
96: ; preds = %93, %87
%97 = phi i32 [ %95, %93 ], [ %54, %87 ]
%98 = icmp eq i32 %97, 7
%99 = load double, double* %11
br i1 %98, label %100, label %118
100: ; preds = %96
%101 = fcmp ogt double %99, 6.400000e+06
%102 = fcmp olt double %99, 6.300000e+06
%103 = or i1 %101, %102
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = call i32 @fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %106
106: ; preds = %100, %104
%107 = load double, double* %12
%108 = fcmp ogt double %107, 6.400000e+06
%109 = fcmp olt double %107, 6.300000e+06
%110 = or i1 %108, %109
br i1 %110, label %111, label %114
111: ; preds = %106
%112 = call i32 @fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%113 = load double, double* %12
br label %114
114: ; preds = %106, %111
%115 = phi double [ %107, %106 ], [ %113, %111 ]
%116 = load double, double* %11
%117 = fcmp olt double %116, %115
br i1 %117, label %136, label %139
118: ; preds = %96
%119 = fcmp ogt double %99, 6.400000e+03
%120 = fcmp olt double %99, 6.300000e+03
%121 = or i1 %119, %120
br i1 %121, label %122, label %124
122: ; preds = %118
%123 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %124
124: ; preds = %118, %122
%125 = load double, double* %12
%126 = fcmp ogt double %125, 6.400000e+03
%127 = fcmp olt double %125, 6.300000e+03
%128 = or i1 %126, %127
br i1 %128, label %129, label %132
129: ; preds = %124
%130 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
%131 = load double, double* %12
br label %132
132: ; preds = %124, %129
%133 = phi double [ %125, %124 ], [ %131, %129 ]
%134 = load double, double* %11
%135 = fcmp olt double %134, %133
br i1 %135, label %136, label %139
136: ; preds = %132, %114
%137 = phi i8 [ 7, %114 ], [ 3, %132 ]
%138 = call i32 @fatal_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %139
139: ; preds = %136, %132, %114
%140 = phi i8 [ 7, %114 ], [ 3, %132 ], [ %137, %136 ]
store i8 %140, i8* %20
%141 = load double, double* %11
%142 = call i32 @best_scaled_value(double %141, i32* %9, i32* %10)
%143 = load i32, i32* %9
%144 = trunc i32 %143 to i8
%145 = getelementptr inbounds i8, i8* %20, i64 6
store i8 %144, i8* %145
%146 = load i32, i32* %10
%147 = getelementptr inbounds i8, i8* %20, i64 7
%148 = call i32 @uint_char(i32 %146, i8* %147)
%149 = load double, double* %12
%150 = call i32 @best_scaled_value(double %149, i32* %9, i32* %10)
%151 = load i32, i32* %9
%152 = trunc i32 %151 to i8
%153 = getelementptr inbounds i8, i8* %20, i64 11
store i8 %152, i8* %153
%154 = load i32, i32* %10
%155 = getelementptr inbounds i8, i8* %20, i64 12
%156 = call i32 @uint_char(i32 %154, i8* %155)
br label %159
157: ; preds = %82
%158 = call i32 @fatal_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i8* %6)
br label %159
159: ; preds = %7, %157, %139, %73, %50, %46, %42, %38, %34, %30, %26, %22
%160 = phi i32 [ 0, %22 ], [ 0, %26 ], [ 0, %30 ], [ 0, %34 ], [ 0, %38 ], [ 0, %42 ], [ 0, %46 ], [ 0, %50 ], [ 0, %73 ], [ 0, %139 ], [ 1, %157 ], [ 0, %7 ]
ret i32 %160
}