#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *find_TSVL(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int extract2(FILE *fpin, FILE *fpout, int NumVars, int NumLev, int NumTimes,
             int Nl[], int Nr, int Nc, char VarName[][10], char LevName[][10],
             char TStepName[][20], int east_bound, int west_bound,
             int north_bound, int south_bound, int flag_i) {
  int it, iv, ir, ic, il, skip, val_cnt;
  float val;
  char inStr[255];
  rewind(fpin);
  for (it = 0; it < NumTimes; it++) {
    for (iv = 0; iv < NumVars; iv++) {
      for (il = 0; il < Nl[iv]; il++) {
        if (flag_i == 1)
          printf("[%s][%s][%s]\n", TStepName[it], VarName[iv], LevName[il]);
        fpin = find_TSVL(fpin, TStepName[it], VarName[iv], LevName[il]);
        if (fpin == NULL)
          goto err;
        for (skip = 1; skip <= 14; skip++) {
          fgets(inStr, 255, fpin);
          fprintf(fpout, "%s", inStr);
        }
        val_cnt = 0;
        for (ir = 1; ir <= Nr; ir++) {
          for (ic = 1; ic <= Nc; ic++) {
            fscanf(fpin, " %f", &val);
            if ((ir <= south_bound) && (ir >= north_bound) &&
                (ic >= west_bound) && (ic <= east_bound)) {
              val_cnt++;
              if (val_cnt >= 8) {
                fprintf(fpout, "%.6e\n", val);
                val_cnt = 0;
              } else
                fprintf(fpout, "%.6e ", val);
            }
          }
        }
        if (val_cnt != 0) {
          fprintf(fpout, "\n");
          val_cnt = 0;
        }
      }
    }
  }
  return 0;
err:
  return -1;
}


