#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ player_add(char *, double, int /*<<< orphan*/, int);
int strlen(char *);
int strspn(char *, char *);
void read_ignore(FILE *f, FILE *fdiag) {
  char buf[128];
  while (fgets(buf, 128, f) != NULL) {
    char *s = buf + strspn(buf, "\t ");
    if (*s != '#') {
      char *e = s + strlen(s);
      if (s == e)
        continue;
      do {
        e -= 1;
      } while (s <= e && (*e == ' ' || *e == '\t' || *e == '\n'));
      *++e = '\0';
      if (s < e) {
        player_add(s, 0.0, 0, 1);
        if (fdiag)
          fprintf(fdiag, "Ignoring %s\n", s);
      }
    }
  }
}


x86 assembly (clang, -O0):
<read_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x80,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1322 <read_ignore+0x1d2>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1050 <strspn@plt>
mov    %eax,%ecx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     131d <read_ignore+0x1cd>
mov    -0x98(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x98(%rbp),%rax
cmp    -0xa0(%rbp),%rax
jne    1215 <read_ignore+0xc5>
jmp    1163 <read_ignore+0x13>
jmp    121a <read_ignore+0xca>
mov    -0xa0(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x98(%rbp),%rcx
xor    %eax,%eax
cmp    -0xa0(%rbp),%rcx
mov    %al,-0xb1(%rbp)
ja     12a0 <read_ignore+0x150>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xb2(%rbp)
je     1294 <read_ignore+0x144>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xb2(%rbp)
je     1294 <read_ignore+0x144>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xb2(%rbp)
mov    -0xb2(%rbp),%al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    121a <read_ignore+0xca>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x98(%rbp),%rax
cmp    -0xa0(%rbp),%rax
jae    1318 <read_ignore+0x1c8>
mov    -0x98(%rbp),%rdi
xorps  %xmm0,%xmm0
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <player_add@plt>
cmpq   $0x0,-0x10(%rbp)
je     1313 <read_ignore+0x1c3>
mov    -0x10(%rbp),%rdi
mov    -0x98(%rbp),%rdx
lea    0xcf5(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1318 <read_ignore+0x1c8>
jmp    131d <read_ignore+0x1cd>
jmp    1163 <read_ignore+0x13>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ignore>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%r14
mov    %rdi,%r12
mov    %rsp,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1249 <read_ignore+0xf9>
lea    0xe79(%rip),%r15
mov    %rsp,%rbx
movabs $0x100000600,%r13
jmp    11b9 <read_ignore+0x69>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1249 <read_ignore+0xf9>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strspn@plt>
cltq
cmpb   $0x23,(%rsp,%rax,1)
je     11a0 <read_ignore+0x50>
lea    (%rsp,%rax,1),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     11a0 <read_ignore+0x50>
movslq %eax,%rcx
add    %rbp,%rcx
lea    -0x1(%rcx),%rax
cmp    %rax,%rbp
ja     120f <read_ignore+0xbf>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0x20,%rcx
ja     1208 <read_ignore+0xb8>
bt     %rcx,%r13
jae    1208 <read_ignore+0xb8>
add    $0xffffffffffffffff,%rax
cmp    %rax,%rbp
jbe    11f0 <read_ignore+0xa0>
add    $0x1,%rax
mov    %rax,%rcx
movb   $0x0,(%rcx)
cmp    %rcx,%rbp
jae    11a0 <read_ignore+0x50>
xorps  %xmm0,%xmm0
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <player_add@plt>
test   %r14,%r14
je     11a0 <read_ignore+0x50>
mov    %r14,%rdi
lea    0xdc7(%rip),%rsi
mov    %rbp,%rdx
call   1070 <fprintf@plt>
jmp    11a0 <read_ignore+0x50>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\09 \00"
@.str.1 = [13 x i8] c"Ignoring %s\0A\00"
define void @read_ignore(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [128 x i8]
%6 = alloca i8*
%7 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %8
8: ; preds = %77, %32, %2
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32* @fgets(i8* %9, i32 128, i32* %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %78
13: ; preds = %8
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%16 = call i32 @strspn(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 35
br i1 %22, label %23, label %77
23: ; preds = %13
%24 = load i8*, i8** %6
%25 = load i8*, i8** %6
%26 = call i32 @strlen(i8* %25)
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
store i8* %28, i8** %7
%29 = load i8*, i8** %6
%30 = load i8*, i8** %7
%31 = icmp eq i8* %29, %30
br i1 %31, label %32, label %33
32: ; preds = %23
br label %8
33: ; preds = %23
br label %34
34: ; preds = %58, %33
%35 = load i8*, i8** %7
%36 = getelementptr inbounds i8, i8* %35, i64 -1
store i8* %36, i8** %7
br label %37
37: ; preds = %34
%38 = load i8*, i8** %6
%39 = load i8*, i8** %7
%40 = icmp ule i8* %38, %39
br i1 %40, label %41, label %58
41: ; preds = %37
%42 = load i8*, i8** %7
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 32
br i1 %45, label %56, label %46
46: ; preds = %41
%47 = load i8*, i8** %7
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 9
br i1 %50, label %56, label %51
51: ; preds = %46
%52 = load i8*, i8** %7
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 10
br label %56
56: ; preds = %51, %46, %41
%57 = phi i1 [ true, %46 ], [ true, %41 ], [ %55, %51 ]
br label %58
58: ; preds = %56, %37
%59 = phi i1 [ false, %37 ], [ %57, %56 ]
br i1 %59, label %34, label %60
60: ; preds = %58
%61 = load i8*, i8** %7
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %7
store i8 0, i8* %62
%63 = load i8*, i8** %6
%64 = load i8*, i8** %7
%65 = icmp ult i8* %63, %64
br i1 %65, label %66, label %76
66: ; preds = %60
%67 = load i8*, i8** %6
%68 = call i32 @player_add(i8* %67, double 0.000000e+00, i32 0, i32 1)
%69 = load i32*, i32** %4
%70 = icmp ne i32* %69, null
br i1 %70, label %71, label %75
71: ; preds = %66
%72 = load i32*, i32** %4
%73 = load i8*, i8** %6
%74 = call i32 @fprintf(i32* %72, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %71, %66
br label %76
76: ; preds = %75, %60
br label %77
77: ; preds = %76, %13
br label %8
78: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\09 \00"
@.str.1 = [13 x i8] c"Ignoring %s\0A\00"
define void @read_ignore(i32* nocapture %0, i32* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32* @fgets(i8* %4, i32 128, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %40, label %7
7: ; preds = %2
%8 = icmp eq i32* %1, null
br label %9
9: ; preds = %7, %37
%10 = call i32 @strspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 35
br i1 %14, label %37, label %15
15: ; preds = %9
%16 = call i32 @strlen(i8* %12)
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %12, i64 %17
%19 = icmp eq i32 %16, 0
br i1 %19, label %37, label %20
20: ; preds = %15
%21 = getelementptr inbounds i8, i8* %18, i64 -1
%22 = icmp ugt i8* %12, %21
br i1 %22, label %30, label %23
23: ; preds = %20, %27
%24 = phi i8* [ %28, %27 ], [ %21, %20 ]
%25 = phi i8* [ %24, %27 ], [ %18, %20 ]
%26 = load i8, i8* %24
switch i8 %26, label %30 [
i8 32, label %27
i8 9, label %27
i8 10, label %27
]
27: ; preds = %23, %23, %23
%28 = getelementptr inbounds i8, i8* %24, i64 -1
%29 = icmp ugt i8* %12, %28
br i1 %29, label %30, label %23
30: ; preds = %27, %23, %20
%31 = phi i8* [ %18, %20 ], [ %25, %23 ], [ %24, %27 ]
store i8 0, i8* %31
%32 = icmp ult i8* %12, %31
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = call i32 @player_add(i8* %12, double 0.000000e+00, i32 0, i32 1)
br i1 %8, label %37, label %35
35: ; preds = %33
%36 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %37
37: ; preds = %33, %35, %30, %15, %9
%38 = call i32* @fgets(i8* %4, i32 128, i32* %0)
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %9
40: ; preds = %37, %2
ret void
}