#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 n_lines(int /*<<< orphan*/ *, char);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int sscanf(char *, char *, char *, char *, int *, int *, float *, int *, int *,
           float *, float *, char *, float *, int *);
int /*<<< orphan*/ stderr;
int read_gsc_file(char *gname, FILE *ofp) {
  int count = 0;
  int nlgsc;
  int nstars = 0;
  int pa;
  int hr, min;
  float sec;
  int deg, amin;
  float asec;
  float mag;
  float dist;
  char line[1000];
  char junk[1000];
  FILE *gscfp;
  if ((gscfp = fopen(gname, "r")) == NULL) {
    fprintf(stderr, "ERROR: read_gsc_file.  Cannot open %s\n", gname);
    return -1;
  }
  if ((nlgsc = n_lines(gscfp, '!')) <= 0) {
    fprintf(stderr, "ERROR: read_gsc_file. No lines in %s\n", gname);
    return -1;
  } else
    rewind(gscfp);
  while (nstars < 3 && fgets(line, 1000, gscfp) != NULL) {
    count++;
    if (count == (22 + 1)) {
      if (sscanf(line, "</b>   %s %s %d %d %f %d %d %f %f %s %f %d", junk, junk,
                 &hr, &min, &sec, &deg, &amin, &asec, &mag, junk, &dist,
                 &pa) != 12) {
        fprintf(stderr, "ERROR: read_gsc_file.  Error in format.\n");
        return -1;
      }
      if (mag < 100.0) {
        nstars++;
        fprintf(ofp, "%sG%d  %02d %02d %05.2f  %+03d %02d %05.2f  %5.2f  ",
                gname, nstars, hr, min, sec, deg, amin, asec, mag);
        fprintf(ofp, "%5.2f %3d\n", dist, pa);
      }
    }
    if (count > (22 + 1) && (nlgsc - count) >= 23) {
      if (sscanf(line, "%s %s %d %d %f %d %d %f %f %s %f %d", junk, junk, &hr,
                 &min, &sec, &deg, &amin, &asec, &mag, junk, &dist,
                 &pa) != 12) {
        fprintf(stderr, "ERROR: read_gsc_file.  Error in format.\n");
        return -1;
      }
      if (mag < 100.0) {
        nstars++;
        fprintf(ofp, "%sG%d  %02d %02d %05.2f  %+03d %02d %05.2f  %5.2f  ",
                gname, nstars, hr, min, sec, deg, amin, asec, mag);
        fprintf(ofp, "%5.2f %3d\n", dist, pa);
      }
    }
  }
  if (gscfp)
    fclose(gscfp);
  return nstars;
}


x86 assembly (clang, -O0):
<read_gsc_file>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x878,%rsp
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x858(%rbp)
cmp    $0x0,%rax
jne    11e3 <read_gsc_file+0x73>
mov    0x2e1e(%rip),%rax
movslq (%rax),%rdi
mov    -0x38(%rbp),%rdx
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    1538 <read_gsc_file+0x3c8>
mov    -0x858(%rbp),%rdi
mov    $0x21,%esi
call   1050 <n_lines@plt>
mov    %eax,-0x48(%rbp)
cmp    $0x0,%eax
jg     1228 <read_gsc_file+0xb8>
mov    0x2dd9(%rip),%rax
movslq (%rax),%rdi
mov    -0x38(%rbp),%rdx
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    1538 <read_gsc_file+0x3c8>
mov    -0x858(%rbp),%rdi
call   1040 <rewind@plt>
jmp    1239 <read_gsc_file+0xc9>
xor    %eax,%eax
cmpl   $0x3,-0x4c(%rbp)
mov    %al,-0x859(%rbp)
jge    1270 <read_gsc_file+0x100>
lea    -0x460(%rbp),%rdi
mov    -0x858(%rbp),%rdx
mov    $0x3e8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x859(%rbp)
mov    -0x859(%rbp),%al
test   $0x1,%al
jne    1283 <read_gsc_file+0x113>
jmp    1518 <read_gsc_file+0x3a8>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x17,-0x44(%rbp)
jne    13c8 <read_gsc_file+0x258>
lea    -0x460(%rbp),%rdi
lea    -0x850(%rbp),%rdx
lea    -0x850(%rbp),%rcx
lea    -0x850(%rbp),%r11
lea    0xd9e(%rip),%rsi
lea    -0x54(%rbp),%r8
lea    -0x58(%rbp),%r9
lea    -0x5c(%rbp),%r13
lea    -0x60(%rbp),%r12
lea    -0x64(%rbp),%r15
lea    -0x68(%rbp),%r14
lea    -0x6c(%rbp),%rbx
lea    -0x70(%rbp),%r10
lea    -0x50(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1080 <sscanf@plt>
cmp    $0xc,%eax
je     1336 <read_gsc_file+0x1c6>
mov    0x2cc7(%rip),%rax
movslq (%rax),%rdi
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    1538 <read_gsc_file+0x3c8>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcb9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13c3 <read_gsc_file+0x253>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
mov    -0x54(%rbp),%r8d
mov    -0x58(%rbp),%r9d
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x60(%rbp),%r10d
mov    -0x64(%rbp),%eax
movss  -0x68(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x6c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xd15(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x3,%al
call   1070 <fprintf@plt>
mov    -0x40(%rbp),%rdi
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x50(%rbp),%edx
lea    0xd23(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    13c8 <read_gsc_file+0x258>
cmpl   $0x17,-0x44(%rbp)
jle    1513 <read_gsc_file+0x3a3>
mov    -0x48(%rbp),%eax
sub    -0x44(%rbp),%eax
cmp    $0x17,%eax
jl     1513 <read_gsc_file+0x3a3>
lea    -0x460(%rbp),%rdi
lea    -0x850(%rbp),%rdx
lea    -0x850(%rbp),%rcx
lea    -0x850(%rbp),%r11
lea    0xc5a(%rip),%rsi
lea    -0x54(%rbp),%r8
lea    -0x58(%rbp),%r9
lea    -0x5c(%rbp),%r13
lea    -0x60(%rbp),%r12
lea    -0x64(%rbp),%r15
lea    -0x68(%rbp),%r14
lea    -0x6c(%rbp),%rbx
lea    -0x70(%rbp),%r10
lea    -0x50(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1080 <sscanf@plt>
cmp    $0xc,%eax
je     1481 <read_gsc_file+0x311>
mov    0x2b7c(%rip),%rax
movslq (%rax),%rdi
lea    0xc14(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x2c(%rbp)
jmp    1538 <read_gsc_file+0x3c8>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb6e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    150e <read_gsc_file+0x39e>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
mov    -0x54(%rbp),%r8d
mov    -0x58(%rbp),%r9d
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x60(%rbp),%r10d
mov    -0x64(%rbp),%eax
movss  -0x68(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x6c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xbca(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x3,%al
call   1070 <fprintf@plt>
mov    -0x40(%rbp),%rdi
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x50(%rbp),%edx
lea    0xbd8(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    1513 <read_gsc_file+0x3a3>
jmp    1239 <read_gsc_file+0xc9>
cmpq   $0x0,-0x858(%rbp)
je     1532 <read_gsc_file+0x3c2>
mov    -0x858(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x878,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_gsc_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %rsi,0x30(%rsp)
mov    %rdi,%rbp
lea    0xe64(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     141b <read_gsc_file+0x29b>
mov    %rax,%r12
mov    %rax,%rdi
mov    $0x21,%esi
call   1050 <n_lines@plt>
test   %eax,%eax
jle    1438 <read_gsc_file+0x2b8>
mov    %eax,%ebx
mov    %rbp,0x28(%rsp)
mov    %r12,%rdi
call   1040 <rewind@plt>
add    $0xffffffff,%ebx
xor    %r13d,%r13d
lea    0x430(%rsp),%r14
lea    0x4(%rsp),%rbp
xor    %r15d,%r15d
mov    %r12,0x38(%rsp)
jmp    121f <read_gsc_file+0x9f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xed4(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
add    $0xffffffff,%ebx
add    $0x1,%r15d
cmp    $0x3,%r13d
jge    142e <read_gsc_file+0x2ae>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     142e <read_gsc_file+0x2ae>
cmp    $0x16,%r15d
jne    1330 <read_gsc_file+0x1b0>
mov    %r14,%rdi
lea    0xe07(%rip),%rsi
lea    0x40(%rsp),%rcx
mov    %rcx,%rdx
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
push   %rbp
lea    0x10(%rsp),%rax
push   %rax
push   %rcx
lea    0x24(%rsp),%rax
push   %rax
lea    0x30(%rsp),%rax
push   %rax
lea    0x3c(%rsp),%rax
push   %rax
lea    0x48(%rsp),%rax
push   %rax
lea    0x54(%rsp),%rax
push   %rax
call   1080 <sscanf@plt>
add    $0x40,%rsp
cmp    $0xc,%eax
jne    146e <read_gsc_file+0x2ee>
movss  0xc(%rsp),%xmm0
movss  0xd5c(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    120e <read_gsc_file+0x8e>
cvtss2sd %xmm0,%xmm2
add    $0x1,%r13d
mov    0x24(%rsp),%r8d
mov    0x20(%rsp),%r9d
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x18(%rsp),%r10d
mov    0x14(%rsp),%ebp
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r14,%r12
mov    0x30(%rsp),%r14
mov    %r14,%rdi
lea    0xdb9(%rip),%rsi
mov    0x28(%rsp),%rdx
mov    %r13d,%ecx
mov    $0x3,%al
push   %rbp
lea    0xc(%rsp),%rbp
push   %r10
call   1070 <fprintf@plt>
add    $0x10,%rsp
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    %r12,%r14
mov    0x38(%rsp),%r12
jmp    1200 <read_gsc_file+0x80>
nopw   0x0(%rax,%rax,1)
jbe    120e <read_gsc_file+0x8e>
cmp    $0x17,%ebx
jl     120e <read_gsc_file+0x8e>
mov    %r14,%rdi
lea    0xd11(%rip),%rsi
lea    0x40(%rsp),%rcx
mov    %rcx,%rdx
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
push   %rbp
lea    0x10(%rsp),%rax
push   %rax
push   %rcx
lea    0x24(%rsp),%rax
push   %rax
lea    0x30(%rsp),%rax
push   %rax
lea    0x3c(%rsp),%rax
push   %rax
lea    0x48(%rsp),%rax
push   %rax
lea    0x54(%rsp),%rax
push   %rax
call   1080 <sscanf@plt>
add    $0x40,%rsp
cmp    $0xc,%eax
jne    146e <read_gsc_file+0x2ee>
movss  0xc(%rsp),%xmm0
movss  0xc5f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    120e <read_gsc_file+0x8e>
cvtss2sd %xmm0,%xmm2
add    $0x1,%r13d
mov    0x24(%rsp),%r8d
mov    0x20(%rsp),%r9d
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x18(%rsp),%r10d
mov    0x14(%rsp),%r11d
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    0x30(%rsp),%rbp
mov    %rbp,%rdi
lea    0xcbe(%rip),%rsi
mov    0x28(%rsp),%rdx
mov    %r13d,%ecx
mov    $0x3,%al
push   %r11
push   %r10
call   1070 <fprintf@plt>
add    $0x10,%rsp
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x4(%rsp),%edx
mov    %rbp,%rdi
lea    0x4(%rsp),%rbp
jmp    1200 <read_gsc_file+0x80>
mov    0x2bbe(%rip),%rax
movslq (%rax),%rdi
lea    0xbda(%rip),%rsi
jmp    1449 <read_gsc_file+0x2c9>
mov    %r12,%rdi
call   1030 <fclose@plt>
jmp    1459 <read_gsc_file+0x2d9>
mov    0x2ba1(%rip),%rax
movslq (%rax),%rdi
lea    0xbe4(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%r13d
mov    %r13d,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b6b(%rip),%rax
movslq (%rax),%rcx
lea    0xbff(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
call   10a0 <fwrite@plt>
jmp    1453 <read_gsc_file+0x2d3>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"ERROR: read_gsc_file. Cannot open %s\0A\00"
@.str.2 = [38 x i8] c"ERROR: read_gsc_file. No lines in %s\0A\00"
@.str.3 = [43 x i8] c"</b> %s %s %d %d %f %d %d %f %f %s %f %d\00"
@.str.4 = [41 x i8] c"ERROR: read_gsc_file. Error in format.\0A\00"
@.str.5 = [52 x i8] c"%sG%d %02d %02d %05.2f %+03d %02d %05.2f %5.2f \00"
@.str.6 = [11 x i8] c"%5.2f %3d\0A\00"
@.str.7 = [36 x i8] c"%s %s %d %d %f %d %d %f %f %s %f %d\00"
define i32 @read_gsc_file(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca [1000 x i8]
%19 = alloca [1000 x i8]
%20 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 0, i32* %6
store i32 0, i32* %8
%21 = load i8*, i8** %4
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %22, i32** %20
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %30
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load i8*, i8** %4
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %28)
store i32 -1, i32* %3
br label %154
30: ; preds = %2
%31 = load i32*, i32** %20
%32 = call i32 @n_lines(i32* %31, i8 signext 33)
store i32 %32, i32* %7
%33 = icmp sle i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = load i32, i32* @stderr
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i32*
%38 = load i8*, i8** %4
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %38)
store i32 -1, i32* %3
br label %154
40: ; preds = %30
%41 = load i32*, i32** %20
%42 = call i32 @rewind(i32* %41)
br label %43
43: ; preds = %40
br label %44
44: ; preds = %145, %43
%45 = load i32, i32* %8
%46 = icmp slt i32 %45, 3
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%49 = load i32*, i32** %20
%50 = call i32* @fgets(i8* %48, i32 1000, i32* %49)
%51 = icmp ne i32* %50, null
br label %52
52: ; preds = %47, %44
%53 = phi i1 [ false, %44 ], [ %51, %47 ]
br i1 %53, label %54, label %146
54: ; preds = %52
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 23
br i1 %58, label %59, label %98
59: ; preds = %54
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%61 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%63 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%64 = call i32 @sscanf(i8* %60, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %61, i8* %62, i32* %10, i32* %11, float* %12, i32* %13, i32* %14, float* %15, float* %16, i8* %63, float* %17, i32* %9)
%65 = icmp ne i32 %64, 12
br i1 %65, label %66, label %71
66: ; preds = %59
%67 = load i32, i32* @stderr
%68 = sext i32 %67 to i64
%69 = inttoptr i64 %68 to i32*
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %154
71: ; preds = %59
%72 = load float, float* %16
%73 = fpext float %72 to double
%74 = fcmp olt double %73, 1.000000e+02
br i1 %74, label %75, label %97
75: ; preds = %71
%76 = load i32, i32* %8
%77 = add nsw i32 %76, 1
store i32 %77, i32* %8
%78 = load i32*, i32** %5
%79 = load i8*, i8** %4
%80 = load i32, i32* %8
%81 = load i32, i32* %10
%82 = load i32, i32* %11
%83 = load float, float* %12
%84 = fpext float %83 to double
%85 = load i32, i32* %13
%86 = load i32, i32* %14
%87 = load float, float* %15
%88 = fpext float %87 to double
%89 = load float, float* %16
%90 = fpext float %89 to double
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %79, i32 %80, i32 %81, i32 %82, double %84, i32 %85, i32 %86, double %88, double %90)
%92 = load i32*, i32** %5
%93 = load float, float* %17
%94 = fpext float %93 to double
%95 = load i32, i32* %9
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %94, i32 %95)
br label %97
97: ; preds = %75, %71
br label %98
98: ; preds = %97, %54
%99 = load i32, i32* %6
%100 = icmp sgt i32 %99, 23
br i1 %100, label %101, label %145
101: ; preds = %98
%102 = load i32, i32* %7
%103 = load i32, i32* %6
%104 = sub nsw i32 %102, %103
%105 = icmp sge i32 %104, 23
br i1 %105, label %106, label %145
106: ; preds = %101
%107 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%108 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%109 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%110 = getelementptr inbounds [1000 x i8], [1000 x i8]* %19, i64 0, i64 0
%111 = call i32 @sscanf(i8* %107, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i8* %108, i8* %109, i32* %10, i32* %11, float* %12, i32* %13, i32* %14, float* %15, float* %16, i8* %110, float* %17, i32* %9)
%112 = icmp ne i32 %111, 12
br i1 %112, label %113, label %118
113: ; preds = %106
%114 = load i32, i32* @stderr
%115 = sext i32 %114 to i64
%116 = inttoptr i64 %115 to i32*
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %154
118: ; preds = %106
%119 = load float, float* %16
%120 = fpext float %119 to double
%121 = fcmp olt double %120, 1.000000e+02
br i1 %121, label %122, label %144
122: ; preds = %118
%123 = load i32, i32* %8
%124 = add nsw i32 %123, 1
store i32 %124, i32* %8
%125 = load i32*, i32** %5
%126 = load i8*, i8** %4
%127 = load i32, i32* %8
%128 = load i32, i32* %10
%129 = load i32, i32* %11
%130 = load float, float* %12
%131 = fpext float %130 to double
%132 = load i32, i32* %13
%133 = load i32, i32* %14
%134 = load float, float* %15
%135 = fpext float %134 to double
%136 = load float, float* %16
%137 = fpext float %136 to double
%138 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %126, i32 %127, i32 %128, i32 %129, double %131, i32 %132, i32 %133, double %135, double %137)
%139 = load i32*, i32** %5
%140 = load float, float* %17
%141 = fpext float %140 to double
%142 = load i32, i32* %9
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %141, i32 %142)
br label %144
144: ; preds = %122, %118
br label %145
145: ; preds = %144, %101, %98
br label %44
146: ; preds = %52
%147 = load i32*, i32** %20
%148 = icmp ne i32* %147, null
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load i32*, i32** %20
%151 = call i32 @fclose(i32* %150)
br label %152
152: ; preds = %149, %146
%153 = load i32, i32* %8
store i32 %153, i32* %3
br label %154
154: ; preds = %152, %113, %66, %34, %24
%155 = load i32, i32* %3
ret i32 %155
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"ERROR: read_gsc_file. Cannot open %s\0A\00"
@.str.2 = [38 x i8] c"ERROR: read_gsc_file. No lines in %s\0A\00"
@.str.3 = [43 x i8] c"</b> %s %s %d %d %f %d %d %f %f %s %f %d\00"
@.str.4 = [41 x i8] c"ERROR: read_gsc_file. Error in format.\0A\00"
@.str.5 = [52 x i8] c"%sG%d %02d %02d %05.2f %+03d %02d %05.2f %5.2f \00"
@.str.6 = [11 x i8] c"%5.2f %3d\0A\00"
@.str.7 = [36 x i8] c"%s %s %d %d %f %d %d %f %f %s %f %d\00"
define i32 @read_gsc_file(i8* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca [1000 x i8]
%13 = alloca [1000 x i8]
%14 = bitcast i32* %3 to i8*
%15 = bitcast i32* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast float* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = bitcast float* %9 to i8*
%21 = bitcast float* %10 to i8*
%22 = bitcast float* %11 to i8*
%23 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%25 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %32
27: ; preds = %2
%28 = load i32, i32* @stderr
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %115
32: ; preds = %2
%33 = tail call i32 @n_lines(i32* %25, i8 signext 33)
%34 = icmp slt i32 %33, 1
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
%39 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %115
40: ; preds = %32
%41 = tail call i32 @rewind(i32* %25)
br label %42
42: ; preds = %40, %109
%43 = phi i32 [ 0, %40 ], [ %110, %109 ]
%44 = phi i32 [ 0, %40 ], [ %48, %109 ]
%45 = call i32* @fgets(i8* %23, i32 1000, i32* %25)
%46 = icmp eq i32* %45, null
br i1 %46, label %112, label %47
47: ; preds = %42
%48 = add nuw nsw i32 %44, 1
%49 = icmp eq i32 %48, 23
br i1 %49, label %50, label %77
50: ; preds = %47
%51 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %24, i8* %24, i32* %4, i32* %5, float* %6, i32* %7, i32* %8, float* %9, float* %10, i8* %24, float* %11, i32* %3)
%52 = icmp eq i32 %51, 12
br i1 %52, label %58, label %53
53: ; preds = %50
%54 = load i32, i32* @stderr
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to i32*
%57 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i64 40, i64 1, i32* %56)
br label %115
58: ; preds = %50
%59 = load float, float* %10
%60 = fcmp olt float %59, 1.000000e+02
br i1 %60, label %61, label %109
61: ; preds = %58
%62 = fpext float %59 to double
%63 = add nsw i32 %43, 1
%64 = load i32, i32* %4
%65 = load i32, i32* %5
%66 = load float, float* %6
%67 = fpext float %66 to double
%68 = load i32, i32* %7
%69 = load i32, i32* %8
%70 = load float, float* %9
%71 = fpext float %70 to double
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32 %63, i32 %64, i32 %65, double %67, i32 %68, i32 %69, double %71, double %62)
%73 = load float, float* %11
%74 = fpext float %73 to double
%75 = load i32, i32* %3
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %74, i32 %75)
br label %109
77: ; preds = %47
%78 = icmp ugt i32 %44, 22
%79 = sub nsw i32 %33, %48
%80 = icmp sgt i32 %79, 22
%81 = select i1 %78, i1 %80, i1 false
br i1 %81, label %82, label %109
82: ; preds = %77
%83 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i8* %24, i8* %24, i32* %4, i32* %5, float* %6, i32* %7, i32* %8, float* %9, float* %10, i8* %24, float* %11, i32* %3)
%84 = icmp eq i32 %83, 12
br i1 %84, label %90, label %85
85: ; preds = %82
%86 = load i32, i32* @stderr
%87 = sext i32 %86 to i64
%88 = inttoptr i64 %87 to i32*
%89 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i64 40, i64 1, i32* %88)
br label %115
90: ; preds = %82
%91 = load float, float* %10
%92 = fcmp olt float %91, 1.000000e+02
br i1 %92, label %93, label %109
93: ; preds = %90
%94 = fpext float %91 to double
%95 = add nsw i32 %43, 1
%96 = load i32, i32* %4
%97 = load i32, i32* %5
%98 = load float, float* %6
%99 = fpext float %98 to double
%100 = load i32, i32* %7
%101 = load i32, i32* %8
%102 = load float, float* %9
%103 = fpext float %102 to double
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32 %95, i32 %96, i32 %97, double %99, i32 %100, i32 %101, double %103, double %94)
%105 = load float, float* %11
%106 = fpext float %105 to double
%107 = load i32, i32* %3
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), double %106, i32 %107)
br label %109
109: ; preds = %61, %58, %90, %93, %77
%110 = phi i32 [ %95, %93 ], [ %43, %90 ], [ %43, %77 ], [ %43, %58 ], [ %63, %61 ]
%111 = icmp slt i32 %110, 3
br i1 %111, label %42, label %112
112: ; preds = %42, %109
%113 = phi i32 [ %43, %42 ], [ %110, %109 ]
%114 = call i32 @fclose(i32* %25)
br label %115
115: ; preds = %112, %85, %53, %35, %27
%116 = phi i32 [ -1, %27 ], [ -1, %35 ], [ -1, %53 ], [ -1, %85 ], [ %113, %112 ]
ret i32 %116
}