#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ gets(char *);
int n_lines(int /*<<< orphan*/ *, char);
int read_gsc_file(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int sscanf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int nl1;
  int nstars;
  char *flname;
  char *outname;
  char line[1000];
  char gname[1000];
  FILE *ifp;
  FILE *ofp;
  if (argc != 3) {
    fprintf(stderr, "\nUsage: sel_gscstars [infile] [outfile]\n");
    fprintf(stderr, " where [infile] is a file containing a list of files ");
    fprintf(stderr, "to be processed\n");
    fprintf(stderr, " and [outfile] is the name of the desired output file.");
    fprintf(stderr, "\n\n");
    return 1;
  }
  flname = argv[1];
  while ((ifp = fopen(flname, "r")) == NULL) {
    fprintf(stderr, "ERROR: %s does not exist.  Enter new filename:  ", flname);
    gets(flname);
  }
  outname = argv[2];
  while ((ofp = fopen(outname, "w")) == NULL) {
    fprintf(stderr,
            "ERROR: %s does not exist.  Enter new filename:  ", outname);
    gets(outname);
  }
  if ((nl1 = n_lines(ifp, '!')) == 0) {
    fprintf(stderr, "\nERROR: No lines in input file\n");
    return 1;
  } else
    rewind(ifp);
  while (fgets(line, 1000, ifp) != NULL) {
    if (sscanf(line, "%s", gname) != 1) {
      fprintf(stderr, "ERROR: Problem reading %s\n", flname);
      return 1;
    }
    if ((nstars = read_gsc_file(gname, ofp)) != 3)
      fprintf(stderr, "Warning: Found only %d stars for %s\n", nstars, gname);
  }
  if (ifp)
    fclose(ifp);
  if (ofp)
    fclose(ofp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1232 <main+0xa2>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141b <main+0x28b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x808(%rbp)
cmp    $0x0,%rax
jne    1288 <main+0xf8>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe39(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1090 <gets@plt>
jmp    123e <main+0xae>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x810(%rbp)
cmp    $0x0,%rax
jne    12de <main+0x14e>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xde3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1090 <gets@plt>
jmp    1294 <main+0x104>
mov    -0x808(%rbp),%rdi
mov    $0x21,%esi
call   1050 <n_lines@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    131e <main+0x18e>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
lea    0xdd4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141b <main+0x28b>
mov    -0x808(%rbp),%rdi
call   1040 <rewind@plt>
jmp    132f <main+0x19f>
lea    -0x410(%rbp),%rdi
mov    -0x808(%rbp),%rdx
mov    $0x3e8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     13e0 <main+0x250>
lea    -0x410(%rbp),%rdi
lea    -0x800(%rbp),%rdx
lea    0xd99(%rip),%rsi
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     139b <main+0x20b>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd7a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141b <main+0x28b>
lea    -0x800(%rbp),%rdi
mov    -0x810(%rbp),%rsi
call   1080 <read_gsc_file@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x3,%eax
je     13db <main+0x24b>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    -0x800(%rbp),%rcx
lea    0xd49(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    132f <main+0x19f>
cmpq   $0x0,-0x808(%rbp)
je     13fa <main+0x26a>
mov    -0x808(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x810(%rbp)
je     1414 <main+0x284>
mov    -0x810(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7d8,%rsp
cmp    $0x3,%edi
jne    131e <main+0x18e>
mov    %rsi,%r12
mov    0x8(%rsi),%r14
lea    0xef2(%rip),%rsi
mov    %r14,%rdi
call   10b0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    120c <main+0x7c>
mov    0x2e11(%rip),%r13
lea    0xed6(%rip),%rbp
lea    0xecd(%rip),%rbx
nopl   (%rax)
mov    0x0(%r13),%edi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14,%rdi
call   1090 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     11e0 <main+0x50>
mov    %rax,%r15
mov    0x10(%r12),%rbp
lea    0xec5(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1271 <main+0xe1>
lea    0xe7d(%rip),%r12
lea    0xea7(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
mov    %r12,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbp,%rdi
call   1090 <gets@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1240 <main+0xb0>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x21,%esi
call   1050 <n_lines@plt>
test   %eax,%eax
je     1384 <main+0x1f4>
mov    %r15,%rdi
call   1040 <rewind@plt>
mov    %rsp,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1370 <main+0x1e0>
lea    0xe51(%rip),%r12
mov    %rsp,%r13
lea    0x3f0(%rsp),%rbp
jmp    12d9 <main+0x149>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1370 <main+0x1e0>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    13b2 <main+0x222>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <read_gsc_file@plt>
cmp    $0x3,%eax
je     12c0 <main+0x130>
mov    0x2cd9(%rip),%rcx
mov    (%rcx),%edi
lea    0xe0d(%rip),%rsi
mov    %eax,%edx
mov    %rbp,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    12c0 <main+0x130>
mov    0x2cbb(%rip),%rbx
mov    (%rbx),%edi
lea    0xcd2(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xceb(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd11(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd12(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd39(%rip),%rsi
jmp    1394 <main+0x204>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    13a0 <main+0x210>
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
lea    0xd4b(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c27(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    139b <main+0x20b>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"\0AUsage: sel_gscstars [infile] [outfile]\0A\00"
@.str.1 = [54 x i8] c" where [infile] is a file containing a list of files \00"
@.str.2 = [17 x i8] c"to be processed\0A\00"
@.str.3 = [55 x i8] c" and [outfile] is the name of the desired output file.\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [49 x i8] c"ERROR: %s does not exist. Enter new filename: \00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [32 x i8] c"\0AERROR: No lines in input file\0A\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [27 x i8] c"ERROR: Problem reading %s\0A\00"
@.str.11 = [37 x i8] c"Warning: Found only %d stars for %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [1000 x i8]
%11 = alloca [1000 x i8]
%12 = alloca i32*
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %27
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %104
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
store i8* %30, i8** %8
br label %31
31: ; preds = %35, %27
%32 = load i8*, i8** %8
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %33, i32** %12
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %41
35: ; preds = %31
%36 = load i32, i32* @stderr
%37 = load i8*, i8** %8
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %8
%40 = call i32 @gets(i8* %39)
br label %31
41: ; preds = %31
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
store i8* %44, i8** %9
br label %45
45: ; preds = %49, %41
%46 = load i8*, i8** %9
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %47, i32** %13
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %55
49: ; preds = %45
%50 = load i32, i32* @stderr
%51 = load i8*, i8** %9
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %51)
%53 = load i8*, i8** %9
%54 = call i32 @gets(i8* %53)
br label %45
55: ; preds = %45
%56 = load i32*, i32** %12
%57 = call i32 @n_lines(i32* %56, i8 signext 33)
store i32 %57, i32* %6
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %104
62: ; preds = %55
%63 = load i32*, i32** %12
%64 = call i32 @rewind(i32* %63)
br label %65
65: ; preds = %62
br label %66
66: ; preds = %90, %65
%67 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%68 = load i32*, i32** %12
%69 = call i32* @fgets(i8* %67, i32 1000, i32* %68)
%70 = icmp ne i32* %69, null
br i1 %70, label %71, label %91
71: ; preds = %66
%72 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%73 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%74 = call i32 @sscanf(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %73)
%75 = icmp ne i32 %74, 1
br i1 %75, label %76, label %80
76: ; preds = %71
%77 = load i32, i32* @stderr
%78 = load i8*, i8** %8
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %78)
store i32 1, i32* %3
br label %104
80: ; preds = %71
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%82 = load i32*, i32** %13
%83 = call i32 @read_gsc_file(i8* %81, i32* %82)
store i32 %83, i32* %7
%84 = icmp ne i32 %83, 3
br i1 %84, label %85, label %90
85: ; preds = %80
%86 = load i32, i32* @stderr
%87 = load i32, i32* %7
%88 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %87, i8* %88)
br label %90
90: ; preds = %85, %80
br label %66
91: ; preds = %66
%92 = load i32*, i32** %12
%93 = icmp ne i32* %92, null
br i1 %93, label %94, label %97
94: ; preds = %91
%95 = load i32*, i32** %12
%96 = call i32 @fclose(i32* %95)
br label %97
97: ; preds = %94, %91
%98 = load i32*, i32** %13
%99 = icmp ne i32* %98, null
br i1 %99, label %100, label %103
100: ; preds = %97
%101 = load i32*, i32** %13
%102 = call i32 @fclose(i32* %101)
br label %103
103: ; preds = %100, %97
store i32 0, i32* %3
br label %104
104: ; preds = %103, %76, %59, %16
%105 = load i32, i32* %3
ret i32 %105
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"\0AUsage: sel_gscstars [infile] [outfile]\0A\00"
@.str.1 = [54 x i8] c" where [infile] is a file containing a list of files \00"
@.str.2 = [17 x i8] c"to be processed\0A\00"
@.str.3 = [55 x i8] c" and [outfile] is the name of the desired output file.\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [49 x i8] c"ERROR: %s does not exist. Enter new filename: \00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [32 x i8] c"\0AERROR: No lines in input file\0A\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [27 x i8] c"ERROR: Problem reading %s\0A\00"
@.str.11 = [37 x i8] c"Warning: Found only %d stars for %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %19, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %71
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %30
24: ; preds = %19, %24
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%27 = tail call i32 @gets(i8* %21)
%28 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %24, label %30
30: ; preds = %24, %19
%31 = phi i32* [ %22, %19 ], [ %28, %24 ]
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %42
36: ; preds = %30, %36
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%39 = tail call i32 @gets(i8* %33)
%40 = tail call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%41 = icmp eq i32* %40, null
br i1 %41, label %36, label %42
42: ; preds = %36, %30
%43 = phi i32* [ %34, %30 ], [ %40, %36 ]
%44 = tail call i32 @n_lines(i32* %31, i8 signext 33)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %71
49: ; preds = %42
%50 = tail call i32 @rewind(i32* %31)
%51 = call i32* @fgets(i8* %5, i32 1000, i32* %31)
%52 = icmp eq i32* %51, null
br i1 %52, label %68, label %53
53: ; preds = %49, %65
%54 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%55 = icmp eq i32 %54, 1
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %21)
br label %71
59: ; preds = %53
%60 = call i32 @read_gsc_file(i8* %6, i32* %43)
%61 = icmp eq i32 %60, 3
br i1 %61, label %65, label %62
62: ; preds = %59
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %60, i8* %6)
br label %65
65: ; preds = %62, %59
%66 = call i32* @fgets(i8* %5, i32 1000, i32* %31)
%67 = icmp eq i32* %66, null
br i1 %67, label %68, label %53
68: ; preds = %65, %49
%69 = call i32 @fclose(i32* %31)
%70 = call i32 @fclose(i32* %43)
br label %71
71: ; preds = %68, %56, %46, %8
%72 = phi i32 [ 1, %8 ], [ 1, %46 ], [ 1, %56 ], [ 0, %68 ]
ret i32 %72
}