// File: /workspace/github_c_makefile_star2_O1/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 $0x158, %rsp            # imm = 0x158
movq %rdi, %r15
xorl %eax, %eax
movl %eax, 0x8(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x718e(%rip), %r12      # 0x14590
movq (%r12), %rax
movl 0x38(%rax), %ebx
movb $0x0, 0xf0(%rsp)
testq %rdi, %rdi
js 0xd4b5
xorl %edi, %edi
xorl %eax, %eax
callq 0x71ba
leaq 0x1a96(%rip), %rdi      # 0xeec0
xorl %eax, %eax
callq 0x7591
movq %rax, %rdi
xorl %eax, %eax
callq 0x6d31
leaq 0x1aac(%rip), %rdx      # 0xeeee
movl $0xa5, %edi
movl $0x12c, %esi            # imm = 0x12C
movl $0x9, %ecx
xorl %eax, %eax
callq 0x6d47
leaq 0x1552(%rip), %rdi      # 0xe9b1
xorl %eax, %eax
callq 0x7591
movq %rax, %rdi
xorl %eax, %eax
callq 0x6d31
leaq 0x1a81(%rip), %rdx      # 0xeef8
movl $0xa5, %edi
movl $0x140, %esi            # imm = 0x140
movl $0x8, %ecx
xorl %eax, %eax
callq 0x6d47
xorl %eax, %eax
callq 0x783d
movl $0x1, %edi
callq 0x4320
xorl %eax, %eax
callq 0x782a
testl %ebx, %ebx
setne 0x3(%rsp)
leaq -0x177(%rip), %r13      # 0xd33c
jmp 0xd4c1
leaq -0x144(%rip), %r13      # 0xd378
movb $0x1, 0x3(%rsp)
movl $0x15e, 0x7449(%rip)    # imm = 0x15E
movl $0x64, 0x7443(%rip)     # 0x14918
movl $0xf, 0x743d(%rip)      # 0x1491c
leaq 0x1880(%rip), %rsi      # 0xed66
leaq 0x187e(%rip), %rdx      # 0xed6b
leaq 0x1a0d(%rip), %rcx      # 0xef01
xorl %r14d, %r14d
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
leaq 0x14e4(%rip), %rsi      # 0xe9f4
movq %rbx, %rdi
callq 0x41a0
movl $0x1, %ebp
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0xd558
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x19de(%rip), %rdi      # 0xef13
xorl %ebp, %ebp
xorl %eax, %eax
callq *%r13
testq %r15, %r15
js 0xd63a
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x19d9(%rip), %rdi      # 0xef2c
xorl %eax, %eax
callq *%r13
testq %r15, %r15
movq %r13, 0x18(%rsp)
movq %r15, 0x28(%rsp)
js 0xd6a7
movl $0x1, %esi
movl $0x2, %edi
callq 0x43a0
movl $0x1, %esi
movl $0x1, %edi
callq 0x43a0
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0xd59b
movq %rbx, %rdi
callq 0x4500
testq %rbx, %rbx
leaq 0xf65(%rip), %rax       # 0xe50a
leaq 0x19a3(%rip), %r12      # 0xef4f
cmoveq %rax, %r12
movl $0xfffffffa, %r14d      # imm = 0xFFFFFFFA
leaq 0x80(%rsp), %r13
leaq 0x19ba(%rip), %r15      # 0xef7f
movq %r13, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rbx
testq %rax, %rax
je 0xd618
movq %rbx, %rdi
callq 0x4030
movl %eax, %edi
movl $0x2, %esi
callq 0x4360
testl %eax, %eax
jns 0xd644
callq 0x43f0
cmpl $0xb, (%rax)
jne 0xd611
movq %rbx, %rdi
callq 0x4500
movl $0x2, %edi
callq 0x4320
incl %r14d
jne 0xd5c5
leaq 0x193a(%rip), %r15      # 0xef52
leaq 0x6f71(%rip), %r12      # 0x14590
movq (%r12), %rax
movl 0x3c(%rax), %esi
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
movq 0x18(%rsp), %r13
callq *%r13
xorl %eax, %eax
jmp 0xd658
movl $0x1, %ebx
jmp 0xdc97
movl $0x1, %eax
movb $0x1, %r14b
leaq 0x6f3d(%rip), %r12      # 0x14590
movq 0x18(%rsp), %r13
cmpq $0x0, 0x10(%rsp)
sete %cl
orb %r14b, %cl
movq 0x28(%rsp), %r15
je 0xd675
movq %rbx, 0x10(%rsp)
movl %eax, %r14d
jmp 0xd6a7
testq %rbx, %rbx
je 0xd682
movq %rbx, %rdi
callq 0x4500
leaq 0x136b(%rip), %rsi      # 0xe9f4
leaq 0x80(%rsp), %rdi
callq 0x41a0
xorl %ebp, %ebp
movq %rax, 0x10(%rsp)
testq %rax, %rax
setne %bpl
xorl %r14d, %r14d
movl %r14d, %eax
orl %ebp, %eax
je 0xd8d6
testl %ebp, %ebp
movl %r14d, 0x34(%rsp)
je 0xd91b
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl $0xc8, %esi
movq 0x10(%rsp), %rbp
movq %rbp, %rdx
callq 0x4230
movl $0x0, 0x4(%rsp)
testl %r14d, %r14d
je 0xd7bd
testq %rax, %rax
je 0xd7bd
movq %rbx, %rdi
callq 0x4280
movb $0x0, -0x1(%rax,%rbx)
movdqa 0xf0(%rsp), %xmm0
movdqu 0xfd(%rsp), %xmm1
pcmpeqb 0x1783(%rip), %xmm1     # 0xeea0
pcmpeqb 0x178b(%rip), %xmm0     # 0xeeb0
pand %xmm1, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xd7bd
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x18b3(%rip), %rdi      # 0xeff9
xorl %eax, %eax
callq *%r13
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x18cd(%rip), %rdi      # 0xf026
xorl %eax, %eax
callq *%r13
leaq 0x18e0(%rip), %rsi      # 0xf045
leaq 0x16af(%rip), %rdx      # 0xee1b
leaq 0x80(%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 0x18cd(%rip), %rsi      # 0xf061
leaq 0xf0(%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
movl $0x1, 0x4(%rsp)
cmpb $0x0, 0xf0(%rsp)
jne 0xd7e7
movups 0x165a(%rip), %xmm0     # 0xee28
movups %xmm0, 0xfd(%rsp)
movdqu 0x163d(%rip), %xmm0     # 0xee1b
movdqa %xmm0, 0xf0(%rsp)
leaq 0x80(%rsp), %rdi
movl $0xc8, %esi
movq %rbp, %rdx
callq 0x4230
testq %rax, %rax
je 0xd821
leaq 0x1879(%rip), %rsi      # 0xf081
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0xc(%rsp), %rcx
xorl %eax, %eax
callq 0x40f0
movl $0x48, %edi
callq 0x4190
movq %rax, %r14
leaq 0x80(%rsp), %rdi
movl $0xc8, %esi
movq %rbp, %rdx
callq 0x4230
testq %rax, %rax
je 0xd92d
movq %r12, %rbx
leaq 0x1831(%rip), %r15      # 0xf087
leaq 0x80(%rsp), %r12
xorl %r13d, %r13d
movq %r14, %rbp
leaq 0x8(%rbp), %rcx
leaq 0xc(%rbp), %r8
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x40f0
cmpl $0x3, %eax
jne 0xd89c
movl $0x48, %edi
callq 0x4190
movq %rax, 0x40(%rbp)
incl %r13d
movq %rbp, 0x20(%rsp)
movq %rax, %rbp
jmp 0xd8af
movq (%rbx), %rax
movl 0x3c(%rax), %esi
leaq 0x17ea(%rip), %rdi      # 0xf093
xorl %eax, %eax
callq *0x18(%rsp)
movq %r12, %rdi
movl $0xc8, %esi
movq 0x10(%rsp), %rdx
callq 0x4230
testq %rax, %rax
je 0xd8cc
cmpl $0x14, %r13d
jl 0xd864
movq 0x28(%rsp), %r15
movq %rbx, %r12
jmp 0xd926
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x16c9(%rip), %rdi      # 0xefad
xorl %eax, %eax
callq *%r13
movl $0x2, %edi
xorl %esi, %esi
callq 0x43a0
movl $0x1, %edi
xorl %esi, %esi
callq 0x43a0
movl $0x1, %ebx
testq %r15, %r15
js 0xdc97
leaq 0x16c6(%rip), %rdi      # 0xefdc
jmp 0xdc90
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rbp
jmp 0xd935
xorl %r13d, %r13d
movq 0x28(%rsp), %r15
testl %r13d, %r13d
je 0xd949
movq 0x20(%rsp), %rax
movq $0x0, 0x40(%rax)
jmp 0xd94c
xorl %r14d, %r14d
movl 0xc(%rsp), %eax
cmpl %eax, 0x8(%rsp)
jge 0xd95a
movl %eax, 0x8(%rsp)
testq %r15, %r15
js 0xd983
callq 0x44a0
movl %eax, 0x40(%rsp)
movq %r15, 0x38(%rsp)
movl %eax, %edi
callq 0x4240
testq %rax, %rax
je 0xd995
leaq 0x44(%rsp), %rdi
movq (%rax), %rsi
jmp 0xd9ab
movl $0x0, 0x30(%rsp)
movq 0x18(%rsp), %r13
jmp 0xda3a
callq 0x40a0
testq %rax, %rax
je 0xdcac
leaq 0x44(%rsp), %rdi
movq %rax, %rsi
callq 0x4470
cmpl $0x14, %r13d
jl 0xd9c7
movq 0x38(%rsp), %rax
xorl %edx, %edx
movq 0x20(%rsp), %rcx
cmpq (%rcx), %rax
jle 0xda1f
testq %r14, %r14
movq 0x18(%rsp), %r13
je 0xd9f6
movq 0x38(%rsp), %rcx
movq %r14, %rax
cmpq (%r14), %rcx
jg 0xd9f9
movq %r14, %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rax), %rax
testq %rax, %rax
je 0xd9f9
cmpq (%rax), %rcx
jle 0xd9e1
jmp 0xd9f9
movq %r14, %rax
movq %rax, 0x78(%rsp)
movl $0x1, %edx
cmpq %r14, %rax
je 0xda18
leaq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rax, 0x40(%rcx)
jmp 0xda24
leaq 0x38(%rsp), %r14
jmp 0xda24
movq 0x18(%rsp), %r13
incl 0x8(%rsp)
movb 0x3(%rsp), %al
orb 0x4(%rsp), %al
movl %edx, 0x30(%rsp)
jne 0xda3a
incl 0xc(%rsp)
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
leaq 0x1694(%rip), %rsi      # 0xf0dd
leaq 0x80(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x42e0
movq %r12, %rbx
movq (%r12), %rax
movl 0x3c(%rax), %esi
movq %r15, %rdi
xorl %eax, %eax
callq *%r13
testq %r14, %r14
je 0xdb3f
movl 0x4(%rsp), %eax
orb 0x3(%rsp), %al
movl %eax, 0x4(%rsp)
xorl %ebp, %ebp
movq %r14, %r15
leaq 0x38(%rsp), %rax
cmpq %rax, %r14
movl $0x20, %eax
movl $0x3e, %ecx
cmovel %ecx, %eax
sete %r12b
movb %al, 0x80(%rsp)
leaq 0xc(%r14), %r13
movq (%r14), %rcx
leaq 0x81(%rsp), %rdi
leaq 0x164b(%rip), %rsi      # 0xf108
movq %r13, %rdx
xorl %eax, %eax
callq 0x42e0
movq (%rbx), %rax
movl 0x3c(%rax), %esi
leaq 0x80(%rsp), %rdi
xorl %eax, %eax
callq *0x18(%rsp)
testb %r12b, 0x4(%rsp)
je 0xdaf8
movl %ebp, %eax
movq 0x40(%r14), %rcx
cmpq %r15, %r14
je 0xdb1c
movq 0x20(%rsp), %rdx
movq %rcx, 0x40(%rdx)
jmp 0xdb1f
movl 0x8(%r14), %eax
cmpl 0x40(%rsp), %eax
jne 0xdb13
leaq 0x44(%rsp), %rdi
movq %r13, %rsi
callq 0x4440
testl %eax, %eax
je 0xdb30
movq %r14, 0x20(%rsp)
movl %ebp, %eax
jmp 0xdb1f
movq %rcx, %r15
movq 0x40(%r14), %r14
movl %eax, %ebp
testq %r14, %r14
jne 0xda87
jmp 0xdb42
leal 0x1(%rbp), %eax
cmpl $0x3, %ebp
jge 0xdae4
movq %r14, 0x20(%rsp)
jmp 0xdb1f
movq %r14, %r15
cmpq $0x0, 0x28(%rsp)
sets %al
movl 0x30(%rsp), %ecx
orb %al, %cl
movq %rbx, %r12
movq 0x18(%rsp), %r13
jne 0xdb9f
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x148c(%rip), %rdi      # 0xeff5
xorl %eax, %eax
callq *%r13
leaq 0x44(%rsp), %rdx
movq -0xc(%rdx), %rcx
leaq 0x1589(%rip), %rsi      # 0xf107
leaq 0x80(%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
cmpl $0x0, 0x34(%rsp)
movq 0x10(%rsp), %rbp
je 0xdc5f
movq %rbp, %rdi
callq 0x4370
leaq 0x1561(%rip), %rsi      # 0xf11f
leaq 0xf0(%rsp), %rdx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x4570
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
leaq 0x1533(%rip), %rsi      # 0xf112
movq %rbp, %rdi
xorl %eax, %eax
callq 0x4570
testq %r15, %r15
je 0xdc26
leaq 0x1524(%rip), %rbx      # 0xf119
xorl %r14d, %r14d
movq (%r15), %rdx
movl 0x8(%r15), %ecx
leaq 0xc(%r15), %r8
movq %rbp, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4570
movq 0x40(%r15), %r15
testq %r15, %r15
je 0xdc26
leal 0x1(%r14), %eax
cmpl $0x13, %r14d
movl %eax, %r14d
jb 0xdbf8
cmpb $0x0, 0x3(%rsp)
je 0xdc5f
movl 0x6ce9(%rip), %eax      # 0x1491c
addl %eax, 0x6cdf(%rip)      # 0x14918
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x14dc(%rip), %rdi      # 0xf123
xorl %eax, %eax
callq *%r13
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x14ec(%rip), %rdi      # 0xf146
xorl %eax, %eax
callq *%r13
movq %rbp, %rdi
callq 0x4500
xorl %ebx, %ebx
movl $0x2, %edi
xorl %esi, %esi
callq 0x43a0
movl $0x1, %edi
xorl %esi, %esi
callq 0x43a0
cmpq $0x0, 0x28(%rsp)
js 0xdc97
leaq 0x14e3(%rip), %rdi      # 0xf173
xorl %esi, %esi
callq 0xd381
movq %rbx, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rax
movl 0x3c(%rax), %esi
leaq 0x1400(%rip), %rdi      # 0xf0ba
xorl %eax, %eax
callq *0x18(%rsp)
movq %rbp, %rdi
callq 0x4500
movl $0x2, %edi
xorl %esi, %esi
callq 0x43a0
movl $0x1, %edi
xorl %esi, %esi
callq 0x43a0
movl $0x1, %ebx
jmp 0xd90f