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

/* Variables and functions */
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int sscanf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
FILE *find_TSVL(FILE *fpin, char seek_step[20], char seek_var[10],
                char seek_vlevel[10]) {
  int i, found_vlevel;
  char inStr[255], cur_step[20], cur_vlevel[10], cur_var[10], dummy[80];
  fpos_t the_pos;
  rewind(fpin);
  fgetpos(fpin, &the_pos);
  do {
    fsetpos(fpin, &the_pos);
    for (i = 1; i <= 5; i++)
      if (fgets(inStr, 255, fpin) == NULL)
        goto err;
    if (fscanf(fpin, "PPF subfile %s ", cur_step) != 1)
      goto err;
    if (fscanf(fpin, "VARIABLE %s ", cur_var) != 1)
      goto err;
    if (fscanf(fpin, "PSLEVEL %s ", cur_vlevel) != 1)
      goto err;
    if ((strcmp(seek_vlevel, "0.9910") == 0) ||
        (strcmp(seek_vlevel, "1013.0000") == 0) ||
        (strcmp(seek_vlevel, "Surface") == 0))
      if ((strcmp(cur_vlevel, "0.9910") == 0) ||
          (strcmp(cur_vlevel, "1013.0000") == 0) ||
          (strcmp(cur_vlevel, "Surface") == 0))
        found_vlevel = 1;
      else
        found_vlevel = 0;
    else
      found_vlevel = (strcmp(seek_vlevel, cur_vlevel) == 0) ? 1 : 0;
    if ((!found_vlevel) || (strcmp(seek_var, cur_var) != 0) ||
        (strcmp(seek_step, cur_step) != 0)) {
      do {
        fgetpos(fpin, &the_pos);
        if (fgets(inStr, 255, fpin) == NULL)
          goto err;
      } while (sscanf(inStr, "TITLE(1) %s", dummy) != 1);
    }
  } while ((!found_vlevel) || (strcmp(seek_var, cur_var) != 0) ||
           (strcmp(seek_step, cur_step) != 0));
  fsetpos(fpin, &the_pos);
  return fpin;
err:
  printf("error finding timestep [%s] variable [%s] level [%s]\n", seek_step,
         seek_var, seek_vlevel);
  return NULL;
}


x86 assembly (clang, -O0):
<find_TSVL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1c4(%rbp),%rsi
call   1040 <fgetpos@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1c4(%rbp),%rsi
call   10a0 <fsetpos@plt>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jg     120c <find_TSVL+0x8c>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xff,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    11f9 <find_TSVL+0x79>
jmp    1484 <find_TSVL+0x304>
jmp    11fe <find_TSVL+0x7e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11cb <find_TSVL+0x4b>
mov    -0x10(%rbp),%rdi
lea    -0x150(%rbp),%rdx
lea    0xde2(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     1231 <find_TSVL+0xb1>
jmp    1484 <find_TSVL+0x304>
mov    -0x10(%rbp),%rdi
lea    -0x164(%rbp),%rdx
lea    0xdcd(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     1256 <find_TSVL+0xd6>
jmp    1484 <find_TSVL+0x304>
mov    -0x10(%rbp),%rdi
lea    -0x15a(%rbp),%rdx
lea    0xdb5(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     127b <find_TSVL+0xfb>
jmp    1484 <find_TSVL+0x304>
mov    -0x28(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     12c9 <find_TSVL+0x149>
mov    -0x28(%rbp),%rdi
lea    0xd90(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     12c9 <find_TSVL+0x149>
mov    -0x28(%rbp),%rdi
lea    0xd80(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1338 <find_TSVL+0x1b8>
lea    -0x15a(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1320 <find_TSVL+0x1a0>
lea    -0x15a(%rbp),%rdi
lea    0xd3c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1320 <find_TSVL+0x1a0>
lea    -0x15a(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    132c <find_TSVL+0x1ac>
movl   $0x1,-0x30(%rbp)
jmp    1333 <find_TSVL+0x1b3>
movl   $0x0,-0x30(%rbp)
jmp    135c <find_TSVL+0x1dc>
mov    -0x28(%rbp),%rdi
lea    -0x15a(%rbp),%rsi
call   1080 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     139a <find_TSVL+0x21a>
mov    -0x20(%rbp),%rdi
lea    -0x164(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    139a <find_TSVL+0x21a>
mov    -0x18(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1400 <find_TSVL+0x280>
jmp    139f <find_TSVL+0x21f>
mov    -0x10(%rbp),%rdi
lea    -0x1c4(%rbp),%rsi
call   1040 <fgetpos@plt>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xff,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    13d3 <find_TSVL+0x253>
jmp    1484 <find_TSVL+0x304>
jmp    13d8 <find_TSVL+0x258>
lea    -0x130(%rbp),%rdi
lea    -0x1c0(%rbp),%rdx
lea    0xc55(%rip),%rsi
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    139f <find_TSVL+0x21f>
jmp    1400 <find_TSVL+0x280>
jmp    1405 <find_TSVL+0x285>
mov    $0x1,%al
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0x1c5(%rbp)
je     1459 <find_TSVL+0x2d9>
mov    -0x20(%rbp),%rdi
lea    -0x164(%rbp),%rsi
call   1080 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1c5(%rbp)
jne    1459 <find_TSVL+0x2d9>
mov    -0x18(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1c5(%rbp)
mov    -0x1c5(%rbp),%al
test   $0x1,%al
jne    11b4 <find_TSVL+0x34>
mov    -0x10(%rbp),%rdi
lea    -0x1c4(%rbp),%rsi
call   10a0 <fsetpos@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <find_TSVL+0x324>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xbb7(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_TSVL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %rcx,0x28(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
call   1050 <rewind@plt>
lea    0x4(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <fgetpos@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <fsetpos@plt>
lea    0xb0(%rsp),%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
lea    0xb0(%rsp),%r13
lea    0x4(%rsp),%r14
lea    0xe4d(%rip),%r12
lea    0x60(%rsp),%r15
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
mov    %rbx,%rdi
lea    0xd98(%rip),%rsi
lea    0x40(%rsp),%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    13f4 <find_TSVL+0x274>
mov    %rbx,%rdi
lea    0xd8b(%rip),%rsi
lea    0x36(%rsp),%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    13f4 <find_TSVL+0x274>
mov    %rbx,%rdi
lea    0xd7b(%rip),%rsi
lea    0x1e(%rsp),%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    13f4 <find_TSVL+0x274>
mov    0x28(%rsp),%rbp
mov    %rbp,%rdi
lea    0xd65(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1300 <find_TSVL+0x180>
mov    %rbp,%rdi
lea    0xd58(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1300 <find_TSVL+0x180>
mov    %rbp,%rdi
lea    0xd4e(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1300 <find_TSVL+0x180>
mov    %rbp,%rdi
lea    0x1e(%rsp),%rsi
jmp    1338 <find_TSVL+0x1b8>
lea    0x1e(%rsp),%rdi
lea    0xd1d(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1345 <find_TSVL+0x1c5>
lea    0x1e(%rsp),%rdi
lea    0xd0e(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1345 <find_TSVL+0x1c5>
lea    0x1e(%rsp),%rdi
lea    0xd02(%rip),%rsi
call   1080 <strcmp@plt>
mov    $0x1,%bpl
test   %rax,%rax
jne    1370 <find_TSVL+0x1f0>
mov    0x10(%rsp),%rdi
lea    0x36(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    136d <find_TSVL+0x1ed>
mov    0x8(%rsp),%rdi
lea    0x40(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     13a8 <find_TSVL+0x228>
xor    %ebp,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fgetpos@plt>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13f4 <find_TSVL+0x274>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1370 <find_TSVL+0x1f0>
test   %bpl,%bpl
jne    13d0 <find_TSVL+0x250>
mov    0x10(%rsp),%rdi
lea    0x36(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    13d0 <find_TSVL+0x250>
mov    0x8(%rsp),%rdi
lea    0x40(%rsp),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1426 <find_TSVL+0x2a6>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <fsetpos@plt>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    11fa <find_TSVL+0x7a>
lea    0xc53(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x28(%rsp),%rcx
call   1030 <printf@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   10a0 <fsetpos@plt>
jmp    1411 <find_TSVL+0x291>

LLVM IR (-O0):
@.str = [16 x i8] c"PPF subfile %s \00"
@.str.1 = [13 x i8] c"VARIABLE %s \00"
@.str.2 = [12 x i8] c"PSLEVEL %s \00"
@.str.3 = [7 x i8] c"0.9910\00"
@.str.4 = [10 x i8] c"1013.0000\00"
@.str.5 = [8 x i8] c"Surface\00"
@.str.6 = [12 x i8] c"TITLE(1) %s\00"
@.str.7 = [54 x i8] c"error finding timestep [%s] variable [%s] level [%s]\0A\00"
define i32* @find_TSVL(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca [255 x i8]
%13 = alloca [20 x i8]
%14 = alloca [10 x i8]
%15 = alloca [10 x i8]
%16 = alloca [80 x i8]
%17 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%18 = load i32*, i32** %6
%19 = call i32 @rewind(i32* %18)
%20 = load i32*, i32** %6
%21 = call i32 @fgetpos(i32* %20, i32* %17)
br label %22
22: ; preds = %133, %4
%23 = load i32*, i32** %6
%24 = call i32 @fsetpos(i32* %23, i32* %17)
store i32 1, i32* %10
br label %25
25: ; preds = %35, %22
%26 = load i32, i32* %10
%27 = icmp sle i32 %26, 5
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%30 = load i32*, i32** %6
%31 = call i32* @fgets(i8* %29, i32 255, i32* %30)
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %34
33: ; preds = %28
br label %139
34: ; preds = %28
br label %35
35: ; preds = %34
%36 = load i32, i32* %10
%37 = add nsw i32 %36, 1
store i32 %37, i32* %10
br label %25
38: ; preds = %25
%39 = load i32*, i32** %6
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%41 = call i32 @fscanf(i32* %39, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = icmp ne i32 %41, 1
br i1 %42, label %43, label %44
43: ; preds = %38
br label %139
44: ; preds = %38
%45 = load i32*, i32** %6
%46 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%47 = call i32 @fscanf(i32* %45, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %46)
%48 = icmp ne i32 %47, 1
br i1 %48, label %49, label %50
49: ; preds = %44
br label %139
50: ; preds = %44
%51 = load i32*, i32** %6
%52 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%53 = call i32 @fscanf(i32* %51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %52)
%54 = icmp ne i32 %53, 1
br i1 %54, label %55, label %56
55: ; preds = %50
br label %139
56: ; preds = %50
%57 = load i8*, i8** %9
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %68, label %60
60: ; preds = %56
%61 = load i8*, i8** %9
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %68, label %64
64: ; preds = %60
%65 = load i8*, i8** %9
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %83
68: ; preds = %64, %60, %56
%69 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %80, label %72
72: ; preds = %68
%73 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %76, %72, %68
store i32 1, i32* %11
br label %82
81: ; preds = %76
store i32 0, i32* %11
br label %82
82: ; preds = %81, %80
br label %90
83: ; preds = %64
%84 = load i8*, i8** %9
%85 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%86 = call i64 @strcmp(i8* %84, i8* %85)
%87 = icmp eq i64 %86, 0
%88 = zext i1 %87 to i64
%89 = select i1 %87, i32 1, i32 0
store i32 %89, i32* %11
br label %90
90: ; preds = %83, %82
%91 = load i32, i32* %11
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %103
93: ; preds = %90
%94 = load i8*, i8** %8
%95 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%96 = call i64 @strcmp(i8* %94, i8* %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %103, label %98
98: ; preds = %93
%99 = load i8*, i8** %7
%100 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%101 = call i64 @strcmp(i8* %99, i8* %100)
%102 = icmp ne i64 %101, 0
br i1 %102, label %103, label %119
103: ; preds = %98, %93, %90
br label %104
104: ; preds = %113, %103
%105 = load i32*, i32** %6
%106 = call i32 @fgetpos(i32* %105, i32* %17)
%107 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%108 = load i32*, i32** %6
%109 = call i32* @fgets(i8* %107, i32 255, i32* %108)
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %112
111: ; preds = %104
br label %139
112: ; preds = %104
br label %113
113: ; preds = %112
%114 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%115 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%116 = call i32 @sscanf(i8* %114, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %115)
%117 = icmp ne i32 %116, 1
br i1 %117, label %104, label %118
118: ; preds = %113
br label %119
119: ; preds = %118, %98
br label %120
120: ; preds = %119
%121 = load i32, i32* %11
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %133
123: ; preds = %120
%124 = load i8*, i8** %8
%125 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%126 = call i64 @strcmp(i8* %124, i8* %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %133, label %128
128: ; preds = %123
%129 = load i8*, i8** %7
%130 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%131 = call i64 @strcmp(i8* %129, i8* %130)
%132 = icmp ne i64 %131, 0
br label %133
133: ; preds = %128, %123, %120
%134 = phi i1 [ true, %123 ], [ true, %120 ], [ %132, %128 ]
br i1 %134, label %22, label %135
135: ; preds = %133
%136 = load i32*, i32** %6
%137 = call i32 @fsetpos(i32* %136, i32* %17)
%138 = load i32*, i32** %6
store i32* %138, i32** %5
br label %144
139: ; preds = %111, %55, %49, %43, %33
%140 = load i8*, i8** %7
%141 = load i8*, i8** %8
%142 = load i8*, i8** %9
%143 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %140, i8* %141, i8* %142)
store i32* null, i32** %5
br label %144
144: ; preds = %139, %135
%145 = load i32*, i32** %5
ret i32* %145
}

LLVM IR (-O2):
@.str = [16 x i8] c"PPF subfile %s \00"
@.str.1 = [13 x i8] c"VARIABLE %s \00"
@.str.2 = [12 x i8] c"PSLEVEL %s \00"
@.str.3 = [7 x i8] c"0.9910\00"
@.str.4 = [10 x i8] c"1013.0000\00"
@.str.5 = [8 x i8] c"Surface\00"
@.str.6 = [12 x i8] c"TITLE(1) %s\00"
@.str.7 = [54 x i8] c"error finding timestep [%s] variable [%s] level [%s]\0A\00"
define i32* @find_TSVL(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [255 x i8]
%6 = alloca [20 x i8]
%7 = alloca [10 x i8]
%8 = alloca [10 x i8]
%9 = alloca [80 x i8]
%10 = alloca i32
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%16 = bitcast i32* %10 to i8*
%17 = tail call i32 @rewind(i32* %0)
%18 = call i32 @fgetpos(i32* %0, i32* %10)
%19 = call i32 @fsetpos(i32* %0, i32* %10)
%20 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%21 = icmp eq i32* %20, null
br i1 %21, label %92, label %22
22: ; preds = %4, %86
%23 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%24 = icmp eq i32* %23, null
br i1 %24, label %92, label %25
25: ; preds = %22
%26 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%27 = icmp eq i32* %26, null
br i1 %27, label %92, label %28
28: ; preds = %25
%29 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%30 = icmp eq i32* %29, null
br i1 %30, label %92, label %31
31: ; preds = %28
%32 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%33 = icmp eq i32* %32, null
br i1 %33, label %92, label %34
34: ; preds = %31
%35 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %12)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %92
37: ; preds = %34
%38 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %92
40: ; preds = %37
%41 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %92
43: ; preds = %40
%44 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %52, label %46
46: ; preds = %43
%47 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %61
52: ; preds = %49, %46, %43
%53 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %64, label %55
55: ; preds = %52
%56 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %64, label %58
58: ; preds = %55
%59 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %64, label %70
61: ; preds = %49
%62 = call i64 @strcmp(i8* %3, i8* %13)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %58, %52, %55, %61
%65 = call i64 @strcmp(i8* %2, i8* %14)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = call i64 @strcmp(i8* %1, i8* %12)
%69 = icmp eq i64 %68, 0
br i1 %69, label %80, label %70
70: ; preds = %58, %67, %64, %61
%71 = phi i1 [ false, %67 ], [ false, %64 ], [ true, %61 ], [ true, %58 ]
br label %72
72: ; preds = %76, %70
%73 = call i32 @fgetpos(i32* %0, i32* %10)
%74 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%75 = icmp eq i32* %74, null
br i1 %75, label %92, label %76
76: ; preds = %72
%77 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %15)
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %72
79: ; preds = %76
br i1 %71, label %86, label %80
80: ; preds = %67, %79
%81 = call i64 @strcmp(i8* %2, i8* %14)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = call i64 @strcmp(i8* %1, i8* %12)
%85 = icmp eq i64 %84, 0
br i1 %85, label %90, label %86
86: ; preds = %83, %80, %79
%87 = call i32 @fsetpos(i32* %0, i32* %10)
%88 = call i32* @fgets(i8* %11, i32 255, i32* %0)
%89 = icmp eq i32* %88, null
br i1 %89, label %92, label %22
90: ; preds = %83
%91 = call i32 @fsetpos(i32* %0, i32* %10)
br label %94
92: ; preds = %31, %28, %25, %22, %86, %34, %37, %40, %72, %4
%93 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
br label %94
94: ; preds = %92, %90
%95 = phi i32* [ null, %92 ], [ %0, %90 ]
ret i32* %95
}