// File: /workspace/github_c_makefile_star2_O2/jrrk[P]cbzone/c_scores.c
// Function: scores
LONG scores(score)
     LONG score;
{
  struct score_struct {
    LONG score;
    int uid;
    char name[50];
    struct score_struct *next;
  } player, *current, *top_score, *prev_score;

  FILE *sfile;
  char buf[100];
  char version[100];
  char *login, *getlogin();
  int i;
  Font fontid;
  int numgame = 0;
  int numscore = 0;
  int numscoreable = 0;
  int player_scores = 0;
  int tries = MAX_RETRIES;
  Bool score_printed = False;
  Bool scoresonly = False;
  Bool wrong_version = False;
  Bool file_readable = False;
  Bool file_writeable = False;
  Bool practice = opt->practice;
  struct passwd* pw;
  void (*p)();

  version[0] ='\0';
  if (score < 0) {
    practice = True;
    scoresonly = True;
    p = nprintf;
  }
  else {
    p = xprintf;
    gprsetclippingactive(False);
    fontid = gprloadfontfile(GAMEOVERFONT);
    gprsettextfont(fontid);
    printstring (165, 300, "GAME OVER", 9);
    fontid = gprloadfontfile(GENERALFONT);
    gprsettextfont(fontid);
    printstring (165, 320, "1986 JSR", 8);
    flushwindow();
    sleep(1);
    clearentirescreen();
  }

  x = 350;
  y = 100;
  ydelta = 15;

  sprintf(buf,"%s%s",TANKDIR,SCOREFILE);
  sfile = fopen(buf,"r");       /* just check if it is there */

  if (sfile == NULL) {
    p("Score file not readable.", opt->output);
    if (scoresonly)
      return 1;
    else {
      p("Will try and create new scorefile.", opt->output);
    }
  }
  else
    file_readable = True;

  if (!scoresonly) {
    (void) signal(SIGINT, SIG_IGN); /* no leaving this routine */
    (void) signal(SIGHUP, SIG_IGN); /* no how, no way */
    file_writeable = True;
    if (sfile != NULL)
      fclose(sfile);

  retry:
    if (file_readable)
      sfile = fopen(buf,"r+");  /* okay, now open for update */
    else
      sfile = fopen(buf,"w");

    if (sfile != NULL) {
      if (flock(fileno(sfile),LOCK_EX) < 0) {
        if (errno == EWOULDBLOCK && AFS) {
          fclose(sfile);
          sleep(AFS_SLEEP);
          if (tries--)
            goto retry;
        }
        p("File not lockable, scores will not be saved.", opt->output);
        file_writeable = False;
      }
    }
    else {
      p("File not writeable, scores will not be saved.", opt->output);
      file_writeable = False;
    }

    /* okay, it's possible we could have closed the file and never
     * reopened it.  Also, we just may not have been able to lock
     * it.  In either case, lets close it again and then open only
     * for reading.
     */
    if (file_readable && !file_writeable) {
      if (sfile != NULL)
        fclose(sfile);
      if ((sfile = fopen(buf, "r")) == NULL)
        file_readable = False;
    }
  }

  if (!file_readable && !file_writeable) {
    p("Scorefile not readable or writeable...Goodbye!", opt->output);
    (void) signal(SIGINT, SIG_DFL); /* this would probably happen */
    (void) signal(SIGHUP, SIG_DFL); /* on exit anyway             */
    if (!scoresonly)
      printandwait("Press any key to continue...", 0);
    return 1;
  }

  if (file_readable) {
    if(fgets(version,200,sfile) && file_writeable) {
      version[strlen(version)-1] = '\0'; /* strip the newline */
      if (strcmp(version,VERSION)) {
        wrong_version = True;
        p("Incorrect version played for this scorefile.", opt->output);
        p("Score not valid for inclusion.", opt->output);
        sprintf(buf,"Your version is \"%s\", while",VERSION);
        p(buf, opt->output);
        sprintf(buf, "  the scorefile version is \"%s\"", version);
        p(buf, opt->output);
      }
    }

    if (*version == '\0')
      strcpy(version,VERSION);

    if(fgets(buf,200,sfile))
      sscanf(buf,"%d %d",&numgame,&numscoreable);
    top_score = (struct score_struct*) malloc(sizeof(struct score_struct));
    current = top_score;

    while(fgets(buf,200,sfile) && numscore < NUMHIGH)
      if (sscanf(buf,"%d %d %[^\n]",&current->score,
                 &current->uid,current->name) != 3) {
        p("Invalid line in score file...Skipping.", opt->output);
      }
      else {
        current->next = (struct score_struct*)
          malloc(sizeof(struct score_struct));
        prev_score = current;
        current = current->next;
        numscore ++;
      }
  }

  if (numscore)
    prev_score->next = NULL;
  else
    top_score = NULL;

  if (numgame < numscoreable)
    numgame = numscoreable;

  if (!scoresonly) {
    /* try to get it from the passwd file first, just in case this
     * person su'd from another acct.
     */
    player.uid = getuid();
    player.score = score;
    pw = getpwuid(player.uid);
    if (pw == NULL)
      if ((login = getlogin()) != NULL)
        strcpy(player.name, login);
      else {
        p("Can't find out who you are....bye.", opt->output);
        fclose(sfile);
        (void) signal(SIGINT, SIG_DFL);
        (void) signal(SIGHUP, SIG_DFL);
        if (!scoresonly)
          printandwait("Press any key to continue...", 0);
        return 1;
      }
    else
      strcpy(player.name, pw->pw_name);

    if (numscore < NUMHIGH || player.score > prev_score->score) {
      score_printed = True;
      numscore++;

      for (current = top_score;
           current != NULL && player.score <= current->score;
           prev_score = current, current = current->next);

      player.next = current;

      if (current == top_score)
        top_score = &player;
      else
        prev_score->next = &player;
    }

    numgame++;
    if (!practice && !wrong_version)
      numscoreable++;
  }

  sprintf(buf, "High scores after %d games, %d scoreable:",
          numgame, numscoreable);
  p(buf, opt->output);
  current = top_score;
  while (current != NULL) {
    if (current == &player)
      *buf = '>';
    else
      *buf = ' ';
    sprintf(buf+1, "%-20s %8d", current->name, current->score);
    p(buf, opt->output);

    if (((wrong_version || practice) && current==&player) ||
        (current->uid==player.uid && !strcmp(player.name, current->name) &&
         ++player_scores>INDIVIDUAL_SCORES)) {
      numscore--;
      if (current == top_score)
        top_score = current->next;
      else
        prev_score->next = current->next;
    }
    else
      prev_score = current;
    current = current->next;
  }

  if (!scoresonly && !score_printed) {
    p("...", opt->output);
    sprintf(buf, ">%-20s %8d", player.name,player.score);
    p(buf, opt->output);
  }

  if (file_writeable) {
    rewind(sfile);
    fprintf(sfile,"%s\n",version);
    fprintf(sfile,"%d %d\n",numgame,numscoreable);
    for(current = top_score, i = 0;
        current != NULL && i < NUMHIGH;
        current = current->next, i++)
      fprintf(sfile,"%d %d %s\n",current->score,current->uid,current->name);
    if (practice) {
      y += ydelta;
      p("Your game was for practice only...", opt->output);
      p("For a valid score use:  cbzone [-q] [-d 0-5]", opt->output);
    }
  }

  fclose(sfile);
  (void) signal(SIGINT, SIG_DFL);
  (void) signal(SIGHUP, SIG_DFL);

  if (!scoresonly)
    printandwait("Press any key when ready...", 0);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %r14
andl $0x0, 0xc(%rsp)
andl $0x0, 0x1c(%rsp)
leaq 0x7023(%rip), %r12      # 0x13590
movq (%r12), %rax
movl 0x38(%rax), %ebx
movb $0x0, 0x100(%rsp)
testq %rdi, %rdi
js 0xc61a
xorl %edi, %edi
xorl %eax, %eax
callq 0x6cb6
leaq 0x1a15(%rip), %rdi      # 0xdfaa
xorl %eax, %eax
callq 0x701b
movq %rax, %rdi
xorl %eax, %eax
callq 0x69cc
leaq 0x1a2b(%rip), %rdx      # 0xdfd8
pushq $0x9
popq %rcx
movl $0xa5, %edi
movl $0x12c, %esi            # imm = 0x12C
xorl %eax, %eax
callq 0x69e2
leaq 0x1499(%rip), %rdi      # 0xda61
xorl %eax, %eax
callq 0x701b
movq %rax, %rdi
xorl %eax, %eax
callq 0x69cc
leaq 0x1a02(%rip), %rdx      # 0xdfe2
pushq $0x8
popq %rcx
movl $0xa5, %edi
movl $0x140, %esi            # imm = 0x140
xorl %eax, %eax
callq 0x69e2
xorl %eax, %eax
callq 0x71f7
pushq $0x1
popq %rdi
callq 0x4320
xorl %eax, %eax
callq 0x71e4
testl %ebx, %ebx
setne 0xb(%rsp)
leaq -0x134(%rip), %r13      # 0xc4e4
jmp 0xc626
leaq -0x101(%rip), %r13      # 0xc520
movb $0x1, 0xb(%rsp)
movl $0x15e, 0x72e4(%rip)    # imm = 0x15E
movl $0x64, 0x72de(%rip)     # 0x13918
movl $0xf, 0x72d8(%rip)      # 0x1391c
leaq 0x1833(%rip), %rsi      # 0xde7e
leaq 0x1831(%rip), %rdx      # 0xde83
leaq 0x1992(%rip), %rcx      # 0xdfeb
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
leaq 0x1432(%rip), %rsi      # 0xdaa4
movq %rbx, %rdi
callq 0x41a0
movq %rax, %r15
pushq $0x1
popq %rbx
testq %rax, %rax
movq %r14, 0x40(%rsp)
movq %r13, 0x28(%rsp)
je 0xc6a1
testq %r14, %r14
js 0xc7ae
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
jmp 0xc6d8
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x194e(%rip), %rdi      # 0xdffd
movl $0x0, 0x10(%rsp)
xorl %eax, %eax
callq *%r13
testq %r14, %r14
js 0xce0e
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1943(%rip), %rdi      # 0xe016
xorl %eax, %eax
callq *%r13
pushq $0x2
popq %rdi
pushq $0x1
popq %rbx
movq %rbx, %rsi
callq 0x43b0
pushq $0x1
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x43b0
testq %r15, %r15
je 0xc700
movq %r15, %rdi
callq 0x4510
movq %r15, 0x20(%rsp)
testq %r15, %r15
leaq 0xe0b(%rip), %rax       # 0xd51a
leaq 0x1923(%rip), %r12      # 0xe039
cmoveq %rax, %r12
pushq $-0x6
popq %rbx
leaq 0x90(%rsp), %r13
pushq $0x2
popq %r15
movq %r13, %rdi
movq %r12, %rsi
callq 0x41a0
testq %rax, %rax
je 0xc7b6
movq %rax, %r14
movq %rax, %rdi
callq 0x4030
movl %eax, %edi
movl %r15d, %esi
callq 0x4360
testl %eax, %eax
jns 0xc80e
callq 0x4400
cmpl $0xb, (%rax)
jne 0xc774
movq %r14, %rdi
callq 0x4510
movl %r15d, %edi
callq 0x4320
incl %ebx
jne 0xc729
leaq 0x6e15(%rip), %r12      # 0x13590
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x18b3(%rip), %rdi      # 0xe03c
xorl %eax, %eax
movq 0x28(%rsp), %r13
callq *%r13
cmpq $0x0, 0x20(%rsp)
movq 0x40(%rsp), %r15
je 0xc828
movq %r14, %rdi
callq 0x4510
jmp 0xc7e2
xorl %r14d, %r14d
jmp 0xc85d
leaq 0x6dd3(%rip), %r12      # 0x13590
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x189e(%rip), %rdi      # 0xe069
xorl %eax, %eax
movq 0x28(%rsp), %r13
callq *%r13
cmpq $0x0, 0x20(%rsp)
movq 0x40(%rsp), %r15
je 0xc833
leaq 0x12bb(%rip), %rsi      # 0xdaa4
leaq 0x90(%rsp), %rdi
callq 0x41a0
movq %rax, %r14
xorl %eax, %eax
testq %r14, %r14
setne %al
movq $0x0, 0x38(%rsp)
xorl %ebp, %ebp
jmp 0xc845
movb $0x1, %al
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %r15
leaq 0x6d6f(%rip), %r12      # 0x13590
movq 0x28(%rsp), %r13
jmp 0xc841
movq $0x0, 0x38(%rsp)
jmp 0xc83f
movq $0x0, 0x38(%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
movl 0x10(%rsp), %eax
orl %eax, %ebp
je 0xca52
testl %eax, %eax
je 0xca9f
movq %r14, %r15
movq 0x38(%rsp), %r14
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
movl $0xc8, %esi
movq %r15, %rdx
callq 0x4230
movq $0x0, 0x10(%rsp)
testb %r14b, %r14b
je 0xc93c
testq %rax, %rax
je 0xc93c
movq %rbx, %rdi
callq 0x4280
movb $0x0, -0x1(%rax,%rbx)
leaq 0x168f(%rip), %rsi      # 0xdf33
pushq $0x1d
popq %rdx
movq %rbx, %rdi
callq 0x4380
testl %eax, %eax
je 0xc93c
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x181e(%rip), %rdi      # 0xe0e3
xorl %eax, %eax
callq *%r13
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1838(%rip), %rdi      # 0xe110
xorl %eax, %eax
callq *%r13
leaq 0x184b(%rip), %rsi      # 0xe12f
leaq 0x1648(%rip), %rdx      # 0xdf33
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movq (%r12), %rax
movl 0x3c(%rax), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq *%r13
leaq 0x1838(%rip), %rsi      # 0xe14b
leaq 0x100(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movq (%r12), %rax
movl 0x3c(%rax), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq *%r13
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, 0x100(%rsp)
jne 0xc964
movups 0x15f3(%rip), %xmm0     # 0xdf40
movups %xmm0, 0x10d(%rsp)
movups 0x15d7(%rip), %xmm0     # 0xdf33
movaps %xmm0, 0x100(%rsp)
movq %r14, 0x38(%rsp)
leaq 0x90(%rsp), %rdi
movl $0xc8, %esi
movq %r15, 0x20(%rsp)
movq %r15, %rdx
callq 0x4230
testq %rax, %rax
je 0xc9a8
leaq 0x17dc(%rip), %rsi      # 0xe16b
leaq 0x90(%rsp), %rdi
leaq 0xc(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
xorl %eax, %eax
callq 0x40f0
pushq $0x48
popq %rdi
callq 0x4190
movq %rax, %r13
leaq 0x90(%rsp), %r14
movq %r13, %r15
xorl %r12d, %r12d
leaq 0x8(%r15), %rbx
leaq 0xc(%r15), %rbp
movq %r14, %rdi
movl $0xc8, %esi
movq 0x20(%rsp), %rdx
callq 0x4230
testq %rax, %rax
je 0xca3a
cmpl $0x13, %r12d
ja 0xca3a
movq %r14, %rdi
leaq 0x1781(%rip), %rsi      # 0xe171
movq %r15, %rdx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x40f0
cmpl $0x3, %eax
je 0xca21
leaq 0x6b84(%rip), %rax      # 0x13590
movq (%rax), %rax
movl 0x3c(%rax), %esi
leaq 0x1764(%rip), %rdi      # 0xe17d
xorl %eax, %eax
callq *0x28(%rsp)
jmp 0xc9c9
pushq $0x48
popq %rdi
callq 0x4190
movq %rax, 0x40(%r15)
incl %r12d
movq %r15, 0x30(%rsp)
movq %rax, %r15
jmp 0xc9c1
testl %r12d, %r12d
je 0xca87
movq 0x30(%rsp), %rax
andq $0x0, 0x40(%rax)
cmpl $0x14, %r12d
setb %bl
jmp 0xca8c
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1637(%rip), %rdi      # 0xe097
xorl %eax, %eax
callq *%r13
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x43b0
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x43b0
testq %r15, %r15
jns 0xcdfd
jmp 0xce0b
movb $0x1, %bl
xorl %r13d, %r13d
movq 0x20(%rsp), %r14
movq 0x40(%rsp), %r15
leaq 0x6af3(%rip), %r12      # 0x13590
jmp 0xcaad
movb $0x1, %bl
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movl 0xc(%rsp), %edx
movl 0x1c(%rsp), %ecx
cmpl %ecx, %edx
jge 0xcabf
movl %ecx, 0xc(%rsp)
movl %ecx, %edx
testq %r15, %r15
js 0xcae8
callq 0x44b0
movl %eax, 0x50(%rsp)
movq %r15, 0x48(%rsp)
movl %eax, %edi
callq 0x4240
testq %rax, %rax
je 0xcaf5
leaq 0x54(%rsp), %rdi
movq (%rax), %rsi
jmp 0xcb0b
movl $0x0, 0x20(%rsp)
jmp 0xcb84
callq 0x40a0
testq %rax, %rax
je 0xcdcd
leaq 0x54(%rsp), %rdi
movq %rax, %rsi
callq 0x4480
movq 0x48(%rsp), %rax
testb %bl, %bl
jne 0xcb25
xorl %esi, %esi
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
jle 0xcb62
movq %r13, %rcx
testq %rcx, %rcx
je 0xcb3d
cmpq (%rcx), %rax
jg 0xcb3d
movq %rcx, 0x30(%rsp)
movq 0x40(%rcx), %rcx
jmp 0xcb28
movq %rcx, 0x88(%rsp)
pushq $0x1
popq %rsi
cmpq %r13, %rcx
je 0xcb5d
leaq 0x48(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, 0x40(%rcx)
jmp 0xcb62
leaq 0x48(%rsp), %r13
movl 0xc(%rsp), %edx
incl %edx
movl %edx, 0xc(%rsp)
movb 0xb(%rsp), %al
orb 0x10(%rsp), %al
movl 0x1c(%rsp), %ecx
movl %esi, 0x20(%rsp)
jne 0xcb84
incl %ecx
movl %ecx, 0x1c(%rsp)
leaq 0x163c(%rip), %rsi      # 0xe1c7
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movq (%r12), %rax
movl 0x3c(%rax), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x28(%rsp)
movq 0x10(%rsp), %rax
orb 0xb(%rsp), %al
movq %rax, 0x10(%rsp)
movq %r13, %r12
xorl %ebp, %ebp
testq %r12, %r12
je 0xcc81
leaq 0x48(%rsp), %rax
cmpq %rax, %r12
pushq $0x20
popq %rax
pushq $0x3e
popq %rcx
cmovel %ecx, %eax
sete %bl
movb %al, 0x90(%rsp)
leaq 0xc(%r12), %r15
movq (%r12), %rcx
leaq 0x91(%rsp), %rdi
leaq 0x15f6(%rip), %rsi      # 0xe1f2
movq %r15, %rdx
xorl %eax, %eax
callq 0x42e0
leaq 0x6983(%rip), %rax      # 0x13590
movq (%rax), %rax
movl 0x3c(%rax), %esi
leaq 0x90(%rsp), %rdi
xorl %eax, %eax
callq *0x28(%rsp)
testb %bl, 0x10(%rsp)
je 0xcc3e
movl %ebp, %eax
movq 0x40(%r12), %rcx
cmpq %r13, %r12
je 0xcc63
movq 0x30(%rsp), %rdx
movq %rcx, 0x40(%rdx)
jmp 0xcc66
movl 0x8(%r12), %eax
cmpl 0x50(%rsp), %eax
jne 0xcc5a
leaq 0x54(%rsp), %rdi
movq %r15, %rsi
callq 0x4450
testl %eax, %eax
je 0xcc72
movq %r12, 0x30(%rsp)
movl %ebp, %eax
jmp 0xcc66
movq %rcx, %r13
movq 0x40(%r12), %r12
movl %eax, %ebp
jmp 0xcbc0
leal 0x1(%rbp), %eax
cmpl $0x3, %ebp
jge 0xcc29
movq %r12, 0x30(%rsp)
jmp 0xcc66
movq 0x40(%rsp), %r15
testq %r15, %r15
sets %al
movl 0x20(%rsp), %ecx
orb %al, %cl
leaq 0x68f7(%rip), %r12      # 0x13590
jne 0xcce3
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1436(%rip), %rdi      # 0xe0df
xorl %eax, %eax
movq 0x28(%rsp), %rbp
callq *%rbp
movq 0x48(%rsp), %rcx
leaq 0x1533(%rip), %rsi      # 0xe1f1
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
leaq 0x54(%rsp), %rdx
xorl %eax, %eax
callq 0x42e0
movq (%r12), %rax
movl 0x3c(%rax), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq *%rbp
cmpb $0x0, 0x38(%rsp)
je 0xcd98
movq %r14, %rdi
callq 0x4370
leaq 0x150c(%rip), %rsi      # 0xe209
leaq 0x100(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4580
movl 0xc(%rsp), %edx
movl 0x1c(%rsp), %ecx
leaq 0x14de(%rip), %rsi      # 0xe1fc
movq %r14, %rdi
xorl %eax, %eax
callq 0x4580
leaq 0x14d4(%rip), %rbx      # 0xe203
xorl %ebp, %ebp
testq %r13, %r13
je 0xcd5c
cmpl $0x13, %ebp
ja 0xcd5c
movq (%r13), %rdx
movl 0x8(%r13), %ecx
leaq 0xc(%r13), %r8
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4580
movq 0x40(%r13), %r13
incl %ebp
jmp 0xcd31
cmpb $0x0, 0xb(%rsp)
je 0xcd98
movl 0x6bb3(%rip), %eax      # 0x1391c
addl %eax, 0x6ba9(%rip)      # 0x13918
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1490(%rip), %rdi      # 0xe20d
xorl %eax, %eax
movq 0x28(%rsp), %rbx
callq *%rbx
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x149c(%rip), %rdi      # 0xe230
xorl %eax, %eax
callq *%rbx
movq %r14, %rdi
callq 0x4510
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x43b0
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x43b0
testq %r15, %r15
js 0xce0e
leaq 0x149b(%rip), %rdi      # 0xe25d
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xc529
jmp 0xce0e
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x13c9(%rip), %rdi      # 0xe1a4
xorl %eax, %eax
callq *0x28(%rsp)
movq %r14, %rdi
callq 0x4510
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x43b0
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x43b0
leaq 0x12c2(%rip), %rdi      # 0xe0c6
xorl %esi, %esi
callq 0xc529
pushq $0x1
popq %rbx
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq