#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 */
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
long skipheader(FILE *ephemfile) {
  char line[400];
  int lines_read;
  char *p;
  for (lines_read = 0; lines_read < 9; ++lines_read) {
    p = fgets(line, 400, ephemfile);
    if (p == NULL) {
      (void)fprintf(stderr,
                    "\nFATAL error reading ephemeris file: can't skip header, "
                    "linenumber %d.\nInvalid ephemeris file format.\n",
                    lines_read);
      return (-1);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<skipheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x9,-0x1a4(%rbp)
jge    11b1 <skipheader+0x91>
lea    -0x1a0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x190,%esi
call   1030 <fgets@plt>
mov    %rax,-0x1b0(%rbp)
cmpq   $0x0,-0x1b0(%rbp)
jne    1198 <skipheader+0x78>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x1a4(%rbp),%edx
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    11b9 <skipheader+0x99>
jmp    119d <skipheader+0x7d>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1139 <skipheader+0x19>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipheader>:
push   %rbx
sub    $0x190,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1207 <skipheader+0xe7>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     120b <skipheader+0xeb>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1212 <skipheader+0xf2>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1219 <skipheader+0xf9>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1220 <skipheader+0x100>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1227 <skipheader+0x107>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     122e <skipheader+0x10e>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1235 <skipheader+0x115>
mov    %rsp,%rdi
mov    $0x190,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1256 <skipheader+0x136>
mov    $0x8,%edx
jmp    123a <skipheader+0x11a>
xor    %edx,%edx
jmp    123a <skipheader+0x11a>
mov    $0x1,%edx
jmp    123a <skipheader+0x11a>
mov    $0x2,%edx
jmp    123a <skipheader+0x11a>
mov    $0x3,%edx
jmp    123a <skipheader+0x11a>
mov    $0x4,%edx
jmp    123a <skipheader+0x11a>
mov    $0x5,%edx
jmp    123a <skipheader+0x11a>
mov    $0x6,%edx
jmp    123a <skipheader+0x11a>
mov    $0x7,%edx
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffffffffffff,%rax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"\0AFATAL error reading ephemeris file: can't skip header, linenumber %d.\0AInvalid ephemeris file format.\0A\00"
define i64 @skipheader(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca [400 x i8]
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %3
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 9
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = getelementptr inbounds [400 x i8], [400 x i8]* %4, i64 0, i64 0
%12 = load i32*, i32** %3
%13 = call i8* @fgets(i8* %11, i32 400, i32* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = load i32, i32* %5
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 %18)
store i64 -1, i64* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i64 1, i64* %2
br label %25
25: ; preds = %24, %16
%26 = load i64, i64* %2
ret i64 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"\0AFATAL error reading ephemeris file: can't skip header, linenumber %d.\0AInvalid ephemeris file format.\0A\00"
define i64 @skipheader(i32* nocapture %0) {
%2 = alloca [400 x i8]
%3 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%4 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %31, %28, %25, %22, %19, %16, %13, %10, %1
%7 = phi i32 [ 0, %1 ], [ 1, %10 ], [ 2, %13 ], [ 3, %16 ], [ 4, %19 ], [ 5, %22 ], [ 6, %25 ], [ 7, %28 ], [ 8, %31 ]
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %34
10: ; preds = %1
%11 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%12 = icmp eq i8* %11, null
br i1 %12, label %6, label %13
13: ; preds = %10
%14 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%15 = icmp eq i8* %14, null
br i1 %15, label %6, label %16
16: ; preds = %13
%17 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%18 = icmp eq i8* %17, null
br i1 %18, label %6, label %19
19: ; preds = %16
%20 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%21 = icmp eq i8* %20, null
br i1 %21, label %6, label %22
22: ; preds = %19
%23 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%24 = icmp eq i8* %23, null
br i1 %24, label %6, label %25
25: ; preds = %22
%26 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%27 = icmp eq i8* %26, null
br i1 %27, label %6, label %28
28: ; preds = %25
%29 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%30 = icmp eq i8* %29, null
br i1 %30, label %6, label %31
31: ; preds = %28
%32 = call i8* @fgets(i8* %3, i32 400, i32* %0)
%33 = icmp eq i8* %32, null
br i1 %33, label %6, label %34
34: ; preds = %31, %6
%35 = phi i64 [ -1, %6 ], [ 1, %31 ]
ret i64 %35
}