// File: /workspace/github_c_makefile_star2_O3/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, 0x4(%rsp)
movq $-0x1, 0x40(%rsp)
leaq 0x1ba3(%rip), %rdi      # 0x40d9
movl $0x2, %esi
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x348c
je 0x2568
movl %eax, %r14d
movl %eax, %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl %r14d, %edi
callq 0x2140
movl $0x1, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2090
testl %eax, %eax
jns 0x259b
callq 0x2040
cmpl $0x9, (%rax)
jne 0x259b
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl $0x2, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2090
testl %eax, %eax
movq 0x8(%rsp), %r14
jns 0x25d3
callq 0x2040
cmpl $0x9, (%rax)
jne 0x25d3
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
leaq 0x1b0e(%rip), %rdx      # 0x40e8
movl 0x4(%rsp), %edi
movq %r14, %rsi
callq 0x22d0
xorl %r15d, %r15d
testl %eax, %eax
jle 0x2b6c
leaq 0x1a68(%rip), %r12      # 0x4060
leaq 0x1ae9(%rip), %r13      # 0x40e8
leaq 0x80(%rsp), %rbp
leaq 0x180(%rsp), %r15
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
addl $-0x63, %eax
cmpl $0x14, %eax
ja 0x346a
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x2106(%rip), %rax      # 0x474e
movq %rax, 0x18(%rsp)
jmp 0x2b2d
movq %rbx, 0x38(%rsp)
movq %r12, %rbx
movq %r15, %r12
movq %rbp, %r15
movq 0x3971(%rip), %rbp      # 0x5fd8
movq (%rbp), %rdi
leaq 0x1aab(%rip), %rsi      # 0x411d
leaq 0x3b7f(%rip), %rdx      # 0x61f8
leaq 0x3b7c(%rip), %rcx      # 0x61fc
leaq 0x14(%rsp), %r8
xorl %eax, %eax
callq 0x2240
movq (%rbp), %rdi
cmpl $0x2, %eax
jl 0x26a0
movslq 0x14(%rsp), %rax
cmpb $0x0, (%rdi,%rax)
je 0x26c0
callq 0x21c0
testq %rax, %rax
je 0x3472
movl 0x10(%rax), %ecx
movl %ecx, 0x3b41(%rip)      # 0x61f8
movl 0x14(%rax), %eax
movl %eax, 0x3b3c(%rip)      # 0x61fc
movq %r15, %rbp
movq %r12, %r15
movq %rbx, %r12
movq 0x38(%rsp), %rbx
jmp 0x2b2d
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
jmp 0x2b2d
movq 0x38ed(%rip), %rax      # 0x5fd8
movq (%rax), %r13
pxor %xmm0, %xmm0
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movl $0x1, 0x58(%rsp)
movq %r13, %rdi
leaq 0x1b13(%rip), %rsi      # 0x4229
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2240
cmpl $0x2, %eax
je 0x2773
movq %r13, %rdi
leaq 0x1b0a(%rip), %rsi      # 0x423c
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2240
cmpl $0x2, %eax
je 0x2773
movq %r13, %rdi
leaq 0x1af6(%rip), %rsi      # 0x4244
movq %r15, %rdx
xorl %eax, %eax
callq 0x2240
cmpl $0x1, %eax
jne 0x359c
movb $0x0, 0x82(%rsp)
movw $0x3a3a, 0x80(%rsp)     # imm = 0x3A3A
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x2350
testl %eax, %eax
jne 0x341b
movq 0x48(%rsp), %r14
testq %r14, %r14
je 0x2aa8
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
xorl %edx, %edx
callq 0x23b0
testl %eax, %eax
js 0x3395
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 0x338c
movl %r13d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x2250
testl %eax, %eax
js 0x339e
movl %r13d, %edi
callq 0x399f
movq 0x28(%r14), %r14
jmp 0x2795
movq 0x378f(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0x18ab(%rip), %rsi      # 0x40fe
leaq 0x40(%rsp), %rdx
leaq 0x14(%rsp), %rcx
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
jle 0x33f8
movq 0x3765(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movslq 0x14(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x2b2d
jmp 0x33f8
movq 0x3747(%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, 0x395a(%rip)      # 0x6208
testl %eax, %eax
js 0x33e4
movl %eax, %edi
movl $0x6, %esi
callq 0x2300
testl %eax, %eax
js 0x343f
movq %r13, %rdi
xorl %esi, %esi
callq 0x21e0
movq %rax, 0x3925(%rip)      # 0x6200
testq %rax, %rax
je 0x33e4
movl 0x391e(%rip), %edi      # 0x6208
xorl %esi, %esi
callq 0x2130
testl %eax, %eax
js 0x33e4
leaq 0x107b(%rip), %rdi      # 0x397b
callq 0x3a70
jmp 0x2aad
movl $0x1, %eax
movq %rax, 0x30(%rsp)
jmp 0x2b2d
movq 0x36b8(%rip), %rax      # 0x5fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x20c0
cmpq $0x6d, %rax
jae 0x3436
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 0x3395
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 %rbp, %rsi
movl %r13d, %edx
callq 0x2290
testl %eax, %eax
js 0x338c
movl %r14d, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x2250
testl %eax, %eax
leaq 0x1716(%rip), %r13      # 0x40e8
js 0x339e
movl %r14d, %edi
callq 0x399f
movq 0x8(%rsp), %r14
jmp 0x2b2d
cmpq $0x0, 0x3836(%rip)      # 0x6228
jne 0x344b
movq 0x35d9(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movzbl (%rdi), %eax
cmpl $0x3a, %eax
je 0x3401
testl %eax, %eax
je 0x3401
callq 0x2360
movq %rax, 0x3806(%rip)      # 0x6228
testq %rax, %rax
je 0x33b9
cmpb $0x2f, (%rax)
jne 0x2ab6
movq %rax, %rdi
movl $0x442, %esi            # imm = 0x442
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22c0
movl %eax, 0x37e2(%rip)      # 0x6230
testl %eax, %eax
js 0x3537
movl %eax, %edi
movl $0x6, %esi
callq 0x2300
testl %eax, %eax
jns 0x2b2d
jmp 0x3522
movq 0x3562(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movq %rdi, 0x18(%rsp)
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x3454
movl %eax, %edi
callq 0x2140
jmp 0x2b2d
movl $0x1, %ebx
jmp 0x2b2d
movq 0x8(%rsp), %r14
leaq 0x1634(%rip), %r13      # 0x40e8
jmp 0x2b2d
movq %rax, %rdi
movl $0x3a, %esi
callq 0x2100
movq %rax, 0x3756(%rip)      # 0x6220
testq %rax, %rax
je 0x2af0
movq %rax, %rcx
incq %rcx
movq %rcx, 0x3744(%rip)      # 0x6220
movb $0x0, (%rax)
cmpb $0x0, 0x1(%rax)
jne 0x2af0
movq $0x0, 0x3730(%rip) # 0x6220
callq 0x23a0
testl %eax, %eax
je 0x34ae
cmpl $-0x1, %eax
je 0x340f
movl %eax, %edi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
js 0x34a2
movzwl 0x80(%rsp), %eax
testl $0xff7f, %eax           # imm = 0xFF7F
jne 0x3498
movl 0x4(%rsp), %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22d0
testl %eax, %eax
jg 0x262c
cmpq $0x0, 0x30(%rsp)
sete %r14b
movq 0x20(%rsp), %rax
testl %eax, %eax
jle 0x2b7c
leal 0x1(,%rax,2), %eax
movb $0x1, %r15b
cmpl 0x4(%rsp), %eax
jne 0x2b7f
jmp 0x2ce6
movb $0x1, %r14b
xorl %ebx, %ebx
movq $0x0, 0x18(%rsp)
jmp 0x2b7f
xorl %r15d, %r15d
movq 0x344a(%rip), %rax      # 0x5fd0
movl 0x4(%rsp), %ecx
cmpl %ecx, (%rax)
jge 0x3551
callq 0x23a0
testl %eax, %eax
jne 0x340a
callq 0x2170
testb %r14b, %r14b
jne 0x2bb6
callq 0x23a0
testl %eax, %eax
jne 0x340a
movq 0x366b(%rip), %rax      # 0x6228
testq %rax, %rax
je 0x2c0e
cmpb $0x2f, (%rax)
jne 0x2c37
movl 0x3663(%rip), %edi      # 0x6230
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x364b(%rip), %edi      # 0x6230
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x3633(%rip), %edi      # 0x6230
leal -0x3(%rdi), %eax
cmpl $-0x2, %eax
jb 0x2ca7
jmp 0x2cac
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
jns 0x2cac
jmp 0x3383
leaq 0x80(%rsp), %rdi
callq 0x2160
testl %eax, %eax
js 0x355b
callq 0x23a0
testl %eax, %eax
je 0x35b2
cmpl $-0x1, %eax
je 0x340f
movl 0x84(%rsp), %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x84(%rsp), %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x80(%rsp), %edi
callq 0x2140
movl 0x84(%rsp), %edi
callq 0x2140
cmpq $0x0, 0x354c(%rip)      # 0x6200
je 0x2cdd
movl 0x354b(%rip), %r14d     # 0x6208
callq 0x20b0
leaq 0x1a6a(%rip), %rsi      # 0x4733
movl %r14d, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x2150
testl %eax, %eax
js 0x357f
testb %r15b, %r15b
je 0x2db6
movl $0x80800, %edi          # imm = 0x80800
callq 0x2390
testl %eax, %eax
js 0x3567
movl %eax, %r15d
leaq 0x1447(%rip), %rdi      # 0x4149
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
movq 0x8(%rsp), %r14
js 0x3573
movl %eax, %r12d
movq 0x32ab(%rip), %rax      # 0x5fd0
movl $0x0, (%rax)
leaq 0x13b6(%rip), %rdx      # 0x40e8
movl 0x4(%rsp), %edi
movl %edi, %ebp
movq %r14, %rsi
callq 0x22d0
testl %eax, %eax
jle 0x2da6
leaq 0x139d(%rip), %r13      # 0x40e8
cmpl $0x77, %eax
jne 0x2d95
movq 0x3281(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
callq 0x2360
testq %rax, %rax
je 0x33b9
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x366e
movq %r14, %rdi
callq 0x2030
movl %r12d, %edi
callq 0x2260
testl %eax, %eax
movq 0x8(%rsp), %r14
js 0x33d8
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22d0
testl %eax, %eax
jg 0x2d4b
movl %r15d, %edi
callq 0x2140
movl %r12d, %edi
callq 0x2140
movq 0x3213(%rip), %r15      # 0x5fd0
movl 0x4(%rsp), %eax
cmpl %eax, (%r15)
jge 0x333f
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2de1
callq 0x20d0
testl %eax, %eax
js 0x35c2
testq %rbx, %rbx
jne 0x2dfe
cmpq $0x0, 0x3412(%rip)      # 0x6200
jne 0x2dfe
cmpq $0x0, 0x3418(%rip)      # 0x6210
je 0x358b
leaq 0x3413(%rip), %rdi      # 0x6218
movl $0x80000, %esi          # imm = 0x80000
callq 0x2320
testl %eax, %eax
js 0x355b
leaq 0xb24(%rip), %r14       # 0x3942
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, 0x338f(%rip)      # 0x6210
movslq (%r15), %r15
je 0x32a4
movq 0x40(%rsp), %rbx
movl 0x3383(%rip), %edi      # 0x6218
callq 0x399f
movq 0x3397(%rip), %rax      # 0x6238
movq 0x3368(%rip), %rsi      # 0x6210
movw $0x1, -0x4(%rax,%rsi,8)
xorl %r14d, %r14d
movdqa 0x1156(%rip), %xmm7     # 0x4010
movdqa 0x115d(%rip), %xmm8     # 0x4020
movdqa 0x1164(%rip), %xmm9     # 0x4030
movdqa 0x116b(%rip), %xmm10    # 0x4040
movdqa 0x1172(%rip), %xmm11    # 0x4050
pcmpeqd %xmm12, %xmm12
xorl %ebp, %ebp
cmpq %rbx, %r14
setb %bpl
movq 0x3345(%rip), %rdi      # 0x6238
cmpq $0x2, %rsi
jb 0x3125
leaq 0x6(%rsi), %rax
andq $-0x8, %rax
leaq -0x2(%rsi), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm11, %xmm0
xorl %ecx, %ecx
movq %rcx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, %xmm2
por %xmm10, %xmm2
pxor %xmm11, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm0, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm12, %xmm5
packssdw %xmm5, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x2f7b
movw %bp, 0x4(%rdi,%rcx,8)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm12, %xmm2
packssdw %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x2fa1
movw %bp, 0xc(%rdi,%rcx,8)
movdqa %xmm1, %xmm3
por %xmm9, %xmm3
pxor %xmm11, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm12, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x2, %xmm5, %edx
testb $0x1, %dl
je 0x2ff2
movw %bp, 0x14(%rdi,%rcx,8)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm12, %xmm2
packssdw %xmm2, %xmm2
pextrw $0x3, %xmm2, %edx
testb $0x1, %dl
je 0x3021
movw %bp, 0x1c(%rdi,%rcx,8)
movdqa %xmm1, %xmm2
por %xmm8, %xmm2
pxor %xmm11, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm0, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm12, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x3079
movw %bp, 0x24(%rdi,%rcx,8)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm12, %xmm2
packssdw %xmm2, %xmm2
pextrw $0x5, %xmm2, %edx
testb $0x1, %dl
je 0x309d
movw %bp, 0x2c(%rdi,%rcx,8)
por %xmm7, %xmm1
pxor %xmm11, %xmm1
movdqa %xmm1, %xmm3
pcmpgtd %xmm0, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
movdqa %xmm1, %xmm4
pand %xmm2, %xmm4
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm3, %xmm4
packssdw %xmm4, %xmm4
pxor %xmm12, %xmm4
packssdw %xmm4, %xmm4
pextrw $0x6, %xmm4, %edx
testb $0x1, %dl
je 0x30e9
movw %bp, 0x34(%rdi,%rcx,8)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm1
pshufhw $0x84, %xmm3, %xmm2     # xmm2 = xmm3[0,1,2,3,4,5,4,6]
por %xmm1, %xmm2
pxor %xmm12, %xmm2
packssdw %xmm2, %xmm1
pextrw $0x7, %xmm1, %edx
testb $0x1, %dl
je 0x3118
movw %bp, 0x3c(%rdi,%rcx,8)
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x2f1a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2280
testl %eax, %eax
jns 0x3185
callq 0x2040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3148
cmpl $0xb, %eax
jne 0x3353
movq 0x30c1(%rip), %rsi      # 0x6210
movdqa 0xeb9(%rip), %xmm7      # 0x4010
movdqa 0xec0(%rip), %xmm8      # 0x4020
movdqa 0xec7(%rip), %xmm9      # 0x4030
movdqa 0xece(%rip), %xmm10     # 0x4040
movdqa 0xed5(%rip), %xmm11     # 0x4050
pcmpeqd %xmm12, %xmm12
jmp 0x2eec
movq 0x30ac(%rip), %rax      # 0x6238
movq 0x307d(%rip), %rcx      # 0x6210
testb $0x1, -0x2(%rax,%rcx,8)
je 0x31cf
callq 0x39ff
cmpb $0x11, %al
je 0x31c6
movzbl %al, %eax
cmpl $0x2, %eax
je 0x333f
cmpl $0xf, %eax
jne 0x31cf
jmp 0x333f
subq $0x1, %r14
movl $0x0, %eax
cmovbq %rax, %r14
callq 0x3a39
testl %eax, %eax
jg 0x31b9
movq 0x303a(%rip), %rsi      # 0x6210
cmpq $0x2, %rsi
movdqa 0xe2e(%rip), %xmm7      # 0x4010
movdqa 0xe35(%rip), %xmm8      # 0x4020
movdqa 0xe3c(%rip), %xmm9      # 0x4030
movdqa 0xe43(%rip), %xmm10     # 0x4040
movdqa 0xe4a(%rip), %xmm11     # 0x4050
pcmpeqd %xmm12, %xmm12
jb 0x2ee3
movl $0x1, %r12d
movq 0x301a(%rip), %rax      # 0x6238
testb $0x1, -0x2(%rax,%r12,8)
je 0x328c
cmpq %rbx, %r14
jae 0x328c
movl -0x8(%rax,%r12,8), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e0
testl %eax, %eax
js 0x325b
movl %eax, %ebp
callq 0x23a0
cmpl $-0x1, %eax
je 0x3254
testl %eax, %eax
je 0x3366
incq %r14
movl %ebp, %edi
callq 0x2140
movdqa 0xdad(%rip), %xmm7      # 0x4010
movdqa 0xdb4(%rip), %xmm8      # 0x4020
movdqa 0xdbb(%rip), %xmm9      # 0x4030
movdqa 0xdc2(%rip), %xmm10     # 0x4040
movdqa 0xdc9(%rip), %xmm11     # 0x4050
pcmpeqd %xmm12, %xmm12
incq %r12
movq 0x2f7a(%rip), %rsi      # 0x6210
cmpq %rsi, %r12
jb 0x3217
jmp 0x2ee3
xorl %r12d, %r12d
leaq 0xe06(%rip), %r13       # 0x40b4
callq 0x23a0
testl %eax, %eax
je 0x33c2
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x340f
xorl %edi, %edi
callq 0x2200
movq %rax, %r14
addq $0x5, %r14
callq 0x39ff
movzbl %al, %ecx
leal -0xa(%rcx), %edx
cmpl $0x7, %edx
ja 0x3303
movslq (%r13,%rdx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
xorl %ebx, %ebx
jmp 0x330a
cmpl %ebp, %eax
cmovel %r12d, %ebp
callq 0x3a39
testl %eax, %eax
jne 0x32f2
jmp 0x3316
decl %ecx
cmpl $0x2, %ecx
jae 0x3316
movl %ebp, %edi
movl %eax, %esi
callq 0x21f0
xorl %r14d, %r14d
testl %ebp, %ebp
jne 0x32d4
testl %ebx, %ebx
je 0x333f
xorl %edi, %edi
callq 0x2200
movl $0x1, %ebx
cmpq %r14, %rax
jge 0x32ae
leaq 0x1450(%rip), %rsi      # 0x478a
jmp 0x3479
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1418(%rip), %rsi      # 0x4772
movl $0x1, %edi
xorl %eax, %eax
callq 0x2210
movl %ebp, %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl %ebp, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
jns 0x33a7
leaq 0xd59(%rip), %rsi       # 0x40e3
jmp 0x335a
leaq 0xe7b(%rip), %rsi       # 0x420e
jmp 0x335a
leaq 0xe77(%rip), %rsi       # 0x4213
jmp 0x335a
leaq 0xe75(%rip), %rsi       # 0x421a
jmp 0x335a
movq 0x8(%rsp), %rax
leaq (%rax,%r15,8), %rbx
movl %ebp, %edi
callq 0x2140
jmp 0x33d0
leaq 0xd94(%rip), %rsi       # 0x4154
jmp 0x335a
movq 0x8(%rsp), %rax
leaq (%rax,%r15,8), %rbx
callq 0x2170
movq %rbx, %rdi
callq 0x38e8
leaq 0xd7c(%rip), %rsi       # 0x415b
jmp 0x335a
leaq 0xe86(%rip), %rsi       # 0x4271
movl $0x1, %edi
movq %r13, %rdx
jmp 0x354a
leaq 0xd05(%rip), %rsi       # 0x4104
jmp 0x3479
leaq 0xd85(%rip), %rsi       # 0x418d
jmp 0x3479
cmpl $-0x1, %eax
jne 0x3485
leaq 0xd20(%rip), %rsi       # 0x4136
jmp 0x335a
movl %eax, %edi
callq 0x2110
leaq 0xe3b(%rip), %rsi       # 0x4264
movl $0x1, %edi
movq %rax, %rdx
jmp 0x35ab
leaq 0xdb6(%rip), %rsi       # 0x41f3
jmp 0x3479
leaq 0xd70(%rip), %rsi       # 0x41b6
jmp 0x35a3
leaq 0xd15(%rip), %rsi       # 0x4167
jmp 0x3479
leaq 0xe16(%rip), %rsi       # 0x4271
movl $0x1, %edi
movq 0x18(%rsp), %rdx
jmp 0x354a
movq %r14, %rdi
callq 0x23f4
leaq 0xcac(%rip), %rsi       # 0x4125
movl $0x1, %edi
xorl %eax, %eax
callq 0x20e0
xorl %edi, %edi
callq 0x2070
leaq 0xc41(%rip), %rsi       # 0x40d4
jmp 0x335a
movl $0x1, %edi
callq 0x2330
leaq 0xd42(%rip), %rsi       # 0x41eb
jmp 0x335a
leaq 0x1299(%rip), %rdi      # 0x474e
callq 0x20d0
testl %eax, %eax
js 0x35c2
movq 0x2d57(%rip), %rax      # 0x6220
testq %rax, %rax
leaq 0xd02(%rip), %r9        # 0x41d5
cmovneq %rax, %r9
subq $0x8, %rsp
leaq 0xd01(%rip), %r10       # 0x41e3
leaq 0xcdf(%rip), %rdi       # 0x41c8
leaq 0xcdf(%rip), %rdx       # 0x41cf
leaq 0xbe2(%rip), %rcx       # 0x40d9
leaq 0xcd4(%rip), %r8        # 0x41d2
movq %rdi, %rsi
xorl %eax, %eax
pushq $0x0
pushq 0x2d1d(%rip)            # 0x6228
pushq %r10
callq 0x2370
addq $0x20, %rsp
leaq 0xcc9(%rip), %rsi       # 0x41e6
jmp 0x335a
movq 0x2cff(%rip), %rdx      # 0x6228
leaq 0xc86(%rip), %rsi       # 0x41b6
movl $0x1, %edi
jmp 0x35ab
movq 0x2cea(%rip), %rdx      # 0x6228
leaq 0xd2c(%rip), %rsi       # 0x4271
movl $0x1, %edi
xorl %eax, %eax
callq 0x2210
movq 0x8(%rsp), %rdi
callq 0x23d0
leaq 0xc00(%rip), %rsi       # 0x4162
jmp 0x335a
leaq 0xbcd(%rip), %rsi       # 0x413b
jmp 0x335a
leaq 0xbd1(%rip), %rsi       # 0x414b
jmp 0x335a
leaq 0x11b1(%rip), %rsi      # 0x4737
jmp 0x335a
movslq (%r15), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rdi
callq 0x38e8
leaq 0xcaa(%rip), %rsi       # 0x424d
movl $0x1, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x20e0
leaq 0x1195(%rip), %rdi      # 0x474e
callq 0x20d0
testl %eax, %eax
jns 0x35ce
leaq 0xb93(%rip), %rsi       # 0x415c
jmp 0x335a
xorl %edi, %edi
movl $0x1, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
xorl %edi, %edi
movl $0x2, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x80(%rsp), %edi
xorl %esi, %esi
callq 0x20f0
testl %eax, %eax
js 0x3383
movl 0x80(%rsp), %edi
callq 0x2140
movl 0x84(%rsp), %edi
callq 0x2140
movq 0x2bf5(%rip), %rax      # 0x6220
testq %rax, %rax
leaq 0xba0(%rip), %rcx       # 0x41d5
cmovneq %rax, %rcx
movq 0x2be8(%rip), %r9       # 0x6228
subq $0x8, %rsp
leaq 0xb7d(%rip), %rdi       # 0x41c8
leaq 0xb80(%rip), %rdx       # 0x41d2
leaq 0xb8a(%rip), %r8        # 0x41e3
movq %rdi, %rsi
xorl %eax, %eax
pushq $0x0
callq 0x2370
addq $0x10, %rsp
jmp 0x3516