// File: /workspace/github_c_makefile_star2_O1/arachsys[P]init/daemon.c
// Function: main
int main(int argc, char **argv) {
  char *dir = NULL, *options, *path;
  int fd, inotify, option, pwd, tail, waitargs;
  size_t doublefork = 0, limit = -1, restart = 0;
  struct passwd *user;

  /* Redirect stdin from /dev/null. */
  if ((fd = open("/dev/null", O_RDWR)) < 0)
    err(EXIT_FAILURE, "open /dev/null");
  if (fd != STDIN_FILENO) {
    if ((dup2(fd, STDIN_FILENO)) < 0)
      err(EXIT_FAILURE, "dup2");
    close(fd);
  }

  /* Redirect stdout and/or stderr to /dev/null if closed. */
  if (fcntl(STDOUT_FILENO, F_GETFD) < 0 && errno == EBADF)
    if ((dup2(STDIN_FILENO, STDOUT_FILENO)) < 0)
      err(EXIT_FAILURE, "dup2");
  if (fcntl(STDERR_FILENO, F_GETFD) < 0 && errno == EBADF)
    if ((dup2(STDIN_FILENO, STDERR_FILENO)) < 0)
      err(EXIT_FAILURE, "dup2");

  options = "+:cd:fl:n:p:rs:t:u:w:", waitargs = 0;
  while ((option = getopt(argc, argv, options)) > 0)
    switch (option) {
      case 'c':
        /* Special case of -d DIR, for compatibility with BSD daemon(1). */
        dir = "/";
        break;
      case 'd':
        dir = optarg;
        if ((fd = open(dir, O_RDONLY | O_DIRECTORY)) < 0)
          err(EXIT_FAILURE, "%s", dir);
        close(fd);
        break;
      case 'f':
        doublefork = 1;
        break;
      case 'l':
        logger_setup(optarg);
        break;
      case 'n':
        if (sscanf(optarg, "%zu%n", &limit, &tail) >= 1)
          if (optarg[tail] == 0)
            break;
        errx(EXIT_FAILURE, "Invalid connection limit");
      case 'p':
        pidfile_open(optarg);
        break;
      case 'r':
        restart = 1;
        break;
      case 's':
        listen_unix(optarg);
        break;
      case 't':
        listen_tcp(optarg);
        break;
      case 'u':
        if (sscanf(optarg, "%u:%u%n", &uid, &gid, &tail) >= 2)
          if (optarg[tail] == 0)
            break;
        if ((user = getpwnam(optarg))) {
          uid = user->pw_uid;
          gid = user->pw_gid;
          break;
        }
        errx(EXIT_FAILURE, "Invalid username");
      case 'w':
        waitargs++;
        break;
      default:
        usage(argv[0]);
    }

  /* When run with just -w arguments, we await paths in the foreground. */
  if (waitargs > 0 && argc == 2 * waitargs + 1)
    goto await;

  if (argc <= optind)
    usage(argv[0]);

  /* Fork into the background then create a session and process group. */
  switch (fork()) {
    case -1:
      err(EXIT_FAILURE, "fork");
    case 0:
      setsid(); /* Ignore errors but should always work after fork. */
      break;
    default:
      _exit(EXIT_SUCCESS); /* Don't delete pidfile in atexit() handler. */
  }

  if (doublefork) {
    /* Fork again to ensure we are not the session leader. */
    switch (fork()) {
      case -1:
        err(EXIT_FAILURE, "fork");
      case 0:
        break;
      default:
        _exit(EXIT_SUCCESS); /* Don't delete pidfile in atexit() handler. */
    }
  }

  logger_start();
  pidfile_write();

await:
  if (waitargs > 0) {
    if ((inotify = inotify_init1(IN_CLOEXEC | IN_NONBLOCK)) < 0)
      err(EXIT_FAILURE, "inotify_init1");

    /* Open the working directory so we can restore it after each await(). */
    if ((pwd = open(".", O_RDONLY | O_DIRECTORY)) < 0)
      err(EXIT_FAILURE, "open pwd");

    optind = 0; /* Need to reset optind to reprocess -w arguments. */
    while ((option = getopt(argc, argv, options)) > 0)
      if (option == 'w') {
        if (!(path = strdup(optarg)))
          err(EXIT_FAILURE, "strdup");
        await(path, inotify, 0);
        free(path);
        if (fchdir(pwd) < 0)
          err(EXIT_FAILURE, "fchdir");
      }

    close(inotify);
    close(pwd);
  }

  /* Exit if we were just awaiting paths in the foreground. */
  if (argc <= optind)
    return EXIT_SUCCESS;

  if (dir && chdir(dir) < 0)
    err(EXIT_FAILURE, "chdir");

  /* If we don't need to supervise it, just exec the command. */
  if (!restart && !pidfile.path && !listeners)
    execute(argv + optind);

  /* Use a signals pipe to avoid async-unsafe handlers. */
  if (pipe2(signals, O_CLOEXEC) < 0)
    err(EXIT_FAILURE, "pipe");

  /* Avoid using SIG_IGN as this disposition persists across exec. */
  signal(SIGHUP, signal_put);
  signal(SIGINT, signal_put);
  signal(SIGPIPE, signal_put);
  signal(SIGTERM, signal_put);
  signal(SIGCHLD, signal_put);
  signal(SIGUSR1, signal_put);
  signal(SIGUSR2, signal_put);

  if (listeners > 0)
    return serve(argv + optind, limit);
  return supervise(argv + optind, restart);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
movq $-0x1, 0x40(%rsp)
leaq 0x1b49(%rip), %rdi      # 0x407d
movl $0x2, %esi
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x3190
je 0x2566
movl %eax, %r14d
movl %eax, %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl %r14d, %edi
callq 0x2140
movl $0x1, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2090
testl %eax, %eax
jns 0x2599
callq 0x2040
cmpl $0x9, (%rax)
jne 0x2599
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
xorl %r12d, %r12d
movl $0x2, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2090
testl %eax, %eax
movq 0x8(%rsp), %r14
jns 0x25d4
callq 0x2040
cmpl $0x9, (%rax)
jne 0x25d4
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
leaq 0x1ab1(%rip), %rdx      # 0x408c
movl %ebp, %edi
movq %r14, %rsi
callq 0x22d0
testl %eax, %eax
jle 0x2b4c
leaq 0x1a10(%rip), %r12      # 0x4004
leaq 0x1a91(%rip), %r13      # 0x408c
leaq 0x80(%rsp), %r15
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
addl $-0x63, %eax
cmpl $0x14, %eax
ja 0x316e
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x20b6(%rip), %rax      # 0x46f2
movq %rax, 0x18(%rsp)
jmp 0x2b26
movq %rbx, 0x38(%rsp)
movq %r12, %rbx
movl %ebp, %r12d
movq %r15, %rbp
movq 0x397d(%rip), %r15      # 0x5fd8
movq (%r15), %rdi
leaq 0x1a5c(%rip), %rsi      # 0x40c1
leaq 0x3b8c(%rip), %rdx      # 0x61f8
leaq 0x3b89(%rip), %rcx      # 0x61fc
leaq 0x14(%rsp), %r8
xorl %eax, %eax
callq 0x2240
cmpl $0x2, %eax
jl 0x2692
movq (%r15), %rax
movslq 0x14(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x26b5
movq (%r15), %rdi
callq 0x21c0
testq %rax, %rax
je 0x3176
movl 0x10(%rax), %ecx
movl %ecx, 0x3b4c(%rip)      # 0x61f8
movl 0x14(%rax), %eax
movl %eax, 0x3b47(%rip)      # 0x61fc
movq %rbp, %r15
movl %r12d, %ebp
movq %rbx, %r12
movq 0x38(%rsp), %rbx
jmp 0x2b26
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
jmp 0x2b26
movq 0x38f8(%rip), %rax      # 0x5fd8
movq (%rax), %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movl $0x1, 0x58(%rsp)
movq %r13, %rdi
leaq 0x1ac6(%rip), %rsi      # 0x41cd
movq %r15, %rdx
leaq 0x180(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x2240
cmpl $0x2, %eax
je 0x276c
movq %r13, %rdi
leaq 0x1ab5(%rip), %rsi      # 0x41e0
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2240
cmpl $0x2, %eax
je 0x276c
movq %r13, %rdi
leaq 0x1aa1(%rip), %rsi      # 0x41e8
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
cmpl $0x1, %eax
jne 0x323e
movb $0x0, 0x82(%rsp)
movw $0x3a3a, 0x80(%rsp)     # imm = 0x3A3A
movq %r15, %rdi
movq %r14, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x2350
testl %eax, %eax
jne 0x311f
movq 0x48(%rsp), %r14
testq %r14, %r14
je 0x2aa1
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
xorl %edx, %edx
callq 0x23b0
testl %eax, %eax
js 0x309c
movl %eax, %r13d
movl $0x1, 0x2c(%rsp)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
leaq 0x2c(%rsp), %rcx
movl $0x4, %r8d
callq 0x2080
movl %r13d, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x2090
movl %r13d, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x2090
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %r13d, %edi
callq 0x2290
testl %eax, %eax
js 0x3093
movl %r13d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x2250
testl %eax, %eax
js 0x30a5
movl %r13d, %edi
callq 0x36af
movq 0x28(%r14), %r14
jmp 0x278e
movq 0x3796(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x1856(%rip), %rsi      # 0x40a2
leaq 0x40(%rsp), %rdx
leaq 0x14(%rsp), %rcx
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
jle 0x30fc
movq 0x376c(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movslq 0x14(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x2b26
jmp 0x30fc
movq 0x374e(%rip), %rax      # 0x5fd8
movq (%rax), %r13
movq %r13, %rdi
movl $0x80042, %esi          # imm = 0x80042
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22c0
movl %eax, 0x3961(%rip)      # 0x6208
testl %eax, %eax
js 0x30e8
movl %eax, %edi
movl $0x6, %esi
callq 0x2300
testl %eax, %eax
js 0x3143
movq %r13, %rdi
xorl %esi, %esi
callq 0x21e0
movq %rax, 0x392c(%rip)      # 0x6200
testq %rax, %rax
je 0x30e8
movl 0x3925(%rip), %edi      # 0x6208
xorl %esi, %esi
callq 0x2130
testl %eax, %eax
js 0x30e8
leaq 0xd92(%rip), %rdi       # 0x368b
callq 0x3780
jmp 0x2aa6
movl $0x1, %eax
movq %rax, 0x30(%rsp)
jmp 0x2b26
movq 0x36bf(%rip), %rax      # 0x5fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x20c0
cmpq $0x6d, %rax
jae 0x313a
movq %rax, %r13
movw $0x1, 0x80(%rsp)
movl $0x6c, %edx
leaq 0x82(%rsp), %rdi
movq %r14, %rsi
callq 0x2060
movq %r14, %rdi
callq 0x2050
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x23b0
testl %eax, %eax
js 0x309c
movl %eax, %r14d
movl %eax, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x2090
movl %r14d, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x2090
addl $0x2, %r13d
movl %r14d, %edi
movq %r15, %rsi
movl %r13d, %edx
callq 0x2290
testl %eax, %eax
js 0x3093
movl %r14d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x2250
testl %eax, %eax
leaq 0x16c1(%rip), %r13      # 0x408c
js 0x30a5
movl %r14d, %edi
callq 0x36af
movq 0x8(%rsp), %r14
jmp 0x2b26
cmpq $0x0, 0x383d(%rip)      # 0x6228
jne 0x314f
movq 0x35e0(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movzbl (%rdi), %eax
cmpl $0x3a, %eax
je 0x3105
testl %eax, %eax
je 0x3105
callq 0x2360
movq %rax, 0x380d(%rip)      # 0x6228
testq %rax, %rax
je 0x30c0
cmpb $0x2f, (%rax)
jne 0x2aaf
movq %rax, %rdi
movl $0x442, %esi            # imm = 0x442
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22c0
movl %eax, 0x37e9(%rip)      # 0x6230
testl %eax, %eax
js 0x31e7
movl %eax, %edi
movl $0x6, %esi
callq 0x2300
testl %eax, %eax
jns 0x2b26
jmp 0x31d2
movq 0x3569(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movq %rdi, 0x18(%rsp)
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x3158
movl %eax, %edi
callq 0x2140
jmp 0x2b26
movl $0x1, %ebx
jmp 0x2b26
movq 0x8(%rsp), %r14
leaq 0x15df(%rip), %r13      # 0x408c
jmp 0x2b26
movq %rax, %rdi
movl $0x3a, %esi
callq 0x2100
movq %rax, 0x375d(%rip)      # 0x6220
testq %rax, %rax
je 0x2ae9
movq %rax, %rcx
incq %rcx
movq %rcx, 0x374b(%rip)      # 0x6220
movb $0x0, (%rax)
cmpb $0x0, 0x1(%rax)
jne 0x2ae9
movq $0x0, 0x3737(%rip) # 0x6220
callq 0x23a0
testl %eax, %eax
je 0x31b2
cmpl $-0x1, %eax
je 0x3113
movl %eax, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
js 0x31a6
movzwl 0x80(%rsp), %eax
testl $0xff7f, %eax           # imm = 0xFF7F
jne 0x319c
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22d0
testl %eax, %eax
jg 0x2620
cmpq $0x0, 0x30(%rsp)
sete %r15b
movq 0x20(%rsp), %r12
jmp 0x2b5a
movb $0x1, %r15b
movq $0x0, 0x18(%rsp)
xorl %ebx, %ebx
testl %r12d, %r12d
jle 0x2b6f
leal 0x1(,%r12,2), %eax
cmpl %ebp, %eax
je 0x2cce
movq 0x345a(%rip), %rax      # 0x5fd0
cmpl %ebp, (%rax)
jge 0x320d
callq 0x23a0
testl %eax, %eax
jne 0x310e
callq 0x2170
testb %r15b, %r15b
jne 0x2ba2
callq 0x23a0
testl %eax, %eax
jne 0x310e
movq 0x367f(%rip), %rax      # 0x6228
testq %rax, %rax
je 0x2bfa
cmpb $0x2f, (%rax)
jne 0x2c23
movl 0x3677(%rip), %edi      # 0x6230
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x365f(%rip), %edi      # 0x6230
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x3647(%rip), %edi      # 0x6230
leal -0x3(%rdi), %eax
cmpl $-0x2, %eax
jb 0x2c93
jmp 0x2c98
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
jns 0x2c98
jmp 0x308a
leaq 0x80(%rsp), %rdi
callq 0x2160
testl %eax, %eax
js 0x3201
callq 0x23a0
testl %eax, %eax
je 0x32c0
cmpl $-0x1, %eax
je 0x3113
movl 0x84(%rsp), %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x84(%rsp), %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x80(%rsp), %edi
callq 0x2140
movl 0x84(%rsp), %edi
callq 0x2140
cmpq $0x0, 0x3560(%rip)      # 0x6200
je 0x2cce
movl 0x355f(%rip), %r14d     # 0x6208
callq 0x20b0
leaq 0x1a22(%rip), %rsi      # 0x46d7
movl %r14d, %edi
movq 0x8(%rsp), %r14
movl %eax, %edx
xorl %eax, %eax
callq 0x2150
testl %eax, %eax
js 0x32b4
testl %r12d, %r12d
jle 0x2da5
movl $0x80800, %edi          # imm = 0x80800
callq 0x2390
testl %eax, %eax
js 0x3215
movl %eax, %r15d
movl %ebp, %r13d
leaq 0x13f7(%rip), %rdi      # 0x40ed
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x3221
movl %eax, %r12d
movq 0x32bc(%rip), %rax      # 0x5fd0
movl $0x0, (%rax)
leaq 0x136b(%rip), %rdx      # 0x408c
movl %r13d, %ebp
movl %r13d, %edi
movq %r14, %rsi
callq 0x22d0
testl %eax, %eax
jle 0x2d95
leaq 0x1352(%rip), %r13      # 0x408c
cmpl $0x77, %eax
jne 0x2d84
movq 0x3292(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
callq 0x2360
testq %rax, %rax
je 0x30c0
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3374
movq %r14, %rdi
callq 0x2030
movl %r12d, %edi
callq 0x2260
testl %eax, %eax
movq 0x8(%rsp), %r14
js 0x30c9
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22d0
testl %eax, %eax
jg 0x2d3a
movl %r15d, %edi
callq 0x2140
movl %r12d, %edi
callq 0x2140
movq 0x3224(%rip), %r15      # 0x5fd0
cmpl %ebp, (%r15)
jge 0x3046
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2dcc
callq 0x20d0
testl %eax, %eax
js 0x31c6
testq %rbx, %rbx
jne 0x2de9
cmpq $0x0, 0x3427(%rip)      # 0x6200
jne 0x2de9
cmpq $0x0, 0x342d(%rip)      # 0x6210
je 0x322d
leaq 0x3428(%rip), %rdi      # 0x6218
movl $0x80000, %esi          # imm = 0x80000
callq 0x2320
testl %eax, %eax
js 0x3201
leaq 0x849(%rip), %r14       # 0x3652
movl $0x1, %edi
movq %r14, %rsi
callq 0x21b0
movl $0x2, %edi
movq %r14, %rsi
callq 0x21b0
movl $0xd, %edi
movq %r14, %rsi
callq 0x21b0
movl $0xf, %edi
movq %r14, %rsi
callq 0x21b0
movl $0x11, %edi
movq %r14, %rsi
callq 0x21b0
movl $0xa, %edi
movq %r14, %rsi
callq 0x21b0
movl $0xc, %edi
movq %r14, %rsi
callq 0x21b0
cmpq $0x0, 0x33a4(%rip)      # 0x6210
movslq (%r15), %r15
je 0x2fab
movq 0x40(%rsp), %rbx
movl 0x3398(%rip), %edi      # 0x6218
callq 0x36af
movq 0x33ac(%rip), %rax      # 0x6238
movq 0x337d(%rip), %rcx      # 0x6210
movw $0x1, -0x4(%rax,%rcx,8)
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpq %rbx, %r14
setb %bpl
movq 0x3363(%rip), %rsi      # 0x6210
cmpq $0x2, %rsi
jb 0x2ecd
movq 0x337e(%rip), %rax      # 0x6238
leaq -0x1(%rsi), %rcx
xorl %edx, %edx
movw %bp, 0x4(%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x2ec0
movq 0x3364(%rip), %rdi      # 0x6238
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2280
testl %eax, %eax
jns 0x2ef8
callq 0x2040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2ea6
cmpl $0xb, %eax
je 0x2ea6
jmp 0x305a
movq 0x3339(%rip), %rax      # 0x6238
movq 0x330a(%rip), %rcx      # 0x6210
testb $0x1, -0x2(%rax,%rcx,8)
je 0x2f42
callq 0x3713
cmpb $0x11, %al
je 0x2f39
movzbl %al, %eax
cmpl $0x2, %eax
je 0x3046
cmpl $0xf, %eax
jne 0x2f42
jmp 0x3046
subq $0x1, %r14
movl $0x0, %eax
cmovbq %rax, %r14
callq 0x374d
testl %eax, %eax
jg 0x2f2c
cmpq $0x2, 0x32c6(%rip)      # 0x6210
jb 0x2e9d
movl $0x1, %r12d
movq 0x32db(%rip), %rax      # 0x6238
testb $0x1, -0x2(%rax,%r12,8)
je 0x2f9a
cmpq %rbx, %r14
jae 0x2f9a
movl -0x8(%rax,%r12,8), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e0
testl %eax, %eax
js 0x2f9a
movl %eax, %ebp
callq 0x23a0
cmpl $-0x1, %eax
je 0x2f93
testl %eax, %eax
je 0x306d
incq %r14
movl %ebp, %edi
callq 0x2140
incq %r12
cmpq 0x326c(%rip), %r12      # 0x6210
jb 0x2f56
jmp 0x2e9d
xorl %r12d, %r12d
leaq 0x10a3(%rip), %r13      # 0x4058
callq 0x23a0
testl %eax, %eax
je 0x30d2
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x3113
xorl %edi, %edi
callq 0x2200
movq %rax, %r14
addq $0x5, %r14
callq 0x3713
movzbl %al, %ecx
leal -0xa(%rcx), %edx
cmpl $0x7, %edx
ja 0x300a
movslq (%r13,%rdx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
xorl %ebx, %ebx
jmp 0x3011
cmpl %ebp, %eax
cmovel %r12d, %ebp
callq 0x374d
testl %eax, %eax
jne 0x2ff9
jmp 0x301d
decl %ecx
cmpl $0x2, %ecx
jae 0x301d
movl %ebp, %edi
movl %eax, %esi
callq 0x21f0
xorl %r14d, %r14d
testl %ebp, %ebp
jne 0x2fdb
testl %ebx, %ebx
je 0x3046
xorl %edi, %edi
callq 0x2200
movl $0x1, %ebx
cmpq %r14, %rax
jge 0x2fb5
leaq 0x16ed(%rip), %rsi      # 0x472e
jmp 0x317d
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16b5(%rip), %rsi      # 0x4716
movl $0x1, %edi
xorl %eax, %eax
callq 0x2210
movl %ebp, %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl %ebp, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
jns 0x30ae
leaq 0xff6(%rip), %rsi       # 0x4087
jmp 0x3061
leaq 0x1118(%rip), %rsi      # 0x41b2
jmp 0x3061
leaq 0x1114(%rip), %rsi      # 0x41b7
jmp 0x3061
leaq 0x1112(%rip), %rsi      # 0x41be
jmp 0x3061
movq 0x8(%rsp), %rax
leaq (%rax,%r15,8), %rbx
movl %ebp, %edi
callq 0x2140
jmp 0x30e0
leaq 0x1031(%rip), %rsi      # 0x40f8
jmp 0x3061
leaq 0x102f(%rip), %rsi      # 0x40ff
jmp 0x3061
movq 0x8(%rsp), %rax
leaq (%rax,%r15,8), %rbx
callq 0x2170
movq %rbx, %rdi
callq 0x35f8
leaq 0x1126(%rip), %rsi      # 0x4215
movl $0x1, %edi
movq %r13, %rdx
jmp 0x31fa
leaq 0xfa5(%rip), %rsi       # 0x40a8
jmp 0x317d
leaq 0x1025(%rip), %rsi      # 0x4131
jmp 0x317d
cmpl $-0x1, %eax
jne 0x3189
leaq 0xfc0(%rip), %rsi       # 0x40da
jmp 0x3061
movl %eax, %edi
callq 0x2110
leaq 0x10db(%rip), %rsi      # 0x4208
movl $0x1, %edi
movq %rax, %rdx
jmp 0x324d
leaq 0x1056(%rip), %rsi      # 0x4197
jmp 0x317d
leaq 0x1010(%rip), %rsi      # 0x415a
jmp 0x3245
leaq 0xfb5(%rip), %rsi       # 0x410b
jmp 0x317d
leaq 0x10b6(%rip), %rsi      # 0x4215
movl $0x1, %edi
movq 0x18(%rsp), %rdx
jmp 0x31fa
movq %r14, %rdi
callq 0x23f4
leaq 0xf4c(%rip), %rsi       # 0x40c9
movl $0x1, %edi
xorl %eax, %eax
callq 0x20e0
xorl %edi, %edi
callq 0x2070
leaq 0xee1(%rip), %rsi       # 0x4078
jmp 0x3061
movl $0x1, %edi
callq 0x2330
leaq 0xfe2(%rip), %rsi       # 0x418f
jmp 0x3061
leaq 0x1539(%rip), %rdi      # 0x46f2
callq 0x20d0
testl %eax, %eax
jns 0x3254
leaq 0xf33(%rip), %rsi       # 0x4100
jmp 0x3061
movq 0x304f(%rip), %rdx      # 0x6228
leaq 0xf7a(%rip), %rsi       # 0x415a
movl $0x1, %edi
jmp 0x324d
movq 0x303a(%rip), %rdx      # 0x6228
leaq 0x1020(%rip), %rsi      # 0x4215
movl $0x1, %edi
xorl %eax, %eax
callq 0x2210
leaq 0xefe(%rip), %rsi       # 0x4106
jmp 0x3061
movq %r14, %rdi
callq 0x23d0
leaq 0xec3(%rip), %rsi       # 0x40df
jmp 0x3061
leaq 0xec7(%rip), %rsi       # 0x40ef
jmp 0x3061
movslq (%r15), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
callq 0x35f8
leaq 0xfac(%rip), %rsi       # 0x41f1
movl $0x1, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x20e0
movq 0x2fc5(%rip), %rax      # 0x6220
testq %rax, %rax
leaq 0xf14(%rip), %r9        # 0x4179
cmovneq %rax, %r9
subq $0x8, %rsp
leaq 0xf13(%rip), %r10       # 0x4187
leaq 0xef1(%rip), %rdi       # 0x416c
leaq 0xef1(%rip), %rdx       # 0x4173
leaq 0xdf4(%rip), %rcx       # 0x407d
leaq 0xee6(%rip), %r8        # 0x4176
movq %rdi, %rsi
xorl %eax, %eax
pushq $0x0
pushq 0x2f8b(%rip)            # 0x6228
pushq %r10
callq 0x2370
addq $0x20, %rsp
leaq 0xedb(%rip), %rsi       # 0x418a
jmp 0x3061
leaq 0x1420(%rip), %rsi      # 0x46db
jmp 0x3061
leaq 0x142b(%rip), %rdi      # 0x46f2
callq 0x20d0
testl %eax, %eax
js 0x31c6
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x80(%rsp), %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x308a
movl 0x80(%rsp), %edi
callq 0x2140
movl 0x84(%rsp), %edi
callq 0x2140
movq 0x2eef(%rip), %rax      # 0x6220
testq %rax, %rax
leaq 0xe3e(%rip), %rcx       # 0x4179
cmovneq %rax, %rcx
movq 0x2ee2(%rip), %r9       # 0x6228
subq $0x8, %rsp
leaq 0xe1b(%rip), %rdi       # 0x416c
leaq 0xe1e(%rip), %rdx       # 0x4176
leaq 0xe28(%rip), %r8        # 0x4187
movq %rdi, %rsi
xorl %eax, %eax
pushq $0x0
callq 0x2370
addq $0x10, %rsp
jmp 0x32a8