#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*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ isspace(unsigned char);
int npc_parse_function(char *, char *, char *, char *, char *,
                       int /*<<< orphan*/ *, int *, char const *);
int npc_parse_mapflag(char *, char *, char *, char *, int);
int npc_parse_mob(char *, char *, char *, char *, int);
int npc_parse_script(char *, char *, char *, char *, char *,
                     int /*<<< orphan*/ *, int *, char const *);
int npc_parse_shop(char *, char *, char *, char *, int);
int npc_parse_warp(char *, char *, char *, char *, int);
char *npc_skip_line(char *, int *);
int /*<<< orphan*/ parse_script_line_curly(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ script_error(char *, char const *, int, char *, char *);
int sscanf(char *, char *, ...);
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int npc_parse_srcfile(const char *filepath) {
  char line[4096], w1[4096], w2[4096], w3[4096], w4[4096];
  int lines = 0, ret = 0;
  int comment_flag = 0;
  FILE *fp = fopen(filepath, "r");
  if (fp == NULL) {
    printf("reading npc file not found : %s\a\n", filepath);
    return 0;
  }
  while (fgets(line, sizeof(line), fp)) {
    char *lp;
    int i = 0, j = 0, w4pos = 0, count;
    lines++;
    while (line[i]) {
      switch (line[i]) {
      case ' ':
        if (!j || line[j - 1] != ',') {
          if (!line[i + 1]) {
            line[j++] = ' ';
          } else if (!isspace((unsigned char)line[i + 1]) &&
                     line[i + 1] != ',') {
            line[j++] = ' ';
          }
        }
        break;
      case '\t':
        if (!j || line[j - 1] != '\t') {
          line[j++] = '\t';
        }
        break;
      default:
        line[j++] = line[i];
      }
      i++;
    }
    line[j] = 0;
    lp = npc_skip_line(line, &comment_flag);
    if (lp == NULL)
      continue;
    if ((count = sscanf(
             lp, "%4095[^\t]\t%4095[^\t]\t%4095[^\t\r\n]\t%n%4095[^\t\r\n]", w1,
             w2, w3, &w4pos, w4)) < 3 &&
        (count = sscanf(lp, "%4095s%4095s%4095s%n%4095s", w1, w2, w3, &w4pos,
                        w4)) < 3) {
      script_error(lp, filepath, lines, "npc file syntax error", lp + w4pos);
      break;
    }
    if (strcmp(w1, "-") != 0 && strcasecmp(w1, "function") != 0) {
      size_t len;
      char mapname[4096] = "";
      sscanf(w1, "%4095[^,]", mapname);
      len = strlen(mapname);
      if (len <= 4 || len > 24 || strcmp(mapname + len - 4, ".gat") != 0) {
        script_error(lp, filepath, lines, "npc file syntax error", lp);
        break;
      }
    }
    if (strcasecmp(w2, "warp") == 0 && count > 3) {
      ret = npc_parse_warp(w1, w2, w3, w4, lines);
    } else if ((strcasecmp(w2, "shop") == 0 ||
                strcasecmp(w2, "pointshop") == 0) &&
               count > 3) {
      ret = npc_parse_shop(w1, w2, w3, w4, lines);
    } else if ((i = 0, sscanf(w2, "substore%n", &i), (i > 0 && w2[i] == '(')) &&
               count > 3) {
      ret = npc_parse_shop(w1, w2, w3, w4, lines);
    } else if (strcasecmp(w2, "script") == 0 && count > 3) {
      if (strcasecmp(w1, "function") == 0) {
        ret = npc_parse_function(w1, w2, w3, w4, line + w4pos, fp, &lines,
                                 filepath);
      } else {
        ret = npc_parse_script(w1, w2, w3, w4, line + w4pos, fp, &lines,
                               filepath);
      }
    } else if ((i = 0, sscanf(w2, "duplicate%n", &i),
                (i > 0 && w2[i] == '(')) &&
               count > 3) {
      ret =
          npc_parse_script(w1, w2, w3, w4, line + w4pos, fp, &lines, filepath);
    } else if (strcasecmp(w2, "monster") == 0 && count > 3) {
      ret = npc_parse_mob(w1, w2, w3, w4, lines);
    } else if (strcasecmp(w2, "mapflag") == 0 && count >= 3) {
      ret = npc_parse_mapflag(w1, w2, w3, w4, lines);
    } else {
      script_error(lp, filepath, lines, "npc file syntax error",
                   lp + strlen(w1) + 1);
      break;
    }
    if (ret) {
      break;
    }
  }
  fclose(fp);
  if (comment_flag) {
    printf("Missing */ on %s\a\n", filepath);
  } else {
    printf("\r");
  }
  parse_script_line_curly(NULL, 0, 0);
  return 1;
}


x86 assembly (clang, -O0):
<npc_parse_srcfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6090,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x5014(%rbp)
movl   $0x0,-0x5018(%rbp)
movl   $0x0,-0x501c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x5028(%rbp)
cmpq   $0x0,-0x5028(%rbp)
jne    12a0 <npc_parse_srcfile+0x70>
mov    -0x10(%rbp),%rsi
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1b7d <npc_parse_srcfile+0x94d>
jmp    12a5 <npc_parse_srcfile+0x75>
lea    -0x1010(%rbp),%rdi
mov    -0x5028(%rbp),%rdx
mov    $0x1000,%esi
call   10d0 <fgets@plt>
cmp    $0x0,%rax
je     1b2b <npc_parse_srcfile+0x8fb>
movl   $0x0,-0x5034(%rbp)
movl   $0x0,-0x5038(%rbp)
movl   $0x0,-0x503c(%rbp)
mov    -0x5014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5014(%rbp)
movslq -0x5034(%rbp),%rax
cmpb   $0x0,-0x1010(%rbp,%rax,1)
je     148e <npc_parse_srcfile+0x25e>
movslq -0x5034(%rbp),%rax
movsbl -0x1010(%rbp,%rax,1),%eax
ff
mov    %eax,-0x6054(%rbp)
sub    $0x9,%eax
je     1409 <npc_parse_srcfile+0x1d9>
jmp    132c <npc_parse_srcfile+0xfc>
mov    -0x6054(%rbp),%eax
sub    $0x20,%eax
jne    1452 <npc_parse_srcfile+0x222>
jmp    1340 <npc_parse_srcfile+0x110>
cmpl   $0x0,-0x5038(%rbp)
je     1369 <npc_parse_srcfile+0x139>
mov    -0x5038(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0x2c,%eax
je     1404 <npc_parse_srcfile+0x1d4>
mov    -0x5034(%rbp),%eax
add    $0x1,%eax
cltq
cmpb   $0x0,-0x1010(%rbp,%rax,1)
jne    13a2 <npc_parse_srcfile+0x172>
mov    -0x5038(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x5038(%rbp)
cltq
movb   $0x20,-0x1010(%rbp,%rax,1)
20
jmp    13ff <npc_parse_srcfile+0x1cf>
mov    -0x5034(%rbp),%eax
add    $0x1,%eax
cltq
movzbl -0x1010(%rbp,%rax,1),%edi
ff
call   10c0 <isspace@plt>
cmp    $0x0,%eax
jne    13fa <npc_parse_srcfile+0x1ca>
mov    -0x5034(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0x2c,%eax
je     13fa <npc_parse_srcfile+0x1ca>
mov    -0x5038(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x5038(%rbp)
cltq
movb   $0x20,-0x1010(%rbp,%rax,1)
20
jmp    13ff <npc_parse_srcfile+0x1cf>
jmp    1404 <npc_parse_srcfile+0x1d4>
jmp    147a <npc_parse_srcfile+0x24a>
cmpl   $0x0,-0x5038(%rbp)
je     1432 <npc_parse_srcfile+0x202>
mov    -0x5038(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0x9,%eax
je     144d <npc_parse_srcfile+0x21d>
mov    -0x5038(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x5038(%rbp)
cltq
movb   $0x9,-0x1010(%rbp,%rax,1)
09
jmp    147a <npc_parse_srcfile+0x24a>
movslq -0x5034(%rbp),%rax
mov    -0x1010(%rbp,%rax,1),%cl
mov    -0x5038(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x5038(%rbp)
cltq
mov    %cl,-0x1010(%rbp,%rax,1)
mov    -0x5034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5034(%rbp)
jmp    12f4 <npc_parse_srcfile+0xc4>
movslq -0x5038(%rbp),%rax
movb   $0x0,-0x1010(%rbp,%rax,1)
lea    -0x1010(%rbp),%rdi
lea    -0x501c(%rbp),%rsi
call   1110 <npc_skip_line@plt>
mov    %rax,-0x5030(%rbp)
cmpq   $0x0,-0x5030(%rbp)
jne    14ca <npc_parse_srcfile+0x29a>
jmp    12a5 <npc_parse_srcfile+0x75>
mov    -0x5030(%rbp),%rdi
lea    -0x2010(%rbp),%rdx
lea    -0x3010(%rbp),%rcx
lea    -0x4010(%rbp),%r8
lea    -0x5010(%rbp),%rax
lea    0xb2e(%rip),%rsi
lea    -0x503c(%rbp),%r9
mov    %rax,(%rsp)
mov    $0x0,%al
call   1120 <sscanf@plt>
mov    %eax,-0x5040(%rbp)
cmp    $0x3,%eax
jge    1593 <npc_parse_srcfile+0x363>
mov    -0x5030(%rbp),%rdi
lea    -0x2010(%rbp),%rdx
lea    -0x3010(%rbp),%rcx
lea    -0x4010(%rbp),%r8
lea    -0x5010(%rbp),%rax
lea    0xb11(%rip),%rsi
lea    -0x503c(%rbp),%r9
mov    %rax,(%rsp)
mov    $0x0,%al
call   1120 <sscanf@plt>
mov    %eax,-0x5040(%rbp)
cmp    $0x3,%eax
jge    1593 <npc_parse_srcfile+0x363>
mov    -0x5030(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x5014(%rbp),%edx
mov    -0x5030(%rbp),%r8
movslq -0x503c(%rbp),%rax
add    %rax,%r8
lea    0xae2(%rip),%rcx
call   1030 <script_error@plt>
jmp    1b2b <npc_parse_srcfile+0x8fb>
lea    -0x2010(%rbp),%rdi
lea    0xae0(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     1683 <npc_parse_srcfile+0x453>
lea    -0x2010(%rbp),%rdi
lea    0xac5(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     1683 <npc_parse_srcfile+0x453>
lea    -0x6050(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10a0 <memset@plt>
lea    -0x2010(%rbp),%rdi
lea    -0x6050(%rbp),%rdx
lea    0xa97(%rip),%rsi
mov    $0x0,%al
call   1120 <sscanf@plt>
lea    -0x6050(%rbp),%rdi
call   1070 <strlen@plt>
cltq
mov    %rax,-0x5048(%rbp)
cmpq   $0x4,-0x5048(%rbp)
04
jbe    1655 <npc_parse_srcfile+0x425>
cmpq   $0x18,-0x5048(%rbp)
18
ja     1655 <npc_parse_srcfile+0x425>
lea    -0x6050(%rbp),%rdi
add    -0x5048(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
lea    0xa50(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
je     167e <npc_parse_srcfile+0x44e>
mov    -0x5030(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x5014(%rbp),%edx
mov    -0x5030(%rbp),%r8
lea    0x9f7(%rip),%rcx
call   1030 <script_error@plt>
jmp    1b2b <npc_parse_srcfile+0x8fb>
jmp    1683 <npc_parse_srcfile+0x453>
lea    -0x3010(%rbp),%rdi
lea    0xa0a(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    16e0 <npc_parse_srcfile+0x4b0>
cmpl   $0x3,-0x5040(%rbp)
jle    16e0 <npc_parse_srcfile+0x4b0>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
mov    -0x5014(%rbp),%r8d
call   10b0 <npc_parse_warp@plt>
mov    %eax,-0x5018(%rbp)
jmp    1b14 <npc_parse_srcfile+0x8e4>
lea    -0x3010(%rbp),%rdi
lea    0x9b7(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     171a <npc_parse_srcfile+0x4ea>
lea    -0x3010(%rbp),%rdi
lea    0x995(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    175a <npc_parse_srcfile+0x52a>
cmpl   $0x3,-0x5040(%rbp)
jle    175a <npc_parse_srcfile+0x52a>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
mov    -0x5014(%rbp),%r8d
call   10f0 <npc_parse_shop@plt>
mov    %eax,-0x5018(%rbp)
jmp    1b0f <npc_parse_srcfile+0x8df>
movl   $0x0,-0x5034(%rbp)
lea    -0x3010(%rbp),%rdi
lea    0x938(%rip),%rsi
lea    -0x5034(%rbp),%rdx
mov    $0x0,%al
call   1120 <sscanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x5034(%rbp)
mov    %al,-0x6055(%rbp)
jle    17b0 <npc_parse_srcfile+0x580>
movslq -0x5034(%rbp),%rax
movsbl -0x3010(%rbp,%rax,1),%eax
ff
cmp    $0x28,%eax
sete   %al
mov    %al,-0x6055(%rbp)
mov    -0x6055(%rbp),%al
test   $0x1,%al
jne    17c3 <npc_parse_srcfile+0x593>
jmp    1803 <npc_parse_srcfile+0x5d3>
cmpl   $0x3,-0x5040(%rbp)
jle    1803 <npc_parse_srcfile+0x5d3>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
mov    -0x5014(%rbp),%r8d
call   10f0 <npc_parse_shop@plt>
mov    %eax,-0x5018(%rbp)
jmp    1b0a <npc_parse_srcfile+0x8da>
lea    -0x3010(%rbp),%rdi
lea    0x8a4(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    18fa <npc_parse_srcfile+0x6ca>
cmpl   $0x3,-0x5040(%rbp)
jle    18fa <npc_parse_srcfile+0x6ca>
lea    -0x2010(%rbp),%rdi
lea    0x848(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    18a2 <npc_parse_srcfile+0x672>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
lea    -0x1010(%rbp),%r8
movslq -0x503c(%rbp),%rax
add    %rax,%r8
mov    -0x5028(%rbp),%r9
mov    -0x10(%rbp),%rax
lea    -0x5014(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1090 <npc_parse_function@plt>
mov    %eax,-0x5018(%rbp)
jmp    18f5 <npc_parse_srcfile+0x6c5>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
lea    -0x1010(%rbp),%r8
movslq -0x503c(%rbp),%rax
add    %rax,%r8
mov    -0x5028(%rbp),%r9
mov    -0x10(%rbp),%rax
lea    -0x5014(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1140 <npc_parse_script@plt>
mov    %eax,-0x5018(%rbp)
jmp    1b05 <npc_parse_srcfile+0x8d5>
movl   $0x0,-0x5034(%rbp)
lea    -0x3010(%rbp),%rdi
lea    0x7aa(%rip),%rsi
lea    -0x5034(%rbp),%rdx
mov    $0x0,%al
call   1120 <sscanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x5034(%rbp)
mov    %al,-0x6056(%rbp)
jle    1950 <npc_parse_srcfile+0x720>
movslq -0x5034(%rbp),%rax
movsbl -0x3010(%rbp,%rax,1),%eax
ff
cmp    $0x28,%eax
sete   %al
mov    %al,-0x6056(%rbp)
mov    -0x6056(%rbp),%al
test   $0x1,%al
jne    1963 <npc_parse_srcfile+0x733>
jmp    19c8 <npc_parse_srcfile+0x798>
cmpl   $0x3,-0x5040(%rbp)
jle    19c8 <npc_parse_srcfile+0x798>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
lea    -0x1010(%rbp),%r8
movslq -0x503c(%rbp),%rax
add    %rax,%r8
mov    -0x5028(%rbp),%r9
mov    -0x10(%rbp),%rax
lea    -0x5014(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1140 <npc_parse_script@plt>
mov    %eax,-0x5018(%rbp)
jmp    1b00 <npc_parse_srcfile+0x8d0>
lea    -0x3010(%rbp),%rdi
lea    0x6f2(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1a25 <npc_parse_srcfile+0x7f5>
cmpl   $0x3,-0x5040(%rbp)
jle    1a25 <npc_parse_srcfile+0x7f5>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
mov    -0x5014(%rbp),%r8d
call   1100 <npc_parse_mob@plt>
mov    %eax,-0x5018(%rbp)
jmp    1afb <npc_parse_srcfile+0x8cb>
lea    -0x3010(%rbp),%rdi
lea    0x69d(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1a82 <npc_parse_srcfile+0x852>
cmpl   $0x3,-0x5040(%rbp)
jl     1a82 <npc_parse_srcfile+0x852>
lea    -0x2010(%rbp),%rdi
lea    -0x3010(%rbp),%rsi
lea    -0x4010(%rbp),%rdx
lea    -0x5010(%rbp),%rcx
mov    -0x5014(%rbp),%r8d
call   1150 <npc_parse_mapflag@plt>
mov    %eax,-0x5018(%rbp)
jmp    1af6 <npc_parse_srcfile+0x8c6>
mov    -0x5030(%rbp),%rax
mov    %rax,-0x6070(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x6068(%rbp)
mov    -0x5014(%rbp),%eax
mov    %eax,-0x605c(%rbp)
mov    -0x5030(%rbp),%rax
mov    %rax,-0x6078(%rbp)
lea    -0x2010(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x6078(%rbp),%r8
mov    -0x6070(%rbp),%rdi
mov    -0x6068(%rbp),%rsi
mov    -0x605c(%rbp),%edx
cltq
add    %rax,%r8
add    $0x1,%r8
lea    0x57f(%rip),%rcx
call   1030 <script_error@plt>
jmp    1b2b <npc_parse_srcfile+0x8fb>
jmp    1afb <npc_parse_srcfile+0x8cb>
jmp    1b00 <npc_parse_srcfile+0x8d0>
jmp    1b05 <npc_parse_srcfile+0x8d5>
jmp    1b0a <npc_parse_srcfile+0x8da>
jmp    1b0f <npc_parse_srcfile+0x8df>
jmp    1b14 <npc_parse_srcfile+0x8e4>
cmpl   $0x0,-0x5018(%rbp)
je     1b26 <npc_parse_srcfile+0x8f6>
jmp    1b2b <npc_parse_srcfile+0x8fb>
jmp    12a5 <npc_parse_srcfile+0x75>
mov    -0x5028(%rbp),%rdi
call   1060 <fclose@plt>
cmpl   $0x0,-0x501c(%rbp)
je     1b5b <npc_parse_srcfile+0x92b>
mov    -0x10(%rbp),%rsi
lea    0x589(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1b69 <npc_parse_srcfile+0x939>
lea    0x589(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <parse_script_line_curly@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6090,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npc_parse_srcfile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x6038,%rsp
mov    %rdi,%rbp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x2c(%rsp)
lea    0xe63(%rip),%rsi
call   1140 <fopen@plt>
test   %rax,%rax
je     1748 <npc_parse_srcfile+0x508>
mov    %rax,%r12
mov    %rbp,0x20(%rsp)
lea    0x2030(%rsp),%r15
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %rax,%rdx
call   10e0 <fgets@plt>
test   %rax,%rax
je     179d <npc_parse_srcfile+0x55d>
lea    0x1030(%rsp),%r14
lea    0x5030(%rsp),%rbx
mov    %r12,0x10(%rsp)
jmp    1306 <npc_parse_srcfile+0xc6>
nopl   0x0(%rax)
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %r13,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
call   10c0 <npc_parse_warp@plt>
mov    0x10(%rsp),%r12
test   %eax,%eax
jne    179d <npc_parse_srcfile+0x55d>
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %r12,%rdx
call   10e0 <fgets@plt>
test   %rax,%rax
je     179d <npc_parse_srcfile+0x55d>
mov    %rbx,%r13
movl   $0x0,0xc(%rsp)
addl   $0x1,0x8(%rsp)
movl   $0x0,0x1c(%rsp)
mov    0x2030(%rsp),%bl
mov    $0x0,%ebp
test   %bl,%bl
je     13d0 <npc_parse_srcfile+0x190>
xor    %ecx,%ecx
xor    %ebp,%ebp
jmp    1364 <npc_parse_srcfile+0x124>
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rax
add    $0x1,%ebp
mov    %bl,0x2030(%rsp,%rax,1)
movslq %ecx,%rax
lea    0x1(%rax),%rcx
mov    %ecx,0xc(%rsp)
movzbl 0x2031(%rsp,%rax,1),%ebx
test   %bl,%bl
je     13d0 <npc_parse_srcfile+0x190>
movsbl %bl,%eax
cmp    $0x9,%eax
je     13b0 <npc_parse_srcfile+0x170>
cmp    $0x20,%eax
jne    1340 <npc_parse_srcfile+0x100>
test   %ebp,%ebp
je     1380 <npc_parse_srcfile+0x140>
movslq %ebp,%rax
cmpb   $0x2c,-0x1(%rax,%r15,1)
je     134d <npc_parse_srcfile+0x10d>
movslq %ecx,%rax
movzbl 0x1(%rax,%r15,1),%eax
mov    $0x20,%bl
test   %al,%al
je     1340 <npc_parse_srcfile+0x100>
movzbl %al,%edi
call   10d0 <isspace@plt>
mov    0xc(%rsp),%ecx
test   %eax,%eax
jne    134d <npc_parse_srcfile+0x10d>
movslq %ecx,%rax
cmpb   $0x2c,0x1(%rax,%r15,1)
jne    1340 <npc_parse_srcfile+0x100>
jmp    134d <npc_parse_srcfile+0x10d>
nopl   0x0(%rax)
mov    $0x9,%bl
test   %ebp,%ebp
je     1340 <npc_parse_srcfile+0x100>
movslq %ebp,%rax
cmpb   $0x9,-0x1(%rax,%r15,1)
jne    1340 <npc_parse_srcfile+0x100>
jmp    134d <npc_parse_srcfile+0x10d>
nopw   0x0(%rax,%rax,1)
movslq %ebp,%rax
movb   $0x0,0x2030(%rsp,%rax,1)
mov    %r15,%rdi
lea    0x2c(%rsp),%rsi
call   1120 <npc_skip_line@plt>
test   %rax,%rax
mov    %r13,%rbx
lea    0x3030(%rsp),%rbp
je     12ed <npc_parse_srcfile+0xad>
sub    $0x8,%rsp
mov    %rax,%rdi
lea    0xc18(%rip),%rsi
mov    %rbx,%rdx
lea    0x38(%rsp),%rcx
mov    %rbp,%r13
mov    %rbp,%r8
lea    0x24(%rsp),%rbp
mov    %rbp,%r9
mov    %rax,%r15
xor    %eax,%eax
push   %r14
call   1130 <sscanf@plt>
add    $0x10,%rsp
mov    %eax,%r12d
cmp    $0x2,%eax
jg     146d <npc_parse_srcfile+0x22d>
sub    $0x8,%rsp
mov    %r15,%rdi
lea    0xc0a(%rip),%rsi
mov    %rbx,%rdx
lea    0x38(%rsp),%rcx
mov    %r13,%r8
mov    %rbp,%r9
xor    %eax,%eax
push   %r14
call   1130 <sscanf@plt>
add    $0x10,%rsp
mov    %eax,%r12d
cmp    $0x2,%eax
jle    1775 <npc_parse_srcfile+0x535>
mov    %r15,%r14
mov    %rbx,%rdi
lea    0xc07(%rip),%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
lea    0x2030(%rsp),%r15
je     1501 <npc_parse_srcfile+0x2c1>
mov    %rbx,%rdi
lea    0xbed(%rip),%rsi
call   1050 <strcasecmp@plt>
test   %rax,%rax
je     1501 <npc_parse_srcfile+0x2c1>
mov    $0x1000,%edx
lea    0x4030(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   10b0 <memset@plt>
mov    %rbx,%rdi
lea    0xbcb(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1130 <sscanf@plt>
mov    %rbp,%rdi
call   1080 <strlen@plt>
lea    -0x19(%rax),%ecx
cmp    $0xffffffec,%ecx
jb     175d <npc_parse_srcfile+0x51d>
mov    %eax,%eax
lea    (%rsp,%rax,1),%rdi
add    $0x402c,%rdi
lea    0xba3(%rip),%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
jne    175d <npc_parse_srcfile+0x51d>
lea    0x30(%rsp),%rdi
lea    0xb8e(%rip),%rsi
call   1050 <strcasecmp@plt>
cmp    $0x4,%r12d
jb     1521 <npc_parse_srcfile+0x2e1>
test   %rax,%rax
je     12c0 <npc_parse_srcfile+0x80>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
lea    0xb75(%rip),%rsi
call   1050 <strcasecmp@plt>
test   %rax,%rax
je     156b <npc_parse_srcfile+0x32b>
mov    %rbp,%rdi
lea    0xb5c(%rip),%rsi
call   1050 <strcasecmp@plt>
cmp    $0x4,%r12d
jb     1571 <npc_parse_srcfile+0x331>
test   %rax,%rax
jne    1571 <npc_parse_srcfile+0x331>
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
lea    0x3030(%rsp),%rdx
jmp    15be <npc_parse_srcfile+0x37e>
cmp    $0x4,%r12d
jae    1554 <npc_parse_srcfile+0x314>
movl   $0x0,0xc(%rsp)
lea    0x30(%rsp),%rdi
lea    0xb25(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1130 <sscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
lea    0x3030(%rsp),%rbp
jle    15d3 <npc_parse_srcfile+0x393>
cmp    $0x4,%r12d
jb     15d3 <npc_parse_srcfile+0x393>
cmpb   $0x28,0x30(%rsp,%rax,1)
jne    15d3 <npc_parse_srcfile+0x393>
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %rbp,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
call   1100 <npc_parse_shop@plt>
jmp    12e0 <npc_parse_srcfile+0xa0>
lea    0x30(%rsp),%rdi
lea    0xad6(%rip),%rsi
call   1050 <strcasecmp@plt>
cmp    $0x4,%r12d
jb     1649 <npc_parse_srcfile+0x409>
test   %rax,%rax
jne    1649 <npc_parse_srcfile+0x409>
mov    %rbx,%rdi
lea    0xa8a(%rip),%rsi
call   1050 <strcasecmp@plt>
movslq 0x1c(%rsp),%rcx
lea    (%rsp,%rcx,1),%r8
add    $0x2030,%r8
test   %rax,%rax
jne    168e <npc_parse_srcfile+0x44e>
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %rbp,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
mov    0x10(%rsp),%r12
mov    %r12,%r9
push   0x20(%rsp)
lea    0x10(%rsp),%rax
push   %rax
call   10a0 <npc_parse_function@plt>
add    $0x10,%rsp
jmp    12e5 <npc_parse_srcfile+0xa5>
movl   $0x0,0xc(%rsp)
lea    0x30(%rsp),%rdi
lea    0xa5f(%rip),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1130 <sscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    16c4 <npc_parse_srcfile+0x484>
cmp    $0x4,%r12d
jb     16c4 <npc_parse_srcfile+0x484>
cmpb   $0x28,0x30(%rsp,%rax,1)
jne    16c4 <npc_parse_srcfile+0x484>
movslq 0x1c(%rsp),%rax
lea    (%rsp,%rax,1),%r8
add    $0x2030,%r8
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %rbp,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
mov    0x10(%rsp),%r12
mov    %r12,%r9
push   0x20(%rsp)
lea    0x10(%rsp),%rax
push   %rax
call   1150 <npc_parse_script@plt>
add    $0x10,%rsp
jmp    12e5 <npc_parse_srcfile+0xa5>
lea    0x30(%rsp),%rdi
lea    0x9f8(%rip),%rsi
call   1050 <strcasecmp@plt>
cmp    $0x4,%r12d
jb     1705 <npc_parse_srcfile+0x4c5>
test   %rax,%rax
jne    1705 <npc_parse_srcfile+0x4c5>
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %rbp,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
call   1110 <npc_parse_mob@plt>
jmp    12e0 <npc_parse_srcfile+0xa0>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
lea    0x9bc(%rip),%rsi
call   1050 <strcasecmp@plt>
mov    0x8(%rsp),%r12d
test   %rax,%rax
jne    17ef <npc_parse_srcfile+0x5af>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
lea    0x1030(%rsp),%r14
mov    %r14,%rcx
mov    %r12d,%r8d
call   1160 <npc_parse_mapflag@plt>
jmp    12e0 <npc_parse_srcfile+0xa0>
lea    0x8b1(%rip),%rdi
xor    %ebx,%ebx
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    17db <npc_parse_srcfile+0x59b>
mov    0x8(%rsp),%edx
lea    0x903(%rip),%rcx
mov    %r14,%rdi
mov    0x20(%rsp),%rsi
mov    %r14,%r8
jmp    1793 <npc_parse_srcfile+0x553>
mov    0x8(%rsp),%edx
movslq 0x1c(%rsp),%rax
mov    %r15,%r8
add    %rax,%r8
lea    0x8e0(%rip),%rcx
mov    %r15,%rdi
mov    0x20(%rsp),%rsi
call   1030 <script_error@plt>
mov    0x10(%rsp),%r12
mov    %r12,%rdi
call   1070 <fclose@plt>
cmpl   $0x0,0x2c(%rsp)
je     17c1 <npc_parse_srcfile+0x581>
lea    0x925(%rip),%rdi
mov    0x20(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    17cb <npc_parse_srcfile+0x58b>
mov    $0xd,%edi
call   1040 <putchar@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <parse_script_line_curly@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x6038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x5030(%rsp),%rdi
call   1080 <strlen@plt>
cltq
mov    %r14,%rdi
lea    (%r14,%rax,1),%r8
add    $0x1,%r8
lea    0x85b(%rip),%rcx
mov    0x20(%rsp),%rsi
mov    %r12d,%edx
jmp    1793 <npc_parse_srcfile+0x553>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [34 x i8] c"reading npc file not found : %s\07\0A\00"
@.str.2 = [46 x i8] c"%4095[^\09]\09%4095[^\09]\09%4095[^\09\0D\0A]\09%n%4095[^\09\0D\0A]\00"
@.str.3 = [27 x i8] c"%4095s%4095s%4095s%n%4095s\00"
@.str.4 = [22 x i8] c"npc file syntax error\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [9 x i8] c"function\00"
@.str.7 = [10 x i8] c"%4095[^,]\00"
@.str.8 = [5 x i8] c".gat\00"
@.str.9 = [5 x i8] c"warp\00"
@.str.10 = [5 x i8] c"shop\00"
@.str.11 = [10 x i8] c"pointshop\00"
@.str.12 = [11 x i8] c"substore%n\00"
@.str.13 = [7 x i8] c"script\00"
@.str.14 = [12 x i8] c"duplicate%n\00"
@.str.15 = [8 x i8] c"monster\00"
@.str.16 = [8 x i8] c"mapflag\00"
@.str.17 = [19 x i8] c"Missing */ on %s\07\0A\00"
@.str.18 = [2 x i8] c"\0D\00"
define i32 @npc_parse_srcfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = alloca [4096 x i8]
%7 = alloca [4096 x i8]
%8 = alloca [4096 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i64
%19 = alloca [4096 x i8]
store i8* %0, i8** %3
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%20 = load i8*, i8** %3
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %21, i32** %12
%22 = load i32*, i32** %12
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %27
24: ; preds = %1
%25 = load i8*, i8** %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %25)
store i32 0, i32* %2
br label %376
27: ; preds = %1
br label %28
28: ; preds = %363, %132, %27
%29 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%30 = load i32*, i32** %12
%31 = call i64 @fgets(i8* %29, i32 4096, i32* %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %364
33: ; preds = %28
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %36
36: ; preds = %121, %33
%37 = load i32, i32* %14
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = icmp ne i8 %40, 0
br i1 %41, label %42, label %124
42: ; preds = %36
%43 = load i32, i32* %14
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
switch i32 %47, label %112 [
i32 32, label %48
i32 9, label %95
]
48: ; preds = %42
%49 = load i32, i32* %15
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %59
51: ; preds = %48
%52 = load i32, i32* %15
%53 = sub nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 44
br i1 %58, label %59, label %94
59: ; preds = %51, %48
%60 = load i32, i32* %14
%61 = add nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = icmp ne i8 %64, 0
br i1 %65, label %71, label %66
66: ; preds = %59
%67 = load i32, i32* %15
%68 = add nsw i32 %67, 1
store i32 %68, i32* %15
%69 = sext i32 %67 to i64
%70 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %69
store i8 32, i8* %70
br label %93
71: ; preds = %59
%72 = load i32, i32* %14
%73 = add nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = call i32 @isspace(i8 zeroext %76)
%78 = icmp ne i32 %77, 0
br i1 %78, label %92, label %79
79: ; preds = %71
%80 = load i32, i32* %14
%81 = add nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = icmp ne i32 %85, 44
br i1 %86, label %87, label %92
87: ; preds = %79
%88 = load i32, i32* %15
%89 = add nsw i32 %88, 1
store i32 %89, i32* %15
%90 = sext i32 %88 to i64
%91 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %90
store i8 32, i8* %91
br label %92
92: ; preds = %87, %79, %71
br label %93
93: ; preds = %92, %66
br label %94
94: ; preds = %93, %51
br label %121
95: ; preds = %42
%96 = load i32, i32* %15
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %106
98: ; preds = %95
%99 = load i32, i32* %15
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %101
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp ne i32 %104, 9
br i1 %105, label %106, label %111
106: ; preds = %98, %95
%107 = load i32, i32* %15
%108 = add nsw i32 %107, 1
store i32 %108, i32* %15
%109 = sext i32 %107 to i64
%110 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %109
store i8 9, i8* %110
br label %111
111: ; preds = %106, %98
br label %121
112: ; preds = %42
%113 = load i32, i32* %14
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = load i32, i32* %15
%118 = add nsw i32 %117, 1
store i32 %118, i32* %15
%119 = sext i32 %117 to i64
%120 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %119
store i8 %116, i8* %120
br label %121
121: ; preds = %112, %111, %94
%122 = load i32, i32* %14
%123 = add nsw i32 %122, 1
store i32 %123, i32* %14
br label %36
124: ; preds = %36
%125 = load i32, i32* %15
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %126
store i8 0, i8* %127
%128 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%129 = call i8* @npc_skip_line(i8* %128, i32* %11)
store i8* %129, i8** %13
%130 = load i8*, i8** %13
%131 = icmp eq i8* %130, null
br i1 %131, label %132, label %133
132: ; preds = %124
br label %28
133: ; preds = %124
%134 = load i8*, i8** %13
%135 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%136 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%137 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%138 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%139 = call i32 (i8*, i8*, ...) @sscanf(i8* %134, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* %135, i8* %136, i8* %137, i32* %16, i8* %138)
store i32 %139, i32* %17
%140 = icmp slt i32 %139, 3
br i1 %140, label %141, label %158
141: ; preds = %133
%142 = load i8*, i8** %13
%143 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%144 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%145 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%146 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%147 = call i32 (i8*, i8*, ...) @sscanf(i8* %142, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %143, i8* %144, i8* %145, i32* %16, i8* %146)
store i32 %147, i32* %17
%148 = icmp slt i32 %147, 3
br i1 %148, label %149, label %158
149: ; preds = %141
%150 = load i8*, i8** %13
%151 = load i8*, i8** %3
%152 = load i32, i32* %9
%153 = load i8*, i8** %13
%154 = load i32, i32* %16
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = call i32 @script_error(i8* %150, i8* %151, i32 %152, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %156)
br label %364
158: ; preds = %141, %133
%159 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%160 = call i64 @strcmp(i8* %159, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%161 = icmp ne i64 %160, 0
br i1 %161, label %162, label %193
162: ; preds = %158
%163 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%164 = call i64 @strcasecmp(i8* %163, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%165 = icmp ne i64 %164, 0
br i1 %165, label %166, label %193
166: ; preds = %162
%167 = bitcast [4096 x i8]* %19 to i8*
%168 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%169 = getelementptr inbounds [4096 x i8], [4096 x i8]* %19, i64 0, i64 0
%170 = call i32 (i8*, i8*, ...) @sscanf(i8* %168, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %169)
%171 = getelementptr inbounds [4096 x i8], [4096 x i8]* %19, i64 0, i64 0
%172 = call i32 @strlen(i8* %171)
%173 = sext i32 %172 to i64
store i64 %173, i64* %18
%174 = load i64, i64* %18
%175 = icmp ule i64 %174, 4
br i1 %175, label %186, label %176
176: ; preds = %166
%177 = load i64, i64* %18
%178 = icmp ugt i64 %177, 24
br i1 %178, label %186, label %179
179: ; preds = %176
%180 = getelementptr inbounds [4096 x i8], [4096 x i8]* %19, i64 0, i64 0
%181 = load i64, i64* %18
%182 = getelementptr inbounds i8, i8* %180, i64 %181
%183 = getelementptr inbounds i8, i8* %182, i64 -4
%184 = call i64 @strcmp(i8* %183, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%185 = icmp ne i64 %184, 0
br i1 %185, label %186, label %192
186: ; preds = %179, %176, %166
%187 = load i8*, i8** %13
%188 = load i8*, i8** %3
%189 = load i32, i32* %9
%190 = load i8*, i8** %13
%191 = call i32 @script_error(i8* %187, i8* %188, i32 %189, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %190)
br label %364
192: ; preds = %179
br label %193
193: ; preds = %192, %162, %158
%194 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%195 = call i64 @strcasecmp(i8* %194, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %207
197: ; preds = %193
%198 = load i32, i32* %17
%199 = icmp sgt i32 %198, 3
br i1 %199, label %200, label %207
200: ; preds = %197
%201 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%202 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%203 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%204 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%205 = load i32, i32* %9
%206 = call i32 @npc_parse_warp(i8* %201, i8* %202, i8* %203, i8* %204, i32 %205)
store i32 %206, i32* %10
br label %359
207: ; preds = %197, %193
%208 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%209 = call i64 @strcasecmp(i8* %208, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%210 = icmp eq i64 %209, 0
br i1 %210, label %215, label %211
211: ; preds = %207
%212 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%213 = call i64 @strcasecmp(i8* %212, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%214 = icmp eq i64 %213, 0
br i1 %214, label %215, label %225
215: ; preds = %211, %207
%216 = load i32, i32* %17
%217 = icmp sgt i32 %216, 3
br i1 %217, label %218, label %225
218: ; preds = %215
%219 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%220 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%221 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%222 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%223 = load i32, i32* %9
%224 = call i32 @npc_parse_shop(i8* %219, i8* %220, i8* %221, i8* %222, i32 %223)
store i32 %224, i32* %10
br label %358
225: ; preds = %215, %211
store i32 0, i32* %14
%226 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%227 = call i32 (i8*, i8*, ...) @sscanf(i8* %226, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32* %14)
%228 = load i32, i32* %14
%229 = icmp sgt i32 %228, 0
br i1 %229, label %230, label %237
230: ; preds = %225
%231 = load i32, i32* %14
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 %232
%234 = load i8, i8* %233
%235 = sext i8 %234 to i32
%236 = icmp eq i32 %235, 40
br label %237
237: ; preds = %230, %225
%238 = phi i1 [ false, %225 ], [ %236, %230 ]
br i1 %238, label %239, label %249
239: ; preds = %237
%240 = load i32, i32* %17
%241 = icmp sgt i32 %240, 3
br i1 %241, label %242, label %249
242: ; preds = %239
%243 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%244 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%245 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%246 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%247 = load i32, i32* %9
%248 = call i32 @npc_parse_shop(i8* %243, i8* %244, i8* %245, i8* %246, i32 %247)
store i32 %248, i32* %10
br label %357
249: ; preds = %239, %237
%250 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%251 = call i64 @strcasecmp(i8* %250, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%252 = icmp eq i64 %251, 0
br i1 %252, label %253, label %285
253: ; preds = %249
%254 = load i32, i32* %17
%255 = icmp sgt i32 %254, 3
br i1 %255, label %256, label %285
256: ; preds = %253
%257 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%258 = call i64 @strcasecmp(i8* %257, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%259 = icmp eq i64 %258, 0
br i1 %259, label %260, label %272
260: ; preds = %256
%261 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%262 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%263 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%264 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%265 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%266 = load i32, i32* %16
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds i8, i8* %265, i64 %267
%269 = load i32*, i32** %12
%270 = load i8*, i8** %3
%271 = call i32 @npc_parse_function(i8* %261, i8* %262, i8* %263, i8* %264, i8* %268, i32* %269, i32* %9, i8* %270)
store i32 %271, i32* %10
br label %284
272: ; preds = %256
%273 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%274 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%275 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%276 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%277 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%278 = load i32, i32* %16
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i8, i8* %277, i64 %279
%281 = load i32*, i32** %12
%282 = load i8*, i8** %3
%283 = call i32 @npc_parse_script(i8* %273, i8* %274, i8* %275, i8* %276, i8* %280, i32* %281, i32* %9, i8* %282)
store i32 %283, i32* %10
br label %284
284: ; preds = %272, %260
br label %356
285: ; preds = %253, %249
store i32 0, i32* %14
%286 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%287 = call i32 (i8*, i8*, ...) @sscanf(i8* %286, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32* %14)
%288 = load i32, i32* %14
%289 = icmp sgt i32 %288, 0
br i1 %289, label %290, label %297
290: ; preds = %285
%291 = load i32, i32* %14
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 %292
%294 = load i8, i8* %293
%295 = sext i8 %294 to i32
%296 = icmp eq i32 %295, 40
br label %297
297: ; preds = %290, %285
%298 = phi i1 [ false, %285 ], [ %296, %290 ]
br i1 %298, label %299, label %314
299: ; preds = %297
%300 = load i32, i32* %17
%301 = icmp sgt i32 %300, 3
br i1 %301, label %302, label %314
302: ; preds = %299
%303 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%304 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%305 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%306 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%307 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%308 = load i32, i32* %16
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds i8, i8* %307, i64 %309
%311 = load i32*, i32** %12
%312 = load i8*, i8** %3
%313 = call i32 @npc_parse_script(i8* %303, i8* %304, i8* %305, i8* %306, i8* %310, i32* %311, i32* %9, i8* %312)
store i32 %313, i32* %10
br label %355
314: ; preds = %299, %297
%315 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%316 = call i64 @strcasecmp(i8* %315, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%317 = icmp eq i64 %316, 0
br i1 %317, label %318, label %328
318: ; preds = %314
%319 = load i32, i32* %17
%320 = icmp sgt i32 %319, 3
br i1 %320, label %321, label %328
321: ; preds = %318
%322 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%323 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%324 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%325 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%326 = load i32, i32* %9
%327 = call i32 @npc_parse_mob(i8* %322, i8* %323, i8* %324, i8* %325, i32 %326)
store i32 %327, i32* %10
br label %354
328: ; preds = %318, %314
%329 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%330 = call i64 @strcasecmp(i8* %329, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%331 = icmp eq i64 %330, 0
br i1 %331, label %332, label %342
332: ; preds = %328
%333 = load i32, i32* %17
%334 = icmp sge i32 %333, 3
br i1 %334, label %335, label %342
335: ; preds = %332
%336 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%337 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%338 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%339 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%340 = load i32, i32* %9
%341 = call i32 @npc_parse_mapflag(i8* %336, i8* %337, i8* %338, i8* %339, i32 %340)
store i32 %341, i32* %10
br label %353
342: ; preds = %332, %328
%343 = load i8*, i8** %13
%344 = load i8*, i8** %3
%345 = load i32, i32* %9
%346 = load i8*, i8** %13
%347 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%348 = call i32 @strlen(i8* %347)
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds i8, i8* %346, i64 %349
%351 = getelementptr inbounds i8, i8* %350, i64 1
%352 = call i32 @script_error(i8* %343, i8* %344, i32 %345, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %351)
br label %364
353: ; preds = %335
br label %354
354: ; preds = %353, %321
br label %355
355: ; preds = %354, %302
br label %356
356: ; preds = %355, %284
br label %357
357: ; preds = %356, %242
br label %358
358: ; preds = %357, %218
br label %359
359: ; preds = %358, %200
%360 = load i32, i32* %10
%361 = icmp ne i32 %360, 0
br i1 %361, label %362, label %363
362: ; preds = %359
br label %364
363: ; preds = %359
br label %28
364: ; preds = %362, %342, %186, %149, %28
%365 = load i32*, i32** %12
%366 = call i32 @fclose(i32* %365)
%367 = load i32, i32* %11
%368 = icmp ne i32 %367, 0
br i1 %368, label %369, label %372
369: ; preds = %364
%370 = load i8*, i8** %3
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* %370)
br label %374
372: ; preds = %364
%373 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
br label %374
374: ; preds = %372, %369
%375 = call i32 @parse_script_line_curly(i32* null, i32 0, i32 0)
store i32 1, i32* %2
br label %376
376: ; preds = %374, %24
%377 = load i32, i32* %2
ret i32 %377
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [34 x i8] c"reading npc file not found : %s\07\0A\00"
@.str.2 = [46 x i8] c"%4095[^\09]\09%4095[^\09]\09%4095[^\09\0D\0A]\09%n%4095[^\09\0D\0A]\00"
@.str.3 = [27 x i8] c"%4095s%4095s%4095s%n%4095s\00"
@.str.4 = [22 x i8] c"npc file syntax error\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [9 x i8] c"function\00"
@.str.7 = [10 x i8] c"%4095[^,]\00"
@.str.8 = [5 x i8] c".gat\00"
@.str.9 = [5 x i8] c"warp\00"
@.str.10 = [5 x i8] c"shop\00"
@.str.11 = [10 x i8] c"pointshop\00"
@.str.12 = [11 x i8] c"substore%n\00"
@.str.13 = [7 x i8] c"script\00"
@.str.14 = [12 x i8] c"duplicate%n\00"
@.str.15 = [8 x i8] c"monster\00"
@.str.16 = [8 x i8] c"mapflag\00"
@.str.17 = [19 x i8] c"Missing */ on %s\07\0A\00"
define i32 @npc_parse_srcfile(i8* %0) {
%2 = alloca [4096 x i8]
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = alloca [4096 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4096 x i8]
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%17 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%18 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%19 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %27, label %21
21: ; preds = %1
%22 = bitcast i32* %9 to i8*
%23 = bitcast i32* %10 to i8*
%24 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%25 = call i64 @fgets(i8* %12, i32 4096, i32* %19)
%26 = icmp eq i64 %25, 0
br i1 %26, label %213, label %29
27: ; preds = %1
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %223
29: ; preds = %21, %210
store i32 0, i32* %9
store i32 0, i32* %10
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
%32 = load i8, i8* %12
%33 = icmp eq i8 %32, 0
br i1 %33, label %85, label %34
34: ; preds = %29, %77
%35 = phi i8 [ %83, %77 ], [ %32, %29 ]
%36 = phi i32 [ %80, %77 ], [ 0, %29 ]
%37 = phi i32 [ %79, %77 ], [ 0, %29 ]
%38 = sext i8 %35 to i32
switch i32 %38, label %71 [
i32 32, label %39
i32 9, label %63
]
39: ; preds = %34
%40 = icmp eq i32 %37, 0
br i1 %40, label %47, label %41
41: ; preds = %39
%42 = add nsw i32 %37, -1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 44
br i1 %46, label %77, label %47
47: ; preds = %41, %39
%48 = add nsw i32 %36, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 0
br i1 %52, label %71, label %53
53: ; preds = %47
%54 = call i32 @isspace(i8 zeroext %51)
%55 = icmp eq i32 %54, 0
%56 = load i32, i32* %9
br i1 %55, label %57, label %77
57: ; preds = %53
%58 = add nsw i32 %56, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 44
br i1 %62, label %77, label %71
63: ; preds = %34
%64 = icmp eq i32 %37, 0
br i1 %64, label %71, label %65
65: ; preds = %63
%66 = add nsw i32 %37, -1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 9
br i1 %70, label %77, label %71
71: ; preds = %34, %63, %65, %57, %47
%72 = phi i8 [ 32, %47 ], [ 32, %57 ], [ 9, %65 ], [ 9, %63 ], [ %35, %34 ]
%73 = phi i32 [ %36, %47 ], [ %56, %57 ], [ %36, %65 ], [ %36, %63 ], [ %36, %34 ]
%74 = add nsw i32 %37, 1
%75 = sext i32 %37 to i64
%76 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %75
store i8 %72, i8* %76
br label %77
77: ; preds = %71, %53, %65, %41, %57
%78 = phi i32 [ %36, %65 ], [ %56, %57 ], [ %36, %41 ], [ %56, %53 ], [ %73, %71 ]
%79 = phi i32 [ %37, %65 ], [ %37, %57 ], [ %37, %41 ], [ %37, %53 ], [ %74, %71 ]
%80 = add nsw i32 %78, 1
store i32 %80, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, 0
br i1 %84, label %85, label %34
85: ; preds = %77, %29
%86 = phi i32 [ 0, %29 ], [ %79, %77 ]
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %87
store i8 0, i8* %88
%89 = call i8* @npc_skip_line(i8* %12, i32* %8)
%90 = icmp eq i8* %89, null
br i1 %90, label %210, label %91
91: ; preds = %85
%92 = call i32 (i8*, i8*, ...) @sscanf(i8* %89, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %14, i8* %15, i32* %10, i8* %16)
%93 = icmp slt i32 %92, 3
br i1 %93, label %94, label %103
94: ; preds = %91
%95 = call i32 (i8*, i8*, ...) @sscanf(i8* %89, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %13, i8* %14, i8* %15, i32* %10, i8* %16)
%96 = icmp slt i32 %95, 3
br i1 %96, label %97, label %103
97: ; preds = %94
%98 = load i32, i32* %7
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %89, i64 %100
%102 = call i32 @script_error(i8* %89, i8* %0, i32 %98, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %101)
br label %209
103: ; preds = %94, %91
%104 = phi i32 [ %95, %94 ], [ %92, %91 ]
%105 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %125, label %107
107: ; preds = %103
%108 = call i64 @strcasecmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %125, label %110
110: ; preds = %107
%111 = call i32 (i8*, i8*, ...) @sscanf(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %24)
%112 = call i32 @strlen(i8* %24)
%113 = add i32 %112, -25
%114 = icmp ult i32 %113, -20
br i1 %114, label %122, label %115
115: ; preds = %110
%116 = zext i32 %112 to i64
%117 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %116
%118 = getelementptr inbounds i8, i8* %117, i64 -4
%119 = call i64 @strcmp(i8* %118, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %121, label %122
121: ; preds = %115
br label %125
122: ; preds = %110, %115
%123 = load i32, i32* %7
%124 = call i32 @script_error(i8* %89, i8* %0, i32 %123, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %89)
br label %209
125: ; preds = %121, %107, %103
%126 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
%128 = icmp ugt i32 %104, 3
%129 = and i1 %128, %127
br i1 %129, label %130, label %133
130: ; preds = %125
%131 = load i32, i32* %7
%132 = call i32 @npc_parse_warp(i8* %13, i8* %14, i8* %15, i8* %16, i32 %131)
br label %205
133: ; preds = %125
%134 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%135 = icmp eq i64 %134, 0
br i1 %135, label %140, label %136
136: ; preds = %133
%137 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
%139 = and i1 %128, %138
br i1 %139, label %141, label %144
140: ; preds = %133
br i1 %128, label %141, label %144
141: ; preds = %136, %140
%142 = load i32, i32* %7
%143 = call i32 @npc_parse_shop(i8* %13, i8* %14, i8* %15, i8* %16, i32 %142)
br label %205
144: ; preds = %140, %136
store i32 0, i32* %9
%145 = call i32 (i8*, i8*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32* %9)
%146 = load i32, i32* %9
%147 = icmp sgt i32 %146, 0
br i1 %147, label %148, label %157
148: ; preds = %144
%149 = zext i32 %146 to i64
%150 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %149
%151 = load i8, i8* %150
%152 = icmp eq i8 %151, 40
%153 = and i1 %128, %152
br i1 %153, label %154, label %157
154: ; preds = %148
%155 = load i32, i32* %7
%156 = call i32 @npc_parse_shop(i8* %13, i8* %14, i8* %15, i8* %16, i32 %155)
br label %205
157: ; preds = %144, %148
%158 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%159 = icmp eq i64 %158, 0
%160 = and i1 %128, %159
br i1 %160, label %161, label %171
161: ; preds = %157
%162 = call i64 @strcasecmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%163 = icmp eq i64 %162, 0
%164 = load i32, i32* %10
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %165
br i1 %163, label %167, label %169
167: ; preds = %161
%168 = call i32 @npc_parse_function(i8* %13, i8* %14, i8* %15, i8* %16, i8* %166, i32* %19, i32* %7, i8* %0)
br label %205
169: ; preds = %161
%170 = call i32 @npc_parse_script(i8* %13, i8* %14, i8* %15, i8* %16, i8* %166, i32* %19, i32* %7, i8* %0)
br label %205
171: ; preds = %157
store i32 0, i32* %9
%172 = call i32 (i8*, i8*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32* %9)
%173 = load i32, i32* %9
%174 = icmp sgt i32 %173, 0
br i1 %174, label %175, label %186
175: ; preds = %171
%176 = zext i32 %173 to i64
%177 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = icmp eq i8 %178, 40
%180 = and i1 %128, %179
br i1 %180, label %181, label %186
181: ; preds = %175
%182 = load i32, i32* %10
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %183
%185 = call i32 @npc_parse_script(i8* %13, i8* %14, i8* %15, i8* %16, i8* %184, i32* %19, i32* %7, i8* %0)
br label %205
186: ; preds = %171, %175
%187 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%188 = icmp eq i64 %187, 0
%189 = and i1 %128, %188
br i1 %189, label %190, label %193
190: ; preds = %186
%191 = load i32, i32* %7
%192 = call i32 @npc_parse_mob(i8* %13, i8* %14, i8* %15, i8* %16, i32 %191)
br label %205
193: ; preds = %186
%194 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%195 = icmp eq i64 %194, 0
%196 = load i32, i32* %7
br i1 %195, label %197, label %199
197: ; preds = %193
%198 = call i32 @npc_parse_mapflag(i8* %13, i8* %14, i8* %15, i8* %16, i32 %196)
br label %205
199: ; preds = %193
%200 = call i32 @strlen(i8* %13)
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i8, i8* %89, i64 %201
%203 = getelementptr inbounds i8, i8* %202, i64 1
%204 = call i32 @script_error(i8* %89, i8* %0, i32 %196, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %203)
br label %209
205: ; preds = %141, %169, %167, %190, %197, %181, %154, %130
%206 = phi i32 [ %132, %130 ], [ %143, %141 ], [ %156, %154 ], [ %168, %167 ], [ %170, %169 ], [ %185, %181 ], [ %192, %190 ], [ %198, %197 ]
%207 = icmp eq i32 %206, 0
br i1 %207, label %210, label %208
208: ; preds = %205
br label %213
209: ; preds = %97, %199, %122
br label %213
210: ; preds = %205, %85
%211 = call i64 @fgets(i8* %12, i32 4096, i32* %19)
%212 = icmp eq i64 %211, 0
br i1 %212, label %213, label %29
213: ; preds = %210, %21, %208, %209
%214 = call i32 @fclose(i32* %19)
%215 = load i32, i32* %8
%216 = icmp eq i32 %215, 0
br i1 %216, label %219, label %217
217: ; preds = %213
%218 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* %0)
br label %221
219: ; preds = %213
%220 = call i32 @putchar(i32 13)
br label %221
221: ; preds = %219, %217
%222 = call i32 @parse_script_line_curly(i32* null, i32 0, i32 0)
br label %223
223: ; preds = %221, %27
%224 = phi i32 [ 0, %27 ], [ 1, %221 ]
ret i32 %224
}