#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 atoi(char const *);
int code_table_4_0(unsigned char **);
int /*<<< orphan*/ fatal_error(char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int uint4(unsigned char *);
int /*<<< orphan*/ uint_char(int, unsigned char *);
int /*<<< orphan*/ update_sec4(unsigned char **, unsigned char *);
int f_set_ensm_derived_fcst(int mode, unsigned char **sec, float *data,
                            unsigned int ndata, char *inv_out, void **local,
                            const char *arg1, const char *arg2) {
  int code_table_4_7, num_ens;
  int i, n, n0, pdt;
  unsigned char *sec4;
  if (mode < 0)
    return 0;
  code_table_4_7 = atoi(arg1);
  if (code_table_4_7 < 0 || code_table_4_7 > 255)
    fatal_error("set_ensm_derived_fcst: code table 4.7 0..255 found %s", arg1);
  num_ens = atoi(arg2);
  if (num_ens == -1)
    num_ens = 255;
  if (num_ens < 0 || num_ens > 255)
    fatal_error("set_ensm_derived_fcst: num ens emembers 0..255 found %s",
                arg2);
  pdt = code_table_4_0(sec);
  if (pdt == 2 || pdt == 12) {
    if (code_table_4_7 != 255)
      sec[4][34] = code_table_4_7;
    if (num_ens != 255)
      sec[4][35] = num_ens;
    return 0;
  }
  n0 = (sec[4] ? uint4(sec[4] + 0) : 0);
  if (pdt == 0 || pdt == 1) {
    n = 36;
  } else if (pdt == 8) {
    n = n0 + 2;
  } else if (pdt == 11) {
    n = n0 - 1;
  } else {
    fprintf(stderr, "set_ensm_derived_fcst: only works with product defn "
                    "template 0,1,2,8,11,12\n");
    return 0;
  }
  sec4 = (unsigned char *)malloc(n * sizeof(unsigned char));
  if (sec4 == NULL)
    fatal_error("set_ensm_derived_fcst: memeor allocation error", "");
  if (pdt == 0 || pdt == 1) {
    for (i = 0; i < 34; i++)
      sec4[i] = sec[4][i];
    sec4[34] = code_table_4_7;
    sec4[35] = num_ens;
  } else if (pdt == 8) {
    for (i = 0; i < 34; i++)
      sec4[i] = sec[4][i];
    sec4[34] = code_table_4_7;
    sec4[35] = num_ens;
    for (i = 36; i < n; i++)
      sec4[i] = sec[4][i - 2];
  } else if (pdt == 11) {
    for (i = 0; i < 34; i++)
      sec4[i] = sec[4][i];
    sec4[34] = code_table_4_7;
    sec4[35] = num_ens;
    for (i = 36; i < n; i++)
      sec4[i] = sec[4][i + 1];
  }
  uint_char(n, sec4);
  sec4[7] = 0;
  sec4[8] = pdt >= 8 ? 12 : 2;
  update_sec4(sec, sec4);
  free(sec4);
  return 0;
}


x86 assembly (clang, -O0):
<f_set_ensm_derived_fcst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
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    11cc <f_set_ensm_derived_fcst+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    158a <f_set_ensm_derived_fcst+0x3fa>
mov    0x10(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     11ef <f_set_ensm_derived_fcst+0x5f>
cmpl   $0xff,-0x34(%rbp)
jle    11ff <f_set_ensm_derived_fcst+0x6f>
mov    0x10(%rbp),%rsi
lea    0xe06(%rip),%rdi
call   1070 <fatal_error@plt>
mov    0x18(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0xffffffff,-0x38(%rbp)
jne    121c <f_set_ensm_derived_fcst+0x8c>
movl   $0xff,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jl     1233 <f_set_ensm_derived_fcst+0xa3>
cmpl   $0xff,-0x38(%rbp)
jle    1243 <f_set_ensm_derived_fcst+0xb3>
mov    0x18(%rbp),%rsi
lea    0xdf8(%rip),%rdi
call   1070 <fatal_error@plt>
mov    -0x10(%rbp),%rdi
call   1090 <code_table_4_0@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x2,-0x48(%rbp)
je     1263 <f_set_ensm_derived_fcst+0xd3>
cmpl   $0xc,-0x48(%rbp)
jne    12a9 <f_set_ensm_derived_fcst+0x119>
cmpl   $0xff,-0x34(%rbp)
je     1280 <f_set_ensm_derived_fcst+0xf0>
mov    -0x34(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %cl,0x22(%rax)
cmpl   $0xff,-0x38(%rbp)
je     129d <f_set_ensm_derived_fcst+0x10d>
mov    -0x38(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %cl,0x23(%rax)
movl   $0x0,-0x4(%rbp)
jmp    158a <f_set_ensm_derived_fcst+0x3fa>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x20(%rax)
je     12cd <f_set_ensm_derived_fcst+0x13d>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <uint4@plt>
mov    %eax,-0x54(%rbp)
jmp    12d7 <f_set_ensm_derived_fcst+0x147>
xor    %eax,%eax
mov    %eax,-0x54(%rbp)
jmp    12d7 <f_set_ensm_derived_fcst+0x147>
mov    -0x54(%rbp),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     12f1 <f_set_ensm_derived_fcst+0x161>
cmpl   $0x1,-0x48(%rbp)
jne    12fd <f_set_ensm_derived_fcst+0x16d>
movl   $0x24,-0x40(%rbp)
jmp    1358 <f_set_ensm_derived_fcst+0x1c8>
cmpl   $0x8,-0x48(%rbp)
jne    1315 <f_set_ensm_derived_fcst+0x185>
mov    -0x44(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x40(%rbp)
jmp    1353 <f_set_ensm_derived_fcst+0x1c3>
cmpl   $0xb,-0x48(%rbp)
jne    132d <f_set_ensm_derived_fcst+0x19d>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    134e <f_set_ensm_derived_fcst+0x1be>
mov    0x2cac(%rip),%rax
mov    (%rax),%edi
lea    0xd31(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    158a <f_set_ensm_derived_fcst+0x3fa>
jmp    1353 <f_set_ensm_derived_fcst+0x1c3>
jmp    1358 <f_set_ensm_derived_fcst+0x1c8>
movslq -0x40(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1389 <f_set_ensm_derived_fcst+0x1f9>
lea    0xd3d(%rip),%rdi
lea    0xd35(%rip),%rsi
call   1070 <fatal_error@plt>
cmpl   $0x0,-0x48(%rbp)
je     139d <f_set_ensm_derived_fcst+0x20d>
cmpl   $0x1,-0x48(%rbp)
jne    13f3 <f_set_ensm_derived_fcst+0x263>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x22,-0x3c(%rbp)
jge    13d6 <f_set_ensm_derived_fcst+0x246>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13a4 <f_set_ensm_derived_fcst+0x214>
mov    -0x34(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x22(%rax)
mov    -0x38(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x23(%rax)
jmp    153d <f_set_ensm_derived_fcst+0x3ad>
cmpl   $0x8,-0x48(%rbp)
jne    1493 <f_set_ensm_derived_fcst+0x303>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x22,-0x3c(%rbp)
jge    1436 <f_set_ensm_derived_fcst+0x2a6>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1404 <f_set_ensm_derived_fcst+0x274>
mov    -0x34(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x22(%rax)
mov    -0x38(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x23(%rax)
movl   $0x24,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    148e <f_set_ensm_derived_fcst+0x2fe>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1455 <f_set_ensm_derived_fcst+0x2c5>
jmp    1538 <f_set_ensm_derived_fcst+0x3a8>
cmpl   $0xb,-0x48(%rbp)
jne    1533 <f_set_ensm_derived_fcst+0x3a3>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x22,-0x3c(%rbp)
jge    14d6 <f_set_ensm_derived_fcst+0x346>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14a4 <f_set_ensm_derived_fcst+0x314>
mov    -0x34(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x22(%rax)
mov    -0x38(%rbp),%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x23(%rax)
movl   $0x24,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    152e <f_set_ensm_derived_fcst+0x39e>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14f5 <f_set_ensm_derived_fcst+0x365>
jmp    1533 <f_set_ensm_derived_fcst+0x3a3>
jmp    1538 <f_set_ensm_derived_fcst+0x3a8>
jmp    153d <f_set_ensm_derived_fcst+0x3ad>
mov    -0x40(%rbp),%edi
mov    -0x50(%rbp),%rsi
call   1040 <uint_char@plt>
mov    -0x50(%rbp),%rax
movb   $0x0,0x7(%rax)
mov    -0x48(%rbp),%edx
mov    $0x2,%eax
mov    $0xc,%ecx
cmp    $0x8,%edx
cmovge %ecx,%eax
mov    %al,%cl
mov    -0x50(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   10b0 <update_sec4@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_set_ensm_derived_fcst>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
js     14ed <f_set_ensm_derived_fcst+0x35d>
mov    %rsi,%rbx
mov    0x48(%rsp),%r14
mov    0x40(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <atoi@plt>
mov    %eax,%r12d
cmp    $0x100,%eax
jb     11d1 <f_set_ensm_derived_fcst+0x41>
lea    0xe37(%rip),%rdi
mov    %rbp,%rsi
call   1070 <fatal_error@plt>
mov    %r14,%rdi
call   10a0 <atoi@plt>
cmp    $0xffffffff,%eax
mov    $0xff,%r13d
cmovne %eax,%r13d
cmp    $0x100,%r13d
jb     11fe <f_set_ensm_derived_fcst+0x6e>
lea    0xe40(%rip),%rdi
mov    %r14,%rsi
call   1070 <fatal_error@plt>
mov    %rbx,%rdi
call   1090 <code_table_4_0@plt>
cmp    $0xc,%eax
je     1213 <f_set_ensm_derived_fcst+0x83>
mov    %eax,%r14d
cmp    $0x2,%eax
jne    123e <f_set_ensm_derived_fcst+0xae>
cmp    $0xff,%r12d
je     1224 <f_set_ensm_derived_fcst+0x94>
mov    0x20(%rbx),%rax
mov    %r12b,0x22(%rax)
cmp    $0xff,%r13d
je     14ed <f_set_ensm_derived_fcst+0x35d>
mov    0x20(%rbx),%rax
mov    %r13b,0x23(%rax)
jmp    14ed <f_set_ensm_derived_fcst+0x35d>
mov    0x20(%rbx),%rdi
test   %rdi,%rdi
je     124e <f_set_ensm_derived_fcst+0xbe>
call   1050 <uint4@plt>
jmp    1250 <f_set_ensm_derived_fcst+0xc0>
xor    %eax,%eax
mov    $0x24,%r15d
cmp    $0x2,%r14d
jb     1277 <f_set_ensm_derived_fcst+0xe7>
cmp    $0xb,%r14d
je     1271 <f_set_ensm_derived_fcst+0xe1>
cmp    $0x8,%r14d
jne    13cc <f_set_ensm_derived_fcst+0x23c>
add    $0x2,%eax
jmp    1274 <f_set_ensm_derived_fcst+0xe4>
add    $0xffffffff,%eax
mov    %eax,%r15d
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
je     12c0 <f_set_ensm_derived_fcst+0x130>
cmp    $0x1,%r14d
ja     12d9 <f_set_ensm_derived_fcst+0x149>
xor    %eax,%eax
nop
mov    0x20(%rbx),%rcx
movzbl (%rcx,%rax,1),%ecx
mov    %cl,0x0(%rbp,%rax,1)
mov    0x20(%rbx),%rcx
movzbl 0x1(%rcx,%rax,1),%ecx
mov    %cl,0x1(%rbp,%rax,1)
add    $0x2,%rax
cmp    $0x22,%rax
jne    1290 <f_set_ensm_derived_fcst+0x100>
mov    %r12b,0x22(%rbp)
mov    %r13b,0x23(%rbp)
jmp    14b7 <f_set_ensm_derived_fcst+0x327>
lea    0xdf3(%rip),%rdi
lea    0xdeb(%rip),%rsi
call   1070 <fatal_error@plt>
cmp    $0x1,%r14d
jbe    128d <f_set_ensm_derived_fcst+0xfd>
cmp    $0x8,%r14d
je     13e6 <f_set_ensm_derived_fcst+0x256>
cmp    $0xb,%r14d
jne    14b7 <f_set_ensm_derived_fcst+0x327>
xor    %eax,%eax
nop
mov    0x20(%rbx),%rcx
movzbl (%rcx,%rax,1),%ecx
mov    %cl,0x0(%rbp,%rax,1)
mov    0x20(%rbx),%rcx
movzbl 0x1(%rcx,%rax,1),%ecx
mov    %cl,0x1(%rbp,%rax,1)
add    $0x2,%rax
cmp    $0x22,%rax
jne    12f0 <f_set_ensm_derived_fcst+0x160>
mov    %r12b,0x22(%rbp)
mov    %r13b,0x23(%rbp)
cmp    $0x25,%r15d
jl     14b7 <f_set_ensm_derived_fcst+0x327>
mov    %r15d,%r8d
lea    -0x25(%r8),%rsi
mov    %r8d,%eax
and    $0x3,%eax
mov    $0x24,%edx
cmp    $0x3,%rsi
jb     1399 <f_set_ensm_derived_fcst+0x209>
add    $0xffffffffffffffdc,%r8
and    $0xfffffffffffffffc,%r8
neg    %r8
mov    $0x24,%esi
nopl   (%rax)
mov    0x20(%rbx),%rdx
movzbl 0x1(%rdx,%rsi,1),%edx
mov    %dl,0x0(%rbp,%rsi,1)
mov    0x20(%rbx),%rdx
movzbl 0x2(%rdx,%rsi,1),%edx
mov    %dl,0x1(%rbp,%rsi,1)
mov    0x20(%rbx),%rdx
movzbl 0x3(%rdx,%rsi,1),%edx
mov    %dl,0x2(%rbp,%rsi,1)
mov    0x20(%rbx),%rdi
lea    0x4(%rsi),%rdx
movzbl 0x4(%rdi,%rsi,1),%ecx
mov    %cl,0x3(%rbp,%rsi,1)
lea    (%r8,%rsi,1),%rcx
add    $0x4,%rcx
mov    %rdx,%rsi
cmp    $0x24,%rcx
jne    1350 <f_set_ensm_derived_fcst+0x1c0>
test   %rax,%rax
je     14b7 <f_set_ensm_derived_fcst+0x327>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x20(%rbx),%rcx
movzbl 0x1(%rcx,%rdx,1),%ecx
mov    %cl,0x0(%rbp,%rdx,1)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rax
jne    13b0 <f_set_ensm_derived_fcst+0x220>
jmp    14b7 <f_set_ensm_derived_fcst+0x327>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
lea    0xc92(%rip),%rsi
call   1060 <fprintf@plt>
jmp    14ed <f_set_ensm_derived_fcst+0x35d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    0x20(%rbx),%rcx
movzbl (%rcx,%rax,1),%ecx
mov    %cl,0x0(%rbp,%rax,1)
mov    0x20(%rbx),%rcx
movzbl 0x1(%rcx,%rax,1),%ecx
mov    %cl,0x1(%rbp,%rax,1)
add    $0x2,%rax
cmp    $0x22,%rax
jne    13f0 <f_set_ensm_derived_fcst+0x260>
mov    %r12b,0x22(%rbp)
mov    %r13b,0x23(%rbp)
cmp    $0x25,%r15d
jl     14b7 <f_set_ensm_derived_fcst+0x327>
mov    %r15d,%edi
lea    -0x25(%rdi),%rsi
mov    %edi,%eax
and    $0x3,%eax
mov    $0x24,%ecx
cmp    $0x3,%rsi
jb     1491 <f_set_ensm_derived_fcst+0x301>
add    $0xffffffffffffffdc,%rdi
and    $0xfffffffffffffffc,%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rbx),%rsi
movzbl 0x22(%rsi,%rcx,1),%edx
mov    %dl,0x24(%rbp,%rcx,1)
mov    0x20(%rbx),%rdx
movzbl 0x23(%rdx,%rcx,1),%edx
mov    %dl,0x25(%rbp,%rcx,1)
mov    0x20(%rbx),%rdx
movzbl 0x24(%rdx,%rcx,1),%edx
mov    %dl,0x26(%rbp,%rcx,1)
mov    0x20(%rbx),%rdx
movzbl 0x25(%rdx,%rcx,1),%edx
mov    %dl,0x27(%rbp,%rcx,1)
add    $0x4,%rcx
cmp    %rcx,%rdi
jne    1450 <f_set_ensm_derived_fcst+0x2c0>
add    $0x24,%rcx
test   %rax,%rax
je     14b7 <f_set_ensm_derived_fcst+0x327>
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rbx),%rdx
movzbl -0x2(%rdx,%rcx,1),%edx
mov    %dl,0x0(%rbp,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rax
jne    14a0 <f_set_ensm_derived_fcst+0x310>
mov    %r15d,%edi
mov    %rbp,%rsi
call   1040 <uint_char@plt>
movb   $0x0,0x7(%rbp)
cmp    $0x8,%r14d
mov    $0xc,%eax
mov    $0x2,%ecx
cmovge %eax,%ecx
mov    %cl,0x8(%rbp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <update_sec4@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"set_ensm_derived_fcst: code table 4.7 0..255 found %s\00"
@.str.1 = [56 x i8] c"set_ensm_derived_fcst: num ens emembers 0..255 found %s\00"
@stderr = global i32 0
@.str.2 = [76 x i8] c"set_ensm_derived_fcst: only works with product defn template 0,1,2,8,11,12\0A\00"
@.str.3 = [47 x i8] c"set_ensm_derived_fcst: memeor allocation error\00"
@.str.4 = [1 x i8] zeroinitializer
define i32 @f_set_ensm_derived_fcst(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca float*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8**
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i8*
store i32 %0, i32* %10
store i8** %1, i8*** %11
store float* %2, float** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i8** %5, i8*** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
%25 = load i32, i32* %10
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %8
store i32 0, i32* %9
br label %289
28: ; preds = %8
%29 = load i8*, i8** %16
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %18
%31 = load i32, i32* %18
%32 = icmp slt i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %28
%34 = load i32, i32* %18
%35 = icmp sgt i32 %34, 255
br i1 %35, label %36, label %39
36: ; preds = %33, %28
%37 = load i8*, i8** %16
%38 = call i32 @fatal_error(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %36, %33
%40 = load i8*, i8** %17
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %19
%42 = load i32, i32* %19
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %45
44: ; preds = %39
store i32 255, i32* %19
br label %45
45: ; preds = %44, %39
%46 = load i32, i32* %19
%47 = icmp slt i32 %46, 0
br i1 %47, label %51, label %48
48: ; preds = %45
%49 = load i32, i32* %19
%50 = icmp sgt i32 %49, 255
br i1 %50, label %51, label %54
51: ; preds = %48, %45
%52 = load i8*, i8** %17
%53 = call i32 @fatal_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %51, %48
%55 = load i8**, i8*** %11
%56 = call i32 @code_table_4_0(i8** %55)
store i32 %56, i32* %23
%57 = load i32, i32* %23
%58 = icmp eq i32 %57, 2
br i1 %58, label %62, label %59
59: ; preds = %54
%60 = load i32, i32* %23
%61 = icmp eq i32 %60, 12
br i1 %61, label %62, label %83
62: ; preds = %59, %54
%63 = load i32, i32* %18
%64 = icmp ne i32 %63, 255
br i1 %64, label %65, label %72
65: ; preds = %62
%66 = load i32, i32* %18
%67 = trunc i32 %66 to i8
%68 = load i8**, i8*** %11
%69 = getelementptr inbounds i8*, i8** %68, i64 4
%70 = load i8*, i8** %69
%71 = getelementptr inbounds i8, i8* %70, i64 34
store i8 %67, i8* %71
br label %72
72: ; preds = %65, %62
%73 = load i32, i32* %19
%74 = icmp ne i32 %73, 255
br i1 %74, label %75, label %82
75: ; preds = %72
%76 = load i32, i32* %19
%77 = trunc i32 %76 to i8
%78 = load i8**, i8*** %11
%79 = getelementptr inbounds i8*, i8** %78, i64 4
%80 = load i8*, i8** %79
%81 = getelementptr inbounds i8, i8* %80, i64 35
store i8 %77, i8* %81
br label %82
82: ; preds = %75, %72
store i32 0, i32* %9
br label %289
83: ; preds = %59
%84 = load i8**, i8*** %11
%85 = getelementptr inbounds i8*, i8** %84, i64 4
%86 = load i8*, i8** %85
%87 = icmp ne i8* %86, null
br i1 %87, label %88, label %94
88: ; preds = %83
%89 = load i8**, i8*** %11
%90 = getelementptr inbounds i8*, i8** %89, i64 4
%91 = load i8*, i8** %90
%92 = getelementptr inbounds i8, i8* %91, i64 0
%93 = call i32 @uint4(i8* %92)
br label %95
94: ; preds = %83
br label %95
95: ; preds = %94, %88
%96 = phi i32 [ %93, %88 ], [ 0, %94 ]
store i32 %96, i32* %22
%97 = load i32, i32* %23
%98 = icmp eq i32 %97, 0
br i1 %98, label %102, label %99
99: ; preds = %95
%100 = load i32, i32* %23
%101 = icmp eq i32 %100, 1
br i1 %101, label %102, label %103
102: ; preds = %99, %95
store i32 36, i32* %21
br label %120
103: ; preds = %99
%104 = load i32, i32* %23
%105 = icmp eq i32 %104, 8
br i1 %105, label %106, label %109
106: ; preds = %103
%107 = load i32, i32* %22
%108 = add nsw i32 %107, 2
store i32 %108, i32* %21
br label %119
109: ; preds = %103
%110 = load i32, i32* %23
%111 = icmp eq i32 %110, 11
br i1 %111, label %112, label %115
112: ; preds = %109
%113 = load i32, i32* %22
%114 = sub nsw i32 %113, 1
store i32 %114, i32* %21
br label %118
115: ; preds = %109
%116 = load i32, i32* @stderr
%117 = call i32 @fprintf(i32 %116, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %9
br label %289
118: ; preds = %112
br label %119
119: ; preds = %118, %106
br label %120
120: ; preds = %119, %102
%121 = load i32, i32* %21
%122 = sext i32 %121 to i64
%123 = mul i64 %122, 1
%124 = trunc i64 %123 to i32
%125 = call i64 @malloc(i32 %124)
%126 = inttoptr i64 %125 to i8*
store i8* %126, i8** %24
%127 = load i8*, i8** %24
%128 = icmp eq i8* %127, null
br i1 %128, label %129, label %131
129: ; preds = %120
%130 = call i32 @fatal_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
br label %131
131: ; preds = %129, %120
%132 = load i32, i32* %23
%133 = icmp eq i32 %132, 0
br i1 %133, label %137, label %134
134: ; preds = %131
%135 = load i32, i32* %23
%136 = icmp eq i32 %135, 1
br i1 %136, label %137, label %165
137: ; preds = %134, %131
store i32 0, i32* %20
br label %138
138: ; preds = %153, %137
%139 = load i32, i32* %20
%140 = icmp slt i32 %139, 34
br i1 %140, label %141, label %156
141: ; preds = %138
%142 = load i8**, i8*** %11
%143 = getelementptr inbounds i8*, i8** %142, i64 4
%144 = load i8*, i8** %143
%145 = load i32, i32* %20
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %144, i64 %146
%148 = load i8, i8* %147
%149 = load i8*, i8** %24
%150 = load i32, i32* %20
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %149, i64 %151
store i8 %148, i8* %152
br label %153
153: ; preds = %141
%154 = load i32, i32* %20
%155 = add nsw i32 %154, 1
store i32 %155, i32* %20
br label %138
156: ; preds = %138
%157 = load i32, i32* %18
%158 = trunc i32 %157 to i8
%159 = load i8*, i8** %24
%160 = getelementptr inbounds i8, i8* %159, i64 34
store i8 %158, i8* %160
%161 = load i32, i32* %19
%162 = trunc i32 %161 to i8
%163 = load i8*, i8** %24
%164 = getelementptr inbounds i8, i8* %163, i64 35
store i8 %162, i8* %164
br label %271
165: ; preds = %134
%166 = load i32, i32* %23
%167 = icmp eq i32 %166, 8
br i1 %167, label %168, label %217
168: ; preds = %165
store i32 0, i32* %20
br label %169
169: ; preds = %184, %168
%170 = load i32, i32* %20
%171 = icmp slt i32 %170, 34
br i1 %171, label %172, label %187
172: ; preds = %169
%173 = load i8**, i8*** %11
%174 = getelementptr inbounds i8*, i8** %173, i64 4
%175 = load i8*, i8** %174
%176 = load i32, i32* %20
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i8, i8* %175, i64 %177
%179 = load i8, i8* %178
%180 = load i8*, i8** %24
%181 = load i32, i32* %20
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds i8, i8* %180, i64 %182
store i8 %179, i8* %183
br label %184
184: ; preds = %172
%185 = load i32, i32* %20
%186 = add nsw i32 %185, 1
store i32 %186, i32* %20
br label %169
187: ; preds = %169
%188 = load i32, i32* %18
%189 = trunc i32 %188 to i8
%190 = load i8*, i8** %24
%191 = getelementptr inbounds i8, i8* %190, i64 34
store i8 %189, i8* %191
%192 = load i32, i32* %19
%193 = trunc i32 %192 to i8
%194 = load i8*, i8** %24
%195 = getelementptr inbounds i8, i8* %194, i64 35
store i8 %193, i8* %195
store i32 36, i32* %20
br label %196
196: ; preds = %213, %187
%197 = load i32, i32* %20
%198 = load i32, i32* %21
%199 = icmp slt i32 %197, %198
br i1 %199, label %200, label %216
200: ; preds = %196
%201 = load i8**, i8*** %11
%202 = getelementptr inbounds i8*, i8** %201, i64 4
%203 = load i8*, i8** %202
%204 = load i32, i32* %20
%205 = sub nsw i32 %204, 2
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i8, i8* %203, i64 %206
%208 = load i8, i8* %207
%209 = load i8*, i8** %24
%210 = load i32, i32* %20
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds i8, i8* %209, i64 %211
store i8 %208, i8* %212
br label %213
213: ; preds = %200
%214 = load i32, i32* %20
%215 = add nsw i32 %214, 1
store i32 %215, i32* %20
br label %196
216: ; preds = %196
br label %270
217: ; preds = %165
%218 = load i32, i32* %23
%219 = icmp eq i32 %218, 11
br i1 %219, label %220, label %269
220: ; preds = %217
store i32 0, i32* %20
br label %221
221: ; preds = %236, %220
%222 = load i32, i32* %20
%223 = icmp slt i32 %222, 34
br i1 %223, label %224, label %239
224: ; preds = %221
%225 = load i8**, i8*** %11
%226 = getelementptr inbounds i8*, i8** %225, i64 4
%227 = load i8*, i8** %226
%228 = load i32, i32* %20
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i8, i8* %227, i64 %229
%231 = load i8, i8* %230
%232 = load i8*, i8** %24
%233 = load i32, i32* %20
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i8, i8* %232, i64 %234
store i8 %231, i8* %235
br label %236
236: ; preds = %224
%237 = load i32, i32* %20
%238 = add nsw i32 %237, 1
store i32 %238, i32* %20
br label %221
239: ; preds = %221
%240 = load i32, i32* %18
%241 = trunc i32 %240 to i8
%242 = load i8*, i8** %24
%243 = getelementptr inbounds i8, i8* %242, i64 34
store i8 %241, i8* %243
%244 = load i32, i32* %19
%245 = trunc i32 %244 to i8
%246 = load i8*, i8** %24
%247 = getelementptr inbounds i8, i8* %246, i64 35
store i8 %245, i8* %247
store i32 36, i32* %20
br label %248
248: ; preds = %265, %239
%249 = load i32, i32* %20
%250 = load i32, i32* %21
%251 = icmp slt i32 %249, %250
br i1 %251, label %252, label %268
252: ; preds = %248
%253 = load i8**, i8*** %11
%254 = getelementptr inbounds i8*, i8** %253, i64 4
%255 = load i8*, i8** %254
%256 = load i32, i32* %20
%257 = add nsw i32 %256, 1
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds i8, i8* %255, i64 %258
%260 = load i8, i8* %259
%261 = load i8*, i8** %24
%262 = load i32, i32* %20
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds i8, i8* %261, i64 %263
store i8 %260, i8* %264
br label %265
265: ; preds = %252
%266 = load i32, i32* %20
%267 = add nsw i32 %266, 1
store i32 %267, i32* %20
br label %248
268: ; preds = %248
br label %269
269: ; preds = %268, %217
br label %270
270: ; preds = %269, %216
br label %271
271: ; preds = %270, %156
%272 = load i32, i32* %21
%273 = load i8*, i8** %24
%274 = call i32 @uint_char(i32 %272, i8* %273)
%275 = load i8*, i8** %24
%276 = getelementptr inbounds i8, i8* %275, i64 7
store i8 0, i8* %276
%277 = load i32, i32* %23
%278 = icmp sge i32 %277, 8
%279 = zext i1 %278 to i64
%280 = select i1 %278, i32 12, i32 2
%281 = trunc i32 %280 to i8
%282 = load i8*, i8** %24
%283 = getelementptr inbounds i8, i8* %282, i64 8
store i8 %281, i8* %283
%284 = load i8**, i8*** %11
%285 = load i8*, i8** %24
%286 = call i32 @update_sec4(i8** %284, i8* %285)
%287 = load i8*, i8** %24
%288 = call i32 @free(i8* %287)
store i32 0, i32* %9
br label %289
289: ; preds = %271, %115, %82, %27
%290 = load i32, i32* %9
ret i32 %290
}

LLVM IR (-O2):
@.str = [54 x i8] c"set_ensm_derived_fcst: code table 4.7 0..255 found %s\00"
@.str.1 = [56 x i8] c"set_ensm_derived_fcst: num ens emembers 0..255 found %s\00"
@stderr = global i32 0
@.str.2 = [76 x i8] c"set_ensm_derived_fcst: only works with product defn template 0,1,2,8,11,12\0A\00"
@.str.3 = [47 x i8] c"set_ensm_derived_fcst: memeor allocation error\00"
@.str.4 = [1 x i8] zeroinitializer
define i32 @f_set_ensm_derived_fcst(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* %6, i8* %7) {
%9 = icmp slt i32 %0, 0
br i1 %9, label %223, label %10
10: ; preds = %8
%11 = tail call i32 @atoi(i8* %6)
%12 = icmp ugt i32 %11, 255
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @fatal_error(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %15
15: ; preds = %10, %13
%16 = tail call i32 @atoi(i8* %7)
%17 = icmp eq i32 %16, -1
%18 = select i1 %17, i32 255, i32 %16
%19 = icmp ugt i32 %18, 255
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call i32 @fatal_error(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %22
22: ; preds = %15, %20
%23 = tail call i32 @code_table_4_0(i8** %1)
switch i32 %23, label %38 [
i32 12, label %24
i32 2, label %24
]
24: ; preds = %22, %22
%25 = icmp eq i32 %11, 255
br i1 %25, label %31, label %26
26: ; preds = %24
%27 = trunc i32 %11 to i8
%28 = getelementptr inbounds i8*, i8** %1, i64 4
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i64 34
store i8 %27, i8* %30
br label %31
31: ; preds = %26, %24
%32 = icmp eq i32 %18, 255
br i1 %32, label %223, label %33
33: ; preds = %31
%34 = trunc i32 %18 to i8
%35 = getelementptr inbounds i8*, i8** %1, i64 4
%36 = load i8*, i8** %35
%37 = getelementptr inbounds i8, i8* %36, i64 35
store i8 %34, i8* %37
br label %223
38: ; preds = %22
%39 = getelementptr inbounds i8*, i8** %1, i64 4
%40 = load i8*, i8** %39
%41 = icmp eq i8* %40, null
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = tail call i32 @uint4(i8* %40)
br label %44
44: ; preds = %38, %42
%45 = phi i32 [ %43, %42 ], [ 0, %38 ]
%46 = icmp ult i32 %23, 2
br i1 %46, label %55, label %47
47: ; preds = %44
switch i32 %23, label %52 [
i32 8, label %48
i32 11, label %50
]
48: ; preds = %47
%49 = add nsw i32 %45, 2
br label %55
50: ; preds = %47
%51 = add nsw i32 %45, -1
br label %55
52: ; preds = %47
%53 = load i32, i32* @stderr
%54 = tail call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
br label %223
55: ; preds = %44, %48, %50
%56 = phi i32 [ %49, %48 ], [ %51, %50 ], [ 36, %44 ]
%57 = tail call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to i8*
%59 = icmp eq i64 %57, 0
br i1 %59, label %60, label %62
60: ; preds = %55
%61 = tail call i32 @fatal_error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
br label %62
62: ; preds = %60, %55
br i1 %46, label %63, label %81
63: ; preds = %62, %63
%64 = phi i64 [ %74, %63 ], [ 0, %62 ]
%65 = load i8*, i8** %39
%66 = getelementptr inbounds i8, i8* %65, i64 %64
%67 = load i8, i8* %66
%68 = getelementptr inbounds i8, i8* %58, i64 %64
store i8 %67, i8* %68
%69 = or i64 %64, 1
%70 = load i8*, i8** %39
%71 = getelementptr inbounds i8, i8* %70, i64 %69
%72 = load i8, i8* %71
%73 = getelementptr inbounds i8, i8* %58, i64 %69
store i8 %72, i8* %73
%74 = add nuw nsw i64 %64, 2
%75 = icmp eq i64 %74, 34
br i1 %75, label %76, label %63
76: ; preds = %63
%77 = trunc i32 %11 to i8
%78 = getelementptr inbounds i8, i8* %58, i64 34
store i8 %77, i8* %78
%79 = trunc i32 %18 to i8
%80 = getelementptr inbounds i8, i8* %58, i64 35
store i8 %79, i8* %80
br label %215
81: ; preds = %62
switch i32 %23, label %215 [
i32 8, label %82
i32 11, label %136
]
82: ; preds = %81, %82
%83 = phi i64 [ %93, %82 ], [ 0, %81 ]
%84 = load i8*, i8** %39
%85 = getelementptr inbounds i8, i8* %84, i64 %83
%86 = load i8, i8* %85
%87 = getelementptr inbounds i8, i8* %58, i64 %83
store i8 %86, i8* %87
%88 = or i64 %83, 1
%89 = load i8*, i8** %39
%90 = getelementptr inbounds i8, i8* %89, i64 %88
%91 = load i8, i8* %90
%92 = getelementptr inbounds i8, i8* %58, i64 %88
store i8 %91, i8* %92
%93 = add nuw nsw i64 %83, 2
%94 = icmp eq i64 %93, 34
br i1 %94, label %95, label %82
95: ; preds = %82
%96 = trunc i32 %11 to i8
%97 = getelementptr inbounds i8, i8* %58, i64 34
store i8 %96, i8* %97
%98 = trunc i32 %18 to i8
%99 = getelementptr inbounds i8, i8* %58, i64 35
store i8 %98, i8* %99
%100 = icmp sgt i32 %56, 36
br i1 %100, label %101, label %215
101: ; preds = %95
%102 = zext i32 %56 to i64
%103 = add nsw i64 %102, -37
%104 = and i64 %102, 3
%105 = icmp ult i64 %103, 3
br i1 %105, label %188, label %106
106: ; preds = %101
%107 = add nsw i64 %102, -36
%108 = and i64 %107, -4
br label %109
109: ; preds = %109, %106
%110 = phi i64 [ 36, %106 ], [ %133, %109 ]
%111 = phi i64 [ 0, %106 ], [ %134, %109 ]
%112 = load i8*, i8** %39
%113 = add nsw i64 %110, -2
%114 = getelementptr inbounds i8, i8* %112, i64 %113
%115 = load i8, i8* %114
%116 = getelementptr inbounds i8, i8* %58, i64 %110
store i8 %115, i8* %116
%117 = or i64 %110, 1
%118 = load i8*, i8** %39
%119 = add nsw i64 %110, -1
%120 = getelementptr inbounds i8, i8* %118, i64 %119
%121 = load i8, i8* %120
%122 = getelementptr inbounds i8, i8* %58, i64 %117
store i8 %121, i8* %122
%123 = or i64 %110, 2
%124 = load i8*, i8** %39
%125 = getelementptr inbounds i8, i8* %124, i64 %110
%126 = load i8, i8* %125
%127 = getelementptr inbounds i8, i8* %58, i64 %123
store i8 %126, i8* %127
%128 = or i64 %110, 3
%129 = load i8*, i8** %39
%130 = getelementptr inbounds i8, i8* %129, i64 %117
%131 = load i8, i8* %130
%132 = getelementptr inbounds i8, i8* %58, i64 %128
store i8 %131, i8* %132
%133 = add nuw nsw i64 %110, 4
%134 = add i64 %111, 4
%135 = icmp eq i64 %134, %108
br i1 %135, label %188, label %109
136: ; preds = %81, %136
%137 = phi i64 [ %147, %136 ], [ 0, %81 ]
%138 = load i8*, i8** %39
%139 = getelementptr inbounds i8, i8* %138, i64 %137
%140 = load i8, i8* %139
%141 = getelementptr inbounds i8, i8* %58, i64 %137
store i8 %140, i8* %141
%142 = or i64 %137, 1
%143 = load i8*, i8** %39
%144 = getelementptr inbounds i8, i8* %143, i64 %142
%145 = load i8, i8* %144
%146 = getelementptr inbounds i8, i8* %58, i64 %142
store i8 %145, i8* %146
%147 = add nuw nsw i64 %137, 2
%148 = icmp eq i64 %147, 34
br i1 %148, label %149, label %136
149: ; preds = %136
%150 = trunc i32 %11 to i8
%151 = getelementptr inbounds i8, i8* %58, i64 34
store i8 %150, i8* %151
%152 = trunc i32 %18 to i8
%153 = getelementptr inbounds i8, i8* %58, i64 35
store i8 %152, i8* %153
%154 = icmp sgt i32 %56, 36
br i1 %154, label %155, label %215
155: ; preds = %149
%156 = zext i32 %56 to i64
%157 = add nsw i64 %156, -37
%158 = and i64 %156, 3
%159 = icmp ult i64 %157, 3
br i1 %159, label %202, label %160
160: ; preds = %155
%161 = add nsw i64 %156, -36
%162 = and i64 %161, -4
br label %163
163: ; preds = %163, %160
%164 = phi i64 [ 36, %160 ], [ %182, %163 ]
%165 = phi i64 [ 0, %160 ], [ %186, %163 ]
%166 = load i8*, i8** %39
%167 = or i64 %164, 1
%168 = getelementptr inbounds i8, i8* %166, i64 %167
%169 = load i8, i8* %168
%170 = getelementptr inbounds i8, i8* %58, i64 %164
store i8 %169, i8* %170
%171 = load i8*, i8** %39
%172 = or i64 %164, 2
%173 = getelementptr inbounds i8, i8* %171, i64 %172
%174 = load i8, i8* %173
%175 = getelementptr inbounds i8, i8* %58, i64 %167
store i8 %174, i8* %175
%176 = load i8*, i8** %39
%177 = or i64 %164, 3
%178 = getelementptr inbounds i8, i8* %176, i64 %177
%179 = load i8, i8* %178
%180 = getelementptr inbounds i8, i8* %58, i64 %172
store i8 %179, i8* %180
%181 = load i8*, i8** %39
%182 = add nuw nsw i64 %164, 4
%183 = getelementptr inbounds i8, i8* %181, i64 %182
%184 = load i8, i8* %183
%185 = getelementptr inbounds i8, i8* %58, i64 %177
store i8 %184, i8* %185
%186 = add i64 %165, 4
%187 = icmp eq i64 %186, %162
br i1 %187, label %202, label %163
188: ; preds = %109, %101
%189 = phi i64 [ 36, %101 ], [ %133, %109 ]
%190 = icmp eq i64 %104, 0
br i1 %190, label %215, label %191
191: ; preds = %188, %191
%192 = phi i64 [ %199, %191 ], [ %189, %188 ]
%193 = phi i64 [ %200, %191 ], [ 0, %188 ]
%194 = load i8*, i8** %39
%195 = add nsw i64 %192, -2
%196 = getelementptr inbounds i8, i8* %194, i64 %195
%197 = load i8, i8* %196
%198 = getelementptr inbounds i8, i8* %58, i64 %192
store i8 %197, i8* %198
%199 = add nuw nsw i64 %192, 1
%200 = add i64 %193, 1
%201 = icmp eq i64 %200, %104
br i1 %201, label %215, label %191
202: ; preds = %163, %155
%203 = phi i64 [ 36, %155 ], [ %182, %163 ]
%204 = icmp eq i64 %158, 0
br i1 %204, label %215, label %205
205: ; preds = %202, %205
%206 = phi i64 [ %209, %205 ], [ %203, %202 ]
%207 = phi i64 [ %213, %205 ], [ 0, %202 ]
%208 = load i8*, i8** %39
%209 = add nuw nsw i64 %206, 1
%210 = getelementptr inbounds i8, i8* %208, i64 %209
%211 = load i8, i8* %210
%212 = getelementptr inbounds i8, i8* %58, i64 %206
store i8 %211, i8* %212
%213 = add i64 %207, 1
%214 = icmp eq i64 %213, %158
br i1 %214, label %215, label %205
215: ; preds = %202, %205, %188, %191, %149, %95, %81, %76
%216 = tail call i32 @uint_char(i32 %56, i8* %58)
%217 = getelementptr inbounds i8, i8* %58, i64 7
store i8 0, i8* %217
%218 = icmp sgt i32 %23, 7
%219 = select i1 %218, i8 12, i8 2
%220 = getelementptr inbounds i8, i8* %58, i64 8
store i8 %219, i8* %220
%221 = tail call i32 @update_sec4(i8** %1, i8* %58)
%222 = tail call i32 @free(i8* %58)
br label %223
223: ; preds = %31, %33, %8, %215, %52
ret i32 0
}