#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 *, ...);
int sscanf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
FILE *find_VL(FILE *fpin, char seek_var[10], char seek_vlevel[10],
              char check_step[20]) {
  int i, found_vlevel;
  char inStr[255], cur_vlevel[10], cur_var[10], cur_step[20], dummy[80];
  fpos_t the_pos;
  found_vlevel = 0;
  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 (strcmp(check_step, cur_step) != 0) {
      printf("error: wrong timestep[%s]: ", cur_step);
      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)) {
      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));
  fsetpos(fpin, &the_pos);
  return fpin;
err:
  printf("error finding variable [%s] level [%s]\n", seek_var, seek_vlevel);
  return NULL;
}


x86 assembly (clang, -O0):
<find_VL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1b4(%rbp),%rsi
call   1040 <fgetpos@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1b4(%rbp),%rsi
call   1090 <fsetpos@plt>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jg     11fa <find_VL+0x8a>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    11e7 <find_VL+0x77>
jmp    1467 <find_VL+0x2f7>
jmp    11ec <find_VL+0x7c>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b9 <find_VL+0x49>
mov    -0x10(%rbp),%rdi
lea    -0x160(%rbp),%rdx
lea    0xdf4(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     121f <find_VL+0xaf>
jmp    1467 <find_VL+0x2f7>
mov    -0x28(%rbp),%rdi
lea    -0x160(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1253 <find_VL+0xe3>
lea    -0x160(%rbp),%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1467 <find_VL+0x2f7>
mov    -0x10(%rbp),%rdi
lea    -0x144(%rbp),%rdx
lea    0xdc7(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     1278 <find_VL+0x108>
jmp    1467 <find_VL+0x2f7>
mov    -0x10(%rbp),%rdi
lea    -0x13a(%rbp),%rdx
lea    0xdb0(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     129d <find_VL+0x12d>
jmp    1467 <find_VL+0x2f7>
mov    -0x20(%rbp),%rdi
lea    0xd9f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12eb <find_VL+0x17b>
mov    -0x20(%rbp),%rdi
lea    0xd8c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12eb <find_VL+0x17b>
mov    -0x20(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    135a <find_VL+0x1ea>
lea    -0x13a(%rbp),%rdi
lea    0xd4e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <find_VL+0x1d2>
lea    -0x13a(%rbp),%rdi
lea    0xd38(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1342 <find_VL+0x1d2>
lea    -0x13a(%rbp),%rdi
lea    0xd25(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    134e <find_VL+0x1de>
movl   $0x1,-0x30(%rbp)
jmp    1355 <find_VL+0x1e5>
movl   $0x0,-0x30(%rbp)
jmp    137e <find_VL+0x20e>
mov    -0x20(%rbp),%rdi
lea    -0x13a(%rbp),%rsi
call   1070 <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     13a2 <find_VL+0x232>
mov    -0x18(%rbp),%rdi
lea    -0x144(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1408 <find_VL+0x298>
jmp    13a7 <find_VL+0x237>
mov    -0x10(%rbp),%rdi
lea    -0x1b4(%rbp),%rsi
call   1040 <fgetpos@plt>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    13db <find_VL+0x26b>
jmp    1467 <find_VL+0x2f7>
jmp    13e0 <find_VL+0x270>
lea    -0x130(%rbp),%rdi
lea    -0x1b0(%rbp),%rdx
lea    0xc6b(%rip),%rsi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    13a7 <find_VL+0x237>
jmp    1408 <find_VL+0x298>
jmp    140d <find_VL+0x29d>
mov    $0x1,%al
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0x1b5(%rbp)
je     143c <find_VL+0x2cc>
mov    -0x18(%rbp),%rdi
lea    -0x144(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1b5(%rbp)
mov    -0x1b5(%rbp),%al
test   $0x1,%al
jne    11a2 <find_VL+0x32>
mov    -0x10(%rbp),%rdi
lea    -0x1b4(%rbp),%rsi
call   1090 <fsetpos@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1485 <find_VL+0x315>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xbf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_VL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %rcx,0x38(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
lea    0x4(%rsp),%rbp
mov    %rbp,%rsi
call   1040 <fgetpos@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fsetpos@plt>
lea    0xb0(%rsp),%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
lea    0xb0(%rsp),%r13
lea    0x4(%rsp),%r14
lea    0xe83(%rip),%r12
lea    0x60(%rsp),%r15
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
mov    %rbx,%rdi
lea    0xdb0(%rip),%rsi
lea    0x40(%rsp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    13e5 <find_VL+0x275>
mov    0x38(%rsp),%rdi
lea    0x40(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    13d2 <find_VL+0x262>
mov    %rbx,%rdi
lea    0xda7(%rip),%rsi
lea    0x2e(%rsp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    13e5 <find_VL+0x275>
mov    %rbx,%rdi
lea    0xd98(%rip),%rsi
lea    0x16(%rsp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    13e5 <find_VL+0x275>
mov    0x20(%rsp),%rbp
mov    %rbp,%rdi
lea    0xd83(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1300 <find_VL+0x190>
mov    %rbp,%rdi
lea    0xd76(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1300 <find_VL+0x190>
mov    %rbp,%rdi
lea    0xd6c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1300 <find_VL+0x190>
mov    %rbp,%rdi
lea    0x16(%rsp),%rsi
jmp    1338 <find_VL+0x1c8>
lea    0x16(%rsp),%rdi
lea    0xd3b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1345 <find_VL+0x1d5>
lea    0x16(%rsp),%rdi
lea    0xd2c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1345 <find_VL+0x1d5>
lea    0x16(%rsp),%rdi
lea    0xd20(%rip),%rsi
call   1070 <strcmp@plt>
mov    $0x1,%bpl
test   %rax,%rax
jne    1360 <find_VL+0x1f0>
mov    0x8(%rsp),%rdi
lea    0x2e(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1398 <find_VL+0x228>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fgetpos@plt>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     13e5 <find_VL+0x275>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    1360 <find_VL+0x1f0>
test   %bpl,%bpl
jne    13ac <find_VL+0x23c>
mov    0x8(%rsp),%rdi
lea    0x2e(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1414 <find_VL+0x2a4>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <fsetpos@plt>
mov    %r13,%rdi
mov    $0xff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
jne    11e2 <find_VL+0x72>
jmp    13e5 <find_VL+0x275>
lea    0xc37(%rip),%rdi
lea    0x40(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc80(%rip),%rdi
xor    %ebx,%ebx
mov    0x8(%rsp),%rsi
mov    0x20(%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
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   1090 <fsetpos@plt>
jmp    13ff <find_VL+0x28f>

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

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