x86 assembly (clang, -O0):
<extract2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rewind@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1413 <extract2+0x2b3>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1400 <extract2+0x2a0>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x30(%rbp),%rcx
movslq -0x38(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    13ed <extract2+0x28d>
cmpl   $0x1,0x58(%rbp)
jne    122f <extract2+0xcf>
mov    0x30(%rbp),%rsi
movslq -0x34(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
mov    0x20(%rbp),%rdx
movslq -0x38(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    0x28(%rbp),%rcx
movslq -0x44(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rcx
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x30(%rbp),%rsi
movslq -0x34(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
mov    0x20(%rbp),%rdx
movslq -0x38(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    0x28(%rbp),%rcx
movslq -0x44(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rcx
call   1080 <find_TSVL@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1279 <extract2+0x119>
jmp    141f <extract2+0x2bf>
movl   $0x1,-0x48(%rbp)
cmpl   $0xe,-0x48(%rbp)
jg     12c6 <extract2+0x166>
lea    -0x150(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xff,%esi
call   1060 <fgets@plt>
mov    -0x18(%rbp),%rdi
lea    -0x150(%rbp),%rdx
lea    0xd5d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1280 <extract2+0x120>
movl   $0x0,-0x4c(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    0x10(%rbp),%eax
jg     13b7 <extract2+0x257>
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x18(%rbp),%eax
jg     13a4 <extract2+0x244>
mov    -0x10(%rbp),%rdi
lea    0xd13(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0x3c(%rbp),%eax
cmp    0x50(%rbp),%eax
jg     1391 <extract2+0x231>
mov    -0x3c(%rbp),%eax
cmp    0x48(%rbp),%eax
jl     1391 <extract2+0x231>
mov    -0x40(%rbp),%eax
cmp    0x40(%rbp),%eax
jl     1391 <extract2+0x231>
mov    -0x40(%rbp),%eax
cmp    0x38(%rbp),%eax
jg     1391 <extract2+0x231>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x8,-0x4c(%rbp)
jl     1371 <extract2+0x211>
mov    -0x18(%rbp),%rdi
movss  -0x50(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb7(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4c(%rbp)
jmp    138c <extract2+0x22c>
mov    -0x18(%rbp),%rdi
movss  -0x50(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc96(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    1391 <extract2+0x231>
jmp    1396 <extract2+0x236>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12e7 <extract2+0x187>
jmp    13a9 <extract2+0x249>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12d4 <extract2+0x174>
cmpl   $0x0,-0x4c(%rbp)
je     13da <extract2+0x27a>
mov    -0x18(%rbp),%rdi
lea    0xc40(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4c(%rbp)
jmp    13df <extract2+0x27f>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11d8 <extract2+0x78>
jmp    13f2 <extract2+0x292>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11c5 <extract2+0x65>
jmp    1405 <extract2+0x2a5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b2 <extract2+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1426 <extract2+0x2c6>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %r9,0x10(%rsp)
mov    %r8d,%r14d
mov    %edx,%ebp
mov    %rsi,(%rsp)
mov    %rdi,%r13
call   1040 <rewind@plt>
test   %r14d,%r14d
jle    1598 <extract2+0x418>
mov    0x1d0(%rsp),%ebx
mov    0x1b8(%rsp),%r15
mov    0x1a8(%rsp),%eax
mov    %r14d,%ecx
mov    %rcx,0x20(%rsp)
mov    %ebp,%ecx
mov    %rcx,0x30(%rsp)
neg    %eax
mov    %rax,0x58(%rsp)
xor    %eax,%eax
mov    %ebp,0x8(%rsp)
test   %ebp,%ebp
mov    %rax,0x28(%rsp)
jle    1580 <extract2+0x400>
lea    (%rax,%rax,4),%rax
mov    0x1c0(%rsp),%rcx
lea    (%rcx,%rax,4),%r12
xor    %r14d,%r14d
mov    %r12,0x38(%rsp)
jmp    121f <extract2+0x9f>
nopl   0x0(%rax)
add    $0x1,%r14
cmp    0x30(%rsp),%r14
je     1580 <extract2+0x400>
mov    0x10(%rsp),%rax
cmpl   $0x0,(%rax,%r14,4)
jle    1210 <extract2+0x90>
lea    (%r14,%r14,4),%rax
mov    0x1b0(%rsp),%rcx
lea    (%rcx,%rax,2),%rax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
mov    %r14,0x40(%rsp)
jmp    126c <extract2+0xec>
nopl   0x0(%rax)
mov    0x48(%rsp),%rbp
add    $0x1,%rbp
mov    0x10(%rsp),%rax
mov    0x40(%rsp),%r14
movslq (%rax,%r14,4),%rax
cmp    %rax,%rbp
jge    1210 <extract2+0x90>
cmpl   $0x1,0x1e8(%rsp)
01
jne    1299 <extract2+0x119>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%r15,%rax,2),%rcx
lea    0xd74(%rip),%rdi
mov    %r12,%rsi
mov    0x18(%rsp),%rdx
call   1030 <printf@plt>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%r15,%rax,2),%rcx
mov    %r13,%rdi
mov    %r12,%rsi
mov    0x18(%rsp),%rdx
call   10a0 <find_TSVL@plt>
test   %rax,%rax
je     159c <extract2+0x41c>
mov    %rax,%r13
mov    %rbp,0x48(%rsp)
lea    0x60(%rsp),%r14
mov    %r14,%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    (%rsp),%rbp
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    %r14,%rdi
mov    $0xff,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <fputs@plt>
cmpl   $0x0,0x1a0(%rsp)
jle    1250 <extract2+0xd0>
mov    $0x1,%ecx
xor    %ebp,%ebp
jmp    1487 <extract2+0x307>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x50(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x1a0(%rsp),%ecx
mov    %eax,%ecx
je     1550 <extract2+0x3d0>
cmpl   $0x0,0x1a8(%rsp)
mov    %rcx,0x50(%rsp)
jle    1470 <extract2+0x2f0>
cmp    0x1e0(%rsp),%ecx
setg   %al
cmp    0x1d8(%rsp),%ecx
setl   %r14b
or     %al,%r14b
mov    $0x1,%r12d
jmp    14d9 <extract2+0x359>
cs nopw 0x0(%rax,%rax,1)
mov    0x58(%rsp),%rax
add    %r12d,%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,%r12d
cmp    $0x1,%eax
je     1470 <extract2+0x2f0>
mov    %r13,%rdi
lea    0xb2b(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1060 <fscanf@plt>
cmp    %ebx,%r12d
setl   %al
or     %r14b,%al
jne    14c0 <extract2+0x340>
cmp    0x1c8(%rsp),%r12d
jg     14c0 <extract2+0x340>
mov    %r13,%r15
lea    0x1(%rbp),%r13d
cmp    $0x7,%ebp
lea    0xb05(%rip),%rsi
lea    0xaf8(%rip),%rax
cmovge %rax,%rsi
movss  0xc(%rsp),%xmm0
mov    $0x0,%eax
cmovge %eax,%r13d
cvtss2sd %xmm0,%xmm0
mov    (%rsp),%rdi
mov    $0x1,%al
call   1090 <fprintf@plt>
mov    %r13d,%ebp
mov    %r15,%r13
jmp    14c0 <extract2+0x340>
nopw   0x0(%rax,%rax,1)
test   %ebp,%ebp
mov    0x1b8(%rsp),%r15
mov    0x38(%rsp),%r12
je     1250 <extract2+0xd0>
mov    $0xa,%edi
mov    (%rsp),%rsi
call   1070 <fputc@plt>
jmp    1250 <extract2+0xd0>
nopl   0x0(%rax,%rax,1)
mov    0x28(%rsp),%rax
add    $0x1,%rax
cmp    0x20(%rsp),%rax
mov    0x8(%rsp),%ebp
jne    11e2 <extract2+0x62>
xor    %eax,%eax
jmp    15a1 <extract2+0x421>
mov    $0xffffffff,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"[%s][%s][%s]\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c" %f\00"
@.str.3 = [6 x i8] c"%.6e\0A\00"
@.str.4 = [6 x i8] c"%.6e \00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @extract2(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32* %5, i32 %6, i32 %7, [10 x i8]* %8, [10 x i8]* %9, [20 x i8]* %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15) {
%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 [10 x i8]*
%27 = alloca [10 x i8]*
%28 = alloca [20 x i8]*
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
%41 = alloca float
%42 = alloca [255 x i8]
store i32* %0, i32** %18
store i32* %1, i32** %19
store i32 %2, i32* %20
store i32 %3, i32* %21
store i32 %4, i32* %22
store i32* %5, i32** %23
store i32 %6, i32* %24
store i32 %7, i32* %25
store [10 x i8]* %8, [10 x i8]** %26
store [10 x i8]* %9, [10 x i8]** %27
store [20 x i8]* %10, [20 x i8]** %28
store i32 %11, i32* %29
store i32 %12, i32* %30
store i32 %13, i32* %31
store i32 %14, i32* %32
store i32 %15, i32* %33
%43 = load i32*, i32** %18
%44 = call i32 @rewind(i32* %43)
store i32 0, i32* %34
br label %45
45: ; preds = %185, %16
%46 = load i32, i32* %34
%47 = load i32, i32* %22
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %188
49: ; preds = %45
store i32 0, i32* %35
br label %50
50: ; preds = %181, %49
%51 = load i32, i32* %35
%52 = load i32, i32* %20
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %184
54: ; preds = %50
store i32 0, i32* %38
br label %55
55: ; preds = %177, %54
%56 = load i32, i32* %38
%57 = load i32*, i32** %23
%58 = load i32, i32* %35
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = icmp slt i32 %56, %61
br i1 %62, label %63, label %180
63: ; preds = %55
%64 = load i32, i32* %33
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %83
66: ; preds = %63
%67 = load [20 x i8]*, [20 x i8]** %28
%68 = load i32, i32* %34
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %67, i64 %69
%71 = getelementptr inbounds [20 x i8], [20 x i8]* %70, i64 0, i64 0
%72 = load [10 x i8]*, [10 x i8]** %26
%73 = load i32, i32* %35
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [10 x i8], [10 x i8]* %72, i64 %74
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %75, i64 0, i64 0
%77 = load [10 x i8]*, [10 x i8]** %27
%78 = load i32, i32* %38
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %77, i64 %79
%81 = getelementptr inbounds [10 x i8], [10 x i8]* %80, i64 0, i64 0
%82 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %71, i8* %76, i8* %81)
br label %83
83: ; preds = %66, %63
%84 = load i32*, i32** %18
%85 = load [20 x i8]*, [20 x i8]** %28
%86 = load i32, i32* %34
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %85, i64 %87
%89 = getelementptr inbounds [20 x i8], [20 x i8]* %88, i64 0, i64 0
%90 = load [10 x i8]*, [10 x i8]** %26
%91 = load i32, i32* %35
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %90, i64 %92
%94 = getelementptr inbounds [10 x i8], [10 x i8]* %93, i64 0, i64 0
%95 = load [10 x i8]*, [10 x i8]** %27
%96 = load i32, i32* %38
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [10 x i8], [10 x i8]* %95, i64 %97
%99 = getelementptr inbounds [10 x i8], [10 x i8]* %98, i64 0, i64 0
%100 = call i32* @find_TSVL(i32* %84, i8* %89, i8* %94, i8* %99)
store i32* %100, i32** %18
%101 = load i32*, i32** %18
%102 = icmp eq i32* %101, null
br i1 %102, label %103, label %104
103: ; preds = %83
br label %189
104: ; preds = %83
store i32 1, i32* %39
br label %105
105: ; preds = %115, %104
%106 = load i32, i32* %39
%107 = icmp sle i32 %106, 14
br i1 %107, label %108, label %118
108: ; preds = %105
%109 = getelementptr inbounds [255 x i8], [255 x i8]* %42, i64 0, i64 0
%110 = load i32*, i32** %18
%111 = call i32 @fgets(i8* %109, i32 255, i32* %110)
%112 = load i32*, i32** %19
%113 = getelementptr inbounds [255 x i8], [255 x i8]* %42, i64 0, i64 0
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %108
%116 = load i32, i32* %39
%117 = add nsw i32 %116, 1
store i32 %117, i32* %39
br label %105
118: ; preds = %105
store i32 0, i32* %40
store i32 1, i32* %36
br label %119
119: ; preds = %167, %118
%120 = load i32, i32* %36
%121 = load i32, i32* %24
%122 = icmp sle i32 %120, %121
br i1 %122, label %123, label %170
123: ; preds = %119
store i32 1, i32* %37
br label %124
124: ; preds = %163, %123
%125 = load i32, i32* %37
%126 = load i32, i32* %25
%127 = icmp sle i32 %125, %126
br i1 %127, label %128, label %166
128: ; preds = %124
%129 = load i32*, i32** %18
%130 = call i32 @fscanf(i32* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float* %41)
%131 = load i32, i32* %36
%132 = load i32, i32* %32
%133 = icmp sle i32 %131, %132
br i1 %133, label %134, label %162
134: ; preds = %128
%135 = load i32, i32* %36
%136 = load i32, i32* %31
%137 = icmp sge i32 %135, %136
br i1 %137, label %138, label %162
138: ; preds = %134
%139 = load i32, i32* %37
%140 = load i32, i32* %30
%141 = icmp sge i32 %139, %140
br i1 %141, label %142, label %162
142: ; preds = %138
%143 = load i32, i32* %37
%144 = load i32, i32* %29
%145 = icmp sle i32 %143, %144
br i1 %145, label %146, label %162
146: ; preds = %142
%147 = load i32, i32* %40
%148 = add nsw i32 %147, 1
store i32 %148, i32* %40
%149 = load i32, i32* %40
%150 = icmp sge i32 %149, 8
br i1 %150, label %151, label %156
151: ; preds = %146
%152 = load i32*, i32** %19
%153 = load float, float* %41
%154 = fpext float %153 to double
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %152, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %154)
store i32 0, i32* %40
br label %161
156: ; preds = %146
%157 = load i32*, i32** %19
%158 = load float, float* %41
%159 = fpext float %158 to double
%160 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %159)
br label %161
161: ; preds = %156, %151
br label %162
162: ; preds = %161, %142, %138, %134, %128
br label %163
163: ; preds = %162
%164 = load i32, i32* %37
%165 = add nsw i32 %164, 1
store i32 %165, i32* %37
br label %124
166: ; preds = %124
br label %167
167: ; preds = %166
%168 = load i32, i32* %36
%169 = add nsw i32 %168, 1
store i32 %169, i32* %36
br label %119
170: ; preds = %119
%171 = load i32, i32* %40
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %176
173: ; preds = %170
%174 = load i32*, i32** %19
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %40
br label %176
176: ; preds = %173, %170
br label %177
177: ; preds = %176
%178 = load i32, i32* %38
%179 = add nsw i32 %178, 1
store i32 %179, i32* %38
br label %55
180: ; preds = %55
br label %181
181: ; preds = %180
%182 = load i32, i32* %35
%183 = add nsw i32 %182, 1
store i32 %183, i32* %35
br label %50
184: ; preds = %50
br label %185
185: ; preds = %184
%186 = load i32, i32* %34
%187 = add nsw i32 %186, 1
store i32 %187, i32* %34
br label %45
188: ; preds = %45
store i32 0, i32* %17
br label %190
189: ; preds = %103
store i32 -1, i32* %17
br label %190
190: ; preds = %189, %188
%191 = load i32, i32* %17
ret i32 %191
}

LLVM IR (-O2):
@.str = [14 x i8] c"[%s][%s][%s]\0A\00"
@.str.2 = [4 x i8] c" %f\00"
@.str.3 = [6 x i8] c"%.6e\0A\00"
@.str.4 = [6 x i8] c"%.6e \00"
define i32 @extract2(i32* %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4, i32* nocapture %5, i32 %6, i32 %7, [10 x i8]* %8, [10 x i8]* %9, [20 x i8]* %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15) {
%17 = alloca float
%18 = alloca [255 x i8]
%19 = bitcast float* %17 to i8*
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %18, i64 0, i64 0
%21 = tail call i32 @rewind(i32* %0)
%22 = icmp sgt i32 %4, 0
br i1 %22, label %23, label %130
23: ; preds = %16
%24 = icmp sgt i32 %2, 0
%25 = icmp eq i32 %15, 1
%26 = icmp slt i32 %6, 1
%27 = icmp slt i32 %7, 1
%28 = zext i32 %4 to i64
%29 = zext i32 %2 to i64
br label %30
30: ; preds = %23, %126
%31 = phi i64 [ 0, %23 ], [ %128, %126 ]
%32 = phi i32* [ %0, %23 ], [ %127, %126 ]
br i1 %24, label %33, label %126
33: ; preds = %30
%34 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 %31, i64 0
br label %35
35: ; preds = %33, %122
%36 = phi i64 [ 0, %33 ], [ %124, %122 ]
%37 = phi i32* [ %32, %33 ], [ %123, %122 ]
%38 = getelementptr inbounds i32, i32* %5, i64 %36
%39 = load i32, i32* %38
%40 = icmp sgt i32 %39, 0
br i1 %40, label %41, label %122
41: ; preds = %35
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 %36, i64 0
br label %43
43: ; preds = %41, %117
%44 = phi i64 [ 0, %41 ], [ %118, %117 ]
%45 = phi i32* [ %37, %41 ], [ %51, %117 ]
br i1 %25, label %46, label %49
46: ; preds = %43
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 %44, i64 0
%48 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %34, i8* %42, i8* %47)
br label %49
49: ; preds = %46, %43
%50 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 %44, i64 0
%51 = call i32* @find_TSVL(i32* %45, i8* %34, i8* %42, i8* %50)
%52 = icmp eq i32* %51, null
br i1 %52, label %130, label %53
53: ; preds = %49
%54 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%55 = call i32 @fputs(i8* %20, i32* %1)
%56 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%57 = call i32 @fputs(i8* %20, i32* %1)
%58 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%59 = call i32 @fputs(i8* %20, i32* %1)
%60 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%61 = call i32 @fputs(i8* %20, i32* %1)
%62 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%63 = call i32 @fputs(i8* %20, i32* %1)
%64 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%65 = call i32 @fputs(i8* %20, i32* %1)
%66 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%67 = call i32 @fputs(i8* %20, i32* %1)
%68 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%69 = call i32 @fputs(i8* %20, i32* %1)
%70 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%71 = call i32 @fputs(i8* %20, i32* %1)
%72 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%73 = call i32 @fputs(i8* %20, i32* %1)
%74 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%75 = call i32 @fputs(i8* %20, i32* %1)
%76 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%77 = call i32 @fputs(i8* %20, i32* %1)
%78 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%79 = call i32 @fputs(i8* %20, i32* %1)
%80 = call i32 @fgets(i8* %20, i32 255, i32* %51)
%81 = call i32 @fputs(i8* %20, i32* %1)
br i1 %26, label %117, label %82
82: ; preds = %53, %109
%83 = phi i32 [ %110, %109 ], [ 0, %53 ]
%84 = phi i32 [ %111, %109 ], [ 1, %53 ]
br i1 %27, label %109, label %85
85: ; preds = %82
%86 = icmp sgt i32 %84, %14
%87 = icmp slt i32 %84, %13
%88 = or i1 %86, %87
br label %89
89: ; preds = %85, %105
%90 = phi i32 [ %83, %85 ], [ %106, %105 ]
%91 = phi i32 [ 1, %85 ], [ %107, %105 ]
%92 = call i32 @fscanf(i32* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float* %17)
%93 = icmp slt i32 %91, %12
%94 = select i1 %88, i1 true, i1 %93
%95 = icmp sgt i32 %91, %11
%96 = select i1 %94, i1 true, i1 %95
br i1 %96, label %105, label %97
97: ; preds = %89
%98 = icmp sgt i32 %90, 6
%99 = add nsw i32 %90, 1
%100 = load float, float* %17
%101 = select i1 %98, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%102 = select i1 %98, i32 0, i32 %99
%103 = fpext float %100 to double
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* %101, double %103)
br label %105
105: ; preds = %97, %89
%106 = phi i32 [ %90, %89 ], [ %102, %97 ]
%107 = add nuw i32 %91, 1
%108 = icmp eq i32 %91, %7
br i1 %108, label %109, label %89
109: ; preds = %105, %82
%110 = phi i32 [ %83, %82 ], [ %106, %105 ]
%111 = add nuw i32 %84, 1
%112 = icmp eq i32 %84, %6
br i1 %112, label %113, label %82
113: ; preds = %109
%114 = icmp eq i32 %110, 0
br i1 %114, label %117, label %115
115: ; preds = %113
%116 = call i32 @fputc(i32 10, i32* %1)
br label %117
117: ; preds = %53, %113, %115
%118 = add nuw nsw i64 %44, 1
%119 = load i32, i32* %38
%120 = sext i32 %119 to i64
%121 = icmp slt i64 %118, %120
br i1 %121, label %43, label %122
122: ; preds = %117, %35
%123 = phi i32* [ %37, %35 ], [ %51, %117 ]
%124 = add nuw nsw i64 %36, 1
%125 = icmp eq i64 %124, %29
br i1 %125, label %126, label %35
126: ; preds = %122, %30
%127 = phi i32* [ %32, %30 ], [ %123, %122 ]
%128 = add nuw nsw i64 %31, 1
%129 = icmp eq i64 %128, %28
br i1 %129, label %130, label %30
130: ; preds = %126, %49, %16
%131 = phi i32 [ 0, %16 ], [ -1, %49 ], [ 0, %126 ]
ret i32 %131
}