#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 add_dt(int *, int *, int *, int *, int *, int *, int, int);
int /*<<< orphan*/ add_time(int *, int *, int *, int *, int *, int *,
                            unsigned int, int);
scalar_t__ check_datecode(int, int, int);
int code_table_4_4(unsigned char **);
int /*<<< orphan*/ fatal_error(char *, char const *);
int /*<<< orphan*/ fatal_error_i(char *, int);
int forecast_time_in_units(unsigned char **);
int int4(unsigned char *);
int /*<<< orphan*/ reftime(unsigned char **, int *, int *, int *, int *, int *,
                           int *);
int /*<<< orphan*/ save_time(int, int, int, int, int, int, unsigned char *);
int sscanf(char const *, char *, int *, ...);
int stat_proc_n_time_ranges_index(unsigned char **);
scalar_t__ strcmp(char *, char *);
int strlen(char const *);
int sub_dt(int *, int *, int *, int *, int *, int *, int, int);
int f_set_date(int mode, unsigned char **sec, float *data, unsigned int ndata,
               char *inv_out, void **local, const char *arg1) {
  int year, month, day, hour, minute, second, i, j, units, n;
  int code_4_11, idx;
  int dtime, dt_unit;
  char string[10];
  if (mode < 0)
    return 0;
  reftime(sec, &year, &month, &day, &hour, &minute, &second);
  if (arg1[0] == '+' || arg1[0] == '-') {
    i = sscanf(arg1 + 1, "%d%2s", &dtime, string);
    if (i != 2 || dtime < 0)
      fatal_error("set_date: delta-time: (+|-)(int)(hr|dy|mo|yr)", "");
    dt_unit = -1;
    if (strcmp(string, "hr") == 0)
      dt_unit = 1;
    else if (strcmp(string, "dy") == 0)
      dt_unit = 2;
    else if (strcmp(string, "mo") == 0)
      dt_unit = 3;
    else if (strcmp(string, "yr") == 0)
      dt_unit = 4;
    else if (strcmp(string, "mn") == 0)
      dt_unit = 0;
    if (dt_unit == -1)
      fatal_error("set_date: unsupported time unit %s", string);
    if (arg1[0] == '+')
      i = add_dt(&year, &month, &day, &hour, &minute, &second, dtime, dt_unit);
    else
      i = sub_dt(&year, &month, &day, &hour, &minute, &second, dtime, dt_unit);
  } else {
    i = strlen(arg1);
    if (i < 4 || i > 14 || i % 2 == 1)
      fatal_error("set_date: bad date code %s", arg1);
    i = sscanf(arg1, "%4d%2d%2d%2d%2d%2d", &year, &month, &day, &hour, &minute,
               &second);
    if (i < 1)
      fatal_error("set_date: bad date code %s", arg1);
    if (check_datecode(year, month, day) != 0 || hour < 0 || hour >= 24 ||
        minute < 0 || minute >= 60 || second < 0 || second >= 60)
      fatal_error("set_date: bad date code %s", arg1);
  }
  save_time(year, month, day, hour, minute, second, sec[1] + 12);
  idx = stat_proc_n_time_ranges_index(sec);
  if (idx < 0)
    return 0;
  n = (int)sec[4][idx];
  j = idx + 35 - 42;
  units = code_table_4_4(sec);
  dtime = forecast_time_in_units(sec);
  add_time(&year, &month, &day, &hour, &minute, &second, (unsigned int)dtime,
           units);
  for (i = 0; i < n; i++) {
    code_4_11 = (int)sec[4][47 - 34 + j + i * 12];
    units = (int)sec[4][48 - 34 + j + i * 12];
    dtime = int4(sec[4] + 49 - 34 + j + i * 12);
    if (code_4_11 == 3 || code_4_11 == 4)
      continue;
    if (code_4_11 == 1 || code_4_11 == 2) {
      add_time(&year, &month, &day, &hour, &minute, &second,
               (unsigned int)dtime, units);
    } else {
      fatal_error_i("set_date: code 4.11=%d is not supported", code_4_11);
    }
  }
  save_time(year, month, day, hour, minute, second, sec[4] + j);
  return 0;
}


x86 assembly (clang, -O0):
<f_set_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%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)
jge    122b <f_set_date+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    16f3 <f_set_date+0x503>
mov    -0x10(%rbp),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0x44(%rbp),%r9
lea    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   10a0 <reftime@plt>
mov    0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     1270 <f_set_date+0x80>
mov    0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    141e <f_set_date+0x22e>
mov    0x10(%rbp),%rdi
add    $0x1,%rdi
lea    -0x72(%rbp),%rcx
lea    0xd7d(%rip),%rsi
lea    -0x64(%rbp),%rdx
mov    $0x0,%al
call   10d0 <sscanf@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x2,-0x4c(%rbp)
jne    12a5 <f_set_date+0xb5>
cmpl   $0x0,-0x64(%rbp)
jge    12b8 <f_set_date+0xc8>
lea    0xd5a(%rip),%rdi
lea    0xd80(%rip),%rsi
call   10c0 <fatal_error@plt>
movl   $0xffffffff,-0x68(%rbp)
lea    -0x72(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12e5 <f_set_date+0xf5>
movl   $0x1,-0x68(%rbp)
jmp    138c <f_set_date+0x19c>
lea    -0x72(%rbp),%rdi
lea    0xd47(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    130b <f_set_date+0x11b>
movl   $0x2,-0x68(%rbp)
jmp    1387 <f_set_date+0x197>
lea    -0x72(%rbp),%rdi
lea    0xd24(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1331 <f_set_date+0x141>
movl   $0x3,-0x68(%rbp)
jmp    1382 <f_set_date+0x192>
lea    -0x72(%rbp),%rdi
lea    0xd01(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1357 <f_set_date+0x167>
movl   $0x4,-0x68(%rbp)
jmp    137d <f_set_date+0x18d>
lea    -0x72(%rbp),%rdi
lea    0xcde(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1378 <f_set_date+0x188>
movl   $0x0,-0x68(%rbp)
jmp    137d <f_set_date+0x18d>
jmp    1382 <f_set_date+0x192>
jmp    1387 <f_set_date+0x197>
jmp    138c <f_set_date+0x19c>
cmpl   $0xffffffff,-0x68(%rbp)
jne    13a6 <f_set_date+0x1b6>
lea    -0x72(%rbp),%rsi
lea    0xca2(%rip),%rdi
call   10c0 <fatal_error@plt>
mov    0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    13ea <f_set_date+0x1fa>
mov    -0x64(%rbp),%r10d
mov    -0x68(%rbp),%eax
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    -0x48(%rbp),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   10e0 <add_dt@plt>
mov    %eax,-0x4c(%rbp)
jmp    1419 <f_set_date+0x229>
mov    -0x64(%rbp),%r10d
mov    -0x68(%rbp),%eax
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    -0x48(%rbp),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   10b0 <sub_dt@plt>
mov    %eax,-0x4c(%rbp)
jmp    151b <f_set_date+0x32b>
mov    0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jl     1452 <f_set_date+0x262>
cmpl   $0xe,-0x4c(%rbp)
jg     1452 <f_set_date+0x262>
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1462 <f_set_date+0x272>
mov    0x10(%rbp),%rsi
lea    0xc09(%rip),%rdi
call   10c0 <fatal_error@plt>
mov    0x10(%rbp),%rdi
lea    0xc14(%rip),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x3c(%rbp),%r8
lea    -0x40(%rbp),%r9
lea    -0x44(%rbp),%r10
lea    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10d0 <sscanf@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x1,-0x4c(%rbp)
jge    14b2 <f_set_date+0x2c2>
mov    0x10(%rbp),%rsi
lea    0xbb9(%rip),%rdi
call   10c0 <fatal_error@plt>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
call   10f0 <check_datecode@plt>
cmp    $0x0,%rax
jne    1506 <f_set_date+0x316>
cmpl   $0x0,-0x40(%rbp)
jl     1506 <f_set_date+0x316>
cmpl   $0x18,-0x40(%rbp)
jge    1506 <f_set_date+0x316>
cmpl   $0x0,-0x44(%rbp)
jl     1506 <f_set_date+0x316>
cmpl   $0x3c,-0x44(%rbp)
jge    1506 <f_set_date+0x316>
cmpl   $0x0,-0x48(%rbp)
jl     1506 <f_set_date+0x316>
cmpl   $0x3c,-0x48(%rbp)
jl     1516 <f_set_date+0x326>
mov    0x10(%rbp),%rsi
lea    0xb55(%rip),%rdi
call   10c0 <fatal_error@plt>
jmp    151b <f_set_date+0x32b>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
add    $0xc,%rax
mov    %rax,(%rsp)
call   1080 <save_time@plt>
mov    -0x10(%rbp),%rdi
call   1070 <stat_proc_n_time_ranges_index@plt>
mov    %eax,-0x60(%rbp)
cmpl   $0x0,-0x60(%rbp)
jge    1566 <f_set_date+0x376>
movl   $0x0,-0x4(%rbp)
jmp    16f3 <f_set_date+0x503>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x60(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x58(%rbp)
mov    -0x60(%rbp),%eax
add    $0x23,%eax
sub    $0x2a,%eax
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1100 <code_table_4_4@plt>
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rdi
call   1110 <forecast_time_in_units@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%r10d
mov    -0x54(%rbp),%eax
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    -0x48(%rbp),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <add_time@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    16c0 <f_set_date+0x4d0>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x50(%rbp),%ecx
add    $0xd,%ecx
imul   $0xc,-0x4c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x50(%rbp),%ecx
add    $0xe,%ecx
imul   $0xc,-0x4c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
add    $0x31,%rdi
add    $0xffffffffffffffde,%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
imul   $0xc,-0x4c(%rbp),%eax
cltq
add    %rax,%rdi
call   1040 <int4@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x3,-0x5c(%rbp)
je     1654 <f_set_date+0x464>
cmpl   $0x4,-0x5c(%rbp)
jne    1659 <f_set_date+0x469>
jmp    16b2 <f_set_date+0x4c2>
cmpl   $0x1,-0x5c(%rbp)
je     166d <f_set_date+0x47d>
cmpl   $0x2,-0x5c(%rbp)
jne    169e <f_set_date+0x4ae>
mov    -0x64(%rbp),%r10d
mov    -0x54(%rbp),%eax
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    -0x48(%rbp),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <add_time@plt>
jmp    16ad <f_set_date+0x4bd>
mov    -0x5c(%rbp),%esi
lea    0x9ec(%rip),%rdi
call   1030 <fatal_error_i@plt>
jmp    16b2 <f_set_date+0x4c2>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    15d0 <f_set_date+0x3e0>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x50(%rbp),%r10
add    %r10,%rax
mov    %rax,(%rsp)
call   1080 <save_time@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_set_date>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
test   %edi,%edi
js     1599 <f_set_date+0x3a9>
mov    %rsi,%r15
mov    0x70(%rsp),%r14
sub    $0x8,%rsp
lea    0x20(%rsp),%rbp
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x24(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%r9
push   %rbp
call   10a0 <reftime@plt>
add    $0x10,%rsp
mov    (%r14),%al
cmp    $0x2d,%al
je     124f <f_set_date+0x5f>
cmp    $0x2b,%al
jne    132c <f_set_date+0x13c>
lea    0x1(%r14),%rdi
lea    0xda6(%rip),%rsi
lea    0x20(%rsp),%rdx
lea    0x26(%rsp),%rcx
xor    %eax,%eax
call   10d0 <sscanf@plt>
cmp    $0x2,%eax
jne    1277 <f_set_date+0x87>
cmpl   $0x0,0x20(%rsp)
jns    128a <f_set_date+0x9a>
lea    0xd88(%rip),%rdi
lea    0xdae(%rip),%rsi
call   10c0 <fatal_error@plt>
lea    0xda3(%rip),%rsi
lea    0x26(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13e8 <f_set_date+0x1f8>
lea    0xd8c(%rip),%rsi
lea    0x26(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13ef <f_set_date+0x1ff>
lea    0xd75(%rip),%rsi
lea    0x26(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13f6 <f_set_date+0x206>
lea    0xd5e(%rip),%rsi
lea    0x26(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13fd <f_set_date+0x20d>
lea    0xd47(%rip),%rsi
lea    0x26(%rsp),%rdi
call   1090 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
neg    %ebx
test   %rax,%rax
je     1402 <f_set_date+0x212>
lea    0xd26(%rip),%rdi
lea    0x26(%rsp),%rsi
call   10c0 <fatal_error@plt>
jmp    1402 <f_set_date+0x212>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    -0xf(%rax),%ecx
cmp    $0xfffffff5,%ecx
jb     134d <f_set_date+0x15d>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
jne    135c <f_set_date+0x16c>
lea    0xd12(%rip),%rdi
mov    %r14,%rsi
call   10c0 <fatal_error@plt>
lea    0xd1e(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %r14,%rdi
xor    %eax,%eax
push   %rbp
push   %rbx
call   10d0 <sscanf@plt>
add    $0x10,%rsp
test   %eax,%eax
jg     139a <f_set_date+0x1aa>
lea    0xcd4(%rip),%rdi
mov    %r14,%rsi
call   10c0 <fatal_error@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   10f0 <check_datecode@plt>
test   %rax,%rax
jne    13d7 <f_set_date+0x1e7>
mov    0x8(%rsp),%eax
test   %eax,%eax
js     13d7 <f_set_date+0x1e7>
cmp    $0x17,%eax
jg     13d7 <f_set_date+0x1e7>
mov    0x1c(%rsp),%eax
test   %eax,%eax
js     13d7 <f_set_date+0x1e7>
cmp    $0x3b,%eax
jg     13d7 <f_set_date+0x1e7>
mov    0x18(%rsp),%eax
test   %eax,%eax
js     13d7 <f_set_date+0x1e7>
cmp    $0x3c,%eax
jl     143e <f_set_date+0x24e>
lea    0xc88(%rip),%rdi
mov    %r14,%rsi
call   10c0 <fatal_error@plt>
jmp    143e <f_set_date+0x24e>
mov    $0x1,%ebx
jmp    1402 <f_set_date+0x212>
mov    $0x2,%ebx
jmp    1402 <f_set_date+0x212>
mov    $0x3,%ebx
jmp    1402 <f_set_date+0x212>
mov    $0x4,%ebx
cmpb   $0x2b,(%r14)
mov    0x20(%rsp),%eax
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
jne    1433 <f_set_date+0x243>
push   %rbx
push   %rax
call   10e0 <add_dt@plt>
jmp    143a <f_set_date+0x24a>
push   %rbx
push   %rax
call   10b0 <sub_dt@plt>
add    $0x10,%rsp
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
mov    0x8(%r15),%rax
add    $0xc,%rax
sub    $0x8,%rsp
push   %rax
call   1080 <save_time@plt>
add    $0x10,%rsp
mov    %r15,%rdi
call   1070 <stat_proc_n_time_ranges_index@plt>
test   %eax,%eax
js     1599 <f_set_date+0x3a9>
mov    %eax,%ebx
mov    0x20(%r15),%rax
mov    %ebx,%ecx
movzbl (%rax,%rcx,1),%r14d
lea    -0x7(%rbx),%r12d
mov    %r15,%rdi
call   1100 <code_table_4_4@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1110 <forecast_time_in_units@plt>
mov    %eax,0x20(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
push   %rbp
push   %rax
call   1060 <add_time@plt>
add    $0x10,%rsp
movslq %r12d,%rax
mov    %rax,0x30(%rsp)
test   %r14,%r14
je     1568 <f_set_date+0x378>
add    $0x7,%ebx
mov    0x30(%rsp),%rax
lea    0xf(%rax),%r13
jmp    150b <f_set_date+0x31b>
nopl   (%rax)
lea    0xb9d(%rip),%rdi
mov    %ebp,%esi
call   1030 <fatal_error_i@plt>
add    $0xc,%ebx
add    $0xc,%r13
add    $0xffffffffffffffff,%r14
je     1568 <f_set_date+0x378>
mov    0x20(%r15),%rdi
lea    -0x1(%rbx),%eax
cltq
movzbl (%rdi,%rax,1),%ebp
movslq %ebx,%rax
movzbl (%rdi,%rax,1),%r12d
add    %r13,%rdi
call   1040 <int4@plt>
mov    %eax,0x20(%rsp)
lea    -0x3(%rbp),%ecx
cmp    $0x2,%cl
jb     14fe <f_set_date+0x30e>
lea    -0x1(%rbp),%ecx
cmp    $0x1,%cl
ja     14f0 <f_set_date+0x300>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
push   %r12
push   %rax
call   1060 <add_time@plt>
add    $0x10,%rsp
jmp    14fe <f_set_date+0x30e>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
mov    0x30(%rsp),%rax
add    0x20(%r15),%rax
sub    $0x8,%rsp
push   %rax
call   1080 <save_time@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d%2s\00"
@.str.1 = [46 x i8] c"set_date: delta-time: (+|-)(int)(hr|dy|mo|yr)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c"hr\00"
@.str.4 = [3 x i8] c"dy\00"
@.str.5 = [3 x i8] c"mo\00"
@.str.6 = [3 x i8] c"yr\00"
@.str.7 = [3 x i8] c"mn\00"
@.str.8 = [35 x i8] c"set_date: unsupported time unit %s\00"
@.str.9 = [27 x i8] c"set_date: bad date code %s\00"
@.str.10 = [19 x i8] c"%4d%2d%2d%2d%2d%2d\00"
@.str.11 = [40 x i8] c"set_date: code 4.11=%d is not supported\00"
define i32 @f_set_date(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 i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca [10 x i8]
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
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %7
store i32 0, i32* %8
br label %276
34: ; preds = %7
%35 = load i8**, i8*** %10
%36 = call i32 @reftime(i8** %35, i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21)
%37 = load i8*, i8** %15
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 43
br i1 %41, label %48, label %42
42: ; preds = %34
%43 = load i8*, i8** %15
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 45
br i1 %47, label %48, label %110
48: ; preds = %42, %34
%49 = load i8*, i8** %15
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%52 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %28, i8* %51)
store i32 %52, i32* %22
%53 = load i32, i32* %22
%54 = icmp ne i32 %53, 2
br i1 %54, label %58, label %55
55: ; preds = %48
%56 = load i32, i32* %28
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %55, %48
%59 = call i32 @fatal_error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %55
store i32 -1, i32* %29
%61 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %60
store i32 1, i32* %29
br label %89
65: ; preds = %60
%66 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %65
store i32 2, i32* %29
br label %88
70: ; preds = %65
%71 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %70
store i32 3, i32* %29
br label %87
75: ; preds = %70
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %75
store i32 4, i32* %29
br label %86
80: ; preds = %75
%81 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %80
store i32 0, i32* %29
br label %85
85: ; preds = %84, %80
br label %86
86: ; preds = %85, %79
br label %87
87: ; preds = %86, %74
br label %88
88: ; preds = %87, %69
br label %89
89: ; preds = %88, %64
%90 = load i32, i32* %29
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %95
92: ; preds = %89
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %30, i64 0, i64 0
%94 = call i32 @fatal_error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* %93)
br label %95
95: ; preds = %92, %89
%96 = load i8*, i8** %15
%97 = getelementptr inbounds i8, i8* %96, i64 0
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 43
br i1 %100, label %101, label %105
101: ; preds = %95
%102 = load i32, i32* %28
%103 = load i32, i32* %29
%104 = call i32 @add_dt(i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32 %102, i32 %103)
store i32 %104, i32* %22
br label %109
105: ; preds = %95
%106 = load i32, i32* %28
%107 = load i32, i32* %29
%108 = call i32 @sub_dt(i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32 %106, i32 %107)
store i32 %108, i32* %22
br label %109
109: ; preds = %105, %101
br label %161
110: ; preds = %42
%111 = load i8*, i8** %15
%112 = call i32 @strlen(i8* %111)
store i32 %112, i32* %22
%113 = load i32, i32* %22
%114 = icmp slt i32 %113, 4
br i1 %114, label %122, label %115
115: ; preds = %110
%116 = load i32, i32* %22
%117 = icmp sgt i32 %116, 14
br i1 %117, label %122, label %118
118: ; preds = %115
%119 = load i32, i32* %22
%120 = srem i32 %119, 2
%121 = icmp eq i32 %120, 1
br i1 %121, label %122, label %125
122: ; preds = %118, %115, %110
%123 = load i8*, i8** %15
%124 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %123)
br label %125
125: ; preds = %122, %118
%126 = load i8*, i8** %15
%127 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %126, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21)
store i32 %127, i32* %22
%128 = load i32, i32* %22
%129 = icmp slt i32 %128, 1
br i1 %129, label %130, label %133
130: ; preds = %125
%131 = load i8*, i8** %15
%132 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %131)
br label %133
133: ; preds = %130, %125
%134 = load i32, i32* %16
%135 = load i32, i32* %17
%136 = load i32, i32* %18
%137 = call i64 @check_datecode(i32 %134, i32 %135, i32 %136)
%138 = icmp ne i64 %137, 0
br i1 %138, label %157, label %139
139: ; preds = %133
%140 = load i32, i32* %19
%141 = icmp slt i32 %140, 0
br i1 %141, label %157, label %142
142: ; preds = %139
%143 = load i32, i32* %19
%144 = icmp sge i32 %143, 24
br i1 %144, label %157, label %145
145: ; preds = %142
%146 = load i32, i32* %20
%147 = icmp slt i32 %146, 0
br i1 %147, label %157, label %148
148: ; preds = %145
%149 = load i32, i32* %20
%150 = icmp sge i32 %149, 60
br i1 %150, label %157, label %151
151: ; preds = %148
%152 = load i32, i32* %21
%153 = icmp slt i32 %152, 0
br i1 %153, label %157, label %154
154: ; preds = %151
%155 = load i32, i32* %21
%156 = icmp sge i32 %155, 60
br i1 %156, label %157, label %160
157: ; preds = %154, %151, %148, %145, %142, %139, %133
%158 = load i8*, i8** %15
%159 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %158)
br label %160
160: ; preds = %157, %154
br label %161
161: ; preds = %160, %109
%162 = load i32, i32* %16
%163 = load i32, i32* %17
%164 = load i32, i32* %18
%165 = load i32, i32* %19
%166 = load i32, i32* %20
%167 = load i32, i32* %21
%168 = load i8**, i8*** %10
%169 = getelementptr inbounds i8*, i8** %168, i64 1
%170 = load i8*, i8** %169
%171 = getelementptr inbounds i8, i8* %170, i64 12
%172 = call i32 @save_time(i32 %162, i32 %163, i32 %164, i32 %165, i32 %166, i32 %167, i8* %171)
%173 = load i8**, i8*** %10
%174 = call i32 @stat_proc_n_time_ranges_index(i8** %173)
store i32 %174, i32* %27
%175 = load i32, i32* %27
%176 = icmp slt i32 %175, 0
br i1 %176, label %177, label %178
177: ; preds = %161
store i32 0, i32* %8
br label %276
178: ; preds = %161
%179 = load i8**, i8*** %10
%180 = getelementptr inbounds i8*, i8** %179, i64 4
%181 = load i8*, i8** %180
%182 = load i32, i32* %27
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %181, i64 %183
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
store i32 %186, i32* %25
%187 = load i32, i32* %27
%188 = add nsw i32 %187, 35
%189 = sub nsw i32 %188, 42
store i32 %189, i32* %23
%190 = load i8**, i8*** %10
%191 = call i32 @code_table_4_4(i8** %190)
store i32 %191, i32* %24
%192 = load i8**, i8*** %10
%193 = call i32 @forecast_time_in_units(i8** %192)
store i32 %193, i32* %28
%194 = load i32, i32* %28
%195 = load i32, i32* %24
%196 = call i32 @add_time(i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32 %194, i32 %195)
store i32 0, i32* %22
br label %197
197: ; preds = %259, %178
%198 = load i32, i32* %22
%199 = load i32, i32* %25
%200 = icmp slt i32 %198, %199
br i1 %200, label %201, label %262
201: ; preds = %197
%202 = load i8**, i8*** %10
%203 = getelementptr inbounds i8*, i8** %202, i64 4
%204 = load i8*, i8** %203
%205 = load i32, i32* %23
%206 = add nsw i32 13, %205
%207 = load i32, i32* %22
%208 = mul nsw i32 %207, 12
%209 = add nsw i32 %206, %208
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %204, i64 %210
%212 = load i8, i8* %211
%213 = zext i8 %212 to i32
store i32 %213, i32* %26
%214 = load i8**, i8*** %10
%215 = getelementptr inbounds i8*, i8** %214, i64 4
%216 = load i8*, i8** %215
%217 = load i32, i32* %23
%218 = add nsw i32 14, %217
%219 = load i32, i32* %22
%220 = mul nsw i32 %219, 12
%221 = add nsw i32 %218, %220
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i8, i8* %216, i64 %222
%224 = load i8, i8* %223
%225 = zext i8 %224 to i32
store i32 %225, i32* %24
%226 = load i8**, i8*** %10
%227 = getelementptr inbounds i8*, i8** %226, i64 4
%228 = load i8*, i8** %227
%229 = getelementptr inbounds i8, i8* %228, i64 49
%230 = getelementptr inbounds i8, i8* %229, i64 -34
%231 = load i32, i32* %23
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds i8, i8* %230, i64 %232
%234 = load i32, i32* %22
%235 = mul nsw i32 %234, 12
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8, i8* %233, i64 %236
%238 = call i32 @int4(i8* %237)
store i32 %238, i32* %28
%239 = load i32, i32* %26
%240 = icmp eq i32 %239, 3
br i1 %240, label %244, label %241
241: ; preds = %201
%242 = load i32, i32* %26
%243 = icmp eq i32 %242, 4
br i1 %243, label %244, label %245
244: ; preds = %241, %201
br label %259
245: ; preds = %241
%246 = load i32, i32* %26
%247 = icmp eq i32 %246, 1
br i1 %247, label %251, label %248
248: ; preds = %245
%249 = load i32, i32* %26
%250 = icmp eq i32 %249, 2
br i1 %250, label %251, label %255
251: ; preds = %248, %245
%252 = load i32, i32* %28
%253 = load i32, i32* %24
%254 = call i32 @add_time(i32* %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, i32 %252, i32 %253)
br label %258
255: ; preds = %248
%256 = load i32, i32* %26
%257 = call i32 @fatal_error_i(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i32 %256)
br label %258
258: ; preds = %255, %251
br label %259
259: ; preds = %258, %244
%260 = load i32, i32* %22
%261 = add nsw i32 %260, 1
store i32 %261, i32* %22
br label %197
262: ; preds = %197
%263 = load i32, i32* %16
%264 = load i32, i32* %17
%265 = load i32, i32* %18
%266 = load i32, i32* %19
%267 = load i32, i32* %20
%268 = load i32, i32* %21
%269 = load i8**, i8*** %10
%270 = getelementptr inbounds i8*, i8** %269, i64 4
%271 = load i8*, i8** %270
%272 = load i32, i32* %23
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8, i8* %271, i64 %273
%275 = call i32 @save_time(i32 %263, i32 %264, i32 %265, i32 %266, i32 %267, i32 %268, i8* %274)
store i32 0, i32* %8
br label %276
276: ; preds = %262, %177, %33
%277 = load i32, i32* %8
ret i32 %277
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d%2s\00"
@.str.1 = [46 x i8] c"set_date: delta-time: (+|-)(int)(hr|dy|mo|yr)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [3 x i8] c"hr\00"
@.str.4 = [3 x i8] c"dy\00"
@.str.5 = [3 x i8] c"mo\00"
@.str.6 = [3 x i8] c"yr\00"
@.str.7 = [3 x i8] c"mn\00"
@.str.8 = [35 x i8] c"set_date: unsupported time unit %s\00"
@.str.9 = [27 x i8] c"set_date: bad date code %s\00"
@.str.10 = [19 x i8] c"%4d%2d%2d%2d%2d%2d\00"
@.str.11 = [40 x i8] c"set_date: code 4.11=%d is not supported\00"
define i32 @f_set_date(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [10 x i8]
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = bitcast i32* %11 to i8*
%20 = bitcast i32* %12 to i8*
%21 = bitcast i32* %13 to i8*
%22 = bitcast i32* %14 to i8*
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%24 = icmp slt i32 %0, 0
br i1 %24, label %171, label %25
25: ; preds = %7
%26 = call i32 @reftime(i8** %1, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13)
%27 = load i8, i8* %6
switch i8 %27, label %65 [
i8 43, label %28
i8 45, label %28
]
28: ; preds = %25, %25
%29 = getelementptr inbounds i8, i8* %6, i64 1
%30 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %14, i8* %23)
%31 = icmp ne i32 %30, 2
%32 = load i32, i32* %14
%33 = icmp slt i32 %32, 0
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 @fatal_error(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %28, %35
%38 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %56, label %40
40: ; preds = %37
%41 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %56, label %43
43: ; preds = %40
%44 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %56, label %46
46: ; preds = %43
%47 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %56, label %49
49: ; preds = %46
%50 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
%52 = xor i1 %51, true
%53 = sext i1 %52 to i32
br i1 %51, label %56, label %54
54: ; preds = %49
%55 = call i32 @fatal_error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i8* %23)
br label %56
56: ; preds = %46, %43, %40, %37, %54, %49
%57 = phi i32 [ %53, %54 ], [ %53, %49 ], [ 4, %46 ], [ 3, %43 ], [ 2, %40 ], [ 1, %37 ]
%58 = load i8, i8* %6
%59 = icmp eq i8 %58, 43
%60 = load i32, i32* %14
br i1 %59, label %61, label %63
61: ; preds = %56
%62 = call i32 @add_dt(i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %60, i32 %57)
br label %102
63: ; preds = %56
%64 = call i32 @sub_dt(i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %60, i32 %57)
br label %102
65: ; preds = %25
%66 = call i32 @strlen(i8* %6)
%67 = add i32 %66, -15
%68 = icmp ult i32 %67, -11
%69 = srem i32 %66, 2
%70 = icmp eq i32 %69, 1
%71 = or i1 %68, %70
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %6)
br label %74
74: ; preds = %65, %72
%75 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13)
%76 = icmp slt i32 %75, 1
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %6)
br label %79
79: ; preds = %77, %74
%80 = load i32, i32* %8
%81 = load i32, i32* %9
%82 = load i32, i32* %10
%83 = call i64 @check_datecode(i32 %80, i32 %81, i32 %82)
%84 = icmp ne i64 %83, 0
%85 = load i32, i32* %11
%86 = icmp slt i32 %85, 0
%87 = select i1 %84, i1 true, i1 %86
%88 = icmp sgt i32 %85, 23
%89 = select i1 %87, i1 true, i1 %88
%90 = load i32, i32* %12
%91 = icmp slt i32 %90, 0
%92 = select i1 %89, i1 true, i1 %91
%93 = icmp sgt i32 %90, 59
%94 = select i1 %92, i1 true, i1 %93
%95 = load i32, i32* %13
%96 = icmp slt i32 %95, 0
%97 = select i1 %94, i1 true, i1 %96
%98 = icmp sgt i32 %95, 59
%99 = select i1 %97, i1 true, i1 %98
br i1 %99, label %100, label %102
100: ; preds = %79
%101 = call i32 @fatal_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %6)
br label %102
102: ; preds = %100, %79, %61, %63
%103 = load i32, i32* %8
%104 = load i32, i32* %9
%105 = load i32, i32* %10
%106 = load i32, i32* %11
%107 = load i32, i32* %12
%108 = load i32, i32* %13
%109 = getelementptr inbounds i8*, i8** %1, i64 1
%110 = load i8*, i8** %109
%111 = getelementptr inbounds i8, i8* %110, i64 12
%112 = call i32 @save_time(i32 %103, i32 %104, i32 %105, i32 %106, i32 %107, i32 %108, i8* %111)
%113 = call i32 @stat_proc_n_time_ranges_index(i8** %1)
%114 = icmp slt i32 %113, 0
br i1 %114, label %171, label %115
115: ; preds = %102
%116 = getelementptr inbounds i8*, i8** %1, i64 4
%117 = load i8*, i8** %116
%118 = zext i32 %113 to i64
%119 = getelementptr inbounds i8, i8* %117, i64 %118
%120 = load i8, i8* %119
%121 = add nsw i32 %113, -7
%122 = call i32 @code_table_4_4(i8** %1)
%123 = call i32 @forecast_time_in_units(i8** %1)
store i32 %123, i32* %14
%124 = call i32 @add_time(i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %123, i32 %122)
%125 = icmp eq i8 %120, 0
%126 = sext i32 %121 to i64
br i1 %125, label %161, label %127
127: ; preds = %115
%128 = zext i8 %120 to i64
br label %129
129: ; preds = %127, %158
%130 = phi i64 [ 0, %127 ], [ %159, %158 ]
%131 = load i8*, i8** %116
%132 = mul nuw nsw i64 %130, 12
%133 = trunc i64 %132 to i32
%134 = add i32 %113, %133
%135 = add i32 %134, 6
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8, i8* %131, i64 %136
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = add i32 %134, 7
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8, i8* %131, i64 %141
%143 = load i8, i8* %142
%144 = zext i8 %143 to i32
%145 = getelementptr inbounds i8, i8* %131, i64 15
%146 = getelementptr inbounds i8, i8* %145, i64 %126
%147 = getelementptr inbounds i8, i8* %146, i64 %132
%148 = call i32 @int4(i8* %147)
store i32 %148, i32* %14
%149 = add i8 %138, -3
%150 = icmp ult i8 %149, 2
br i1 %150, label %158, label %151
151: ; preds = %129
%152 = add i8 %138, -1
%153 = icmp ult i8 %152, 2
br i1 %153, label %154, label %156
154: ; preds = %151
%155 = call i32 @add_time(i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, i32 %148, i32 %144)
br label %158
156: ; preds = %151
%157 = call i32 @fatal_error_i(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i32 %139)
br label %158
158: ; preds = %154, %156, %129
%159 = add nuw nsw i64 %130, 1
%160 = icmp eq i64 %159, %128
br i1 %160, label %161, label %129
161: ; preds = %158, %115
%162 = load i32, i32* %8
%163 = load i32, i32* %9
%164 = load i32, i32* %10
%165 = load i32, i32* %11
%166 = load i32, i32* %12
%167 = load i32, i32* %13
%168 = load i8*, i8** %116
%169 = getelementptr inbounds i8, i8* %168, i64 %126
%170 = call i32 @save_time(i32 %162, i32 %163, i32 %164, i32 %165, i32 %166, i32 %167, i8* %169)
br label %171
171: ; preds = %102, %7, %161
ret i32 0
}