// File: /workspace/github_c_makefile_star2_O0/sheneman[P]clearcut/fasta.c
// Function: NJ_read_fasta
NJ_alignment *
NJ_read_fasta(NJ_ARGS *nj_args) {

  FILE *fp  = NULL;
  char *buf = NULL;
  char *ptr = NULL;
  NJ_alignment *alignment = NULL;

  char c;
  int state;
  long int index, x, seq;
  long int i;
  long int bufsize, nseqs = NJ_INITIAL_NSEQS;
  int first_sequence_flag;


  

  /* 
   * In this function, we implement a FASTA alignment parser which
   * reads in an alignment character-by-character, maintaining state
   * information which guides the parser.
   *
   * The program reads either DNA or Protein alignments.  All title lines
   * and sequences can be arbitrarily long.  Gaps can be represented by 
   * "-" or "." characters.  
   *
   * Ambiguity codes are also handled.
   * 
   */

  /* 
   * We can't handle reading fasta input unless the user explicity 
   * specifies the input type...just to be sure.
   */
  if( (!nj_args->dna_flag && !nj_args->protein_flag) ||
      (nj_args->dna_flag  &&  nj_args->protein_flag) ) {
    fprintf(stderr, "Clearcut: Explicitly specify protein or DNA\n");
    goto XIT_BAD;
  }

  /* open specified fasta file here */
  if(nj_args->stdin_flag) {
    fp = stdin;
  } else {
    fp = fopen(nj_args->infilename, "r");
    if(!fp) {
      fprintf(stderr, "Clearcut: Failed to open input FASTA file: %s\n", nj_args->infilename);
      perror("Clearcut");
      goto XIT_BAD;
    }
  }

  /* allocate the initial buffer */
  bufsize = NJ_INITIAL_BUFFER_SIZE;
  buf = (char *)calloc(bufsize, sizeof(char));
  
  /* allocate the alignment container here */
  alignment = (NJ_alignment *)calloc(1, sizeof(NJ_alignment));
  
  /* allocate initial title array */
  //  printf("allocating initial title array\n");
  alignment->titles = (char **)calloc(NJ_INITIAL_NSEQS, sizeof(char *));

  /* make sure that we successfully allocated memory */
  if(!buf || !alignment || !alignment->titles) {
    fprintf(stderr, "Clearcut: Memory allocation error in NJ_read_fasta()\n");
    goto XIT_BAD;
  }

  /* a flag */
  first_sequence_flag = 1;  
  
  index  = 0;  /* tracks the position in buffer     */
  x      = 0;  /* tracks the position on sequence   */
  seq    = 0;  /* tracks the active sequence        */

  /* intitial state of state machine */
  state  = NJ_FASTA_MODE_UNKNOWN;

  while(1) {
    
    /* get the next character */
    c = fgetc(fp);
    if(feof(fp)) {

      if(state == NJ_FASTA_MODE_SEQUENCE) {
	buf[index+1] = '\0';

	/* copy buf to alignment */
	for(i=1;i<=alignment->length;i++) {
	  alignment->data[seq*alignment->length+i-1] = buf[i];
	}
      }

      break;
    }

    /* make sure our dynamic buffer is big enough */
    if(index >= bufsize) {
      bufsize *= 2;
      buf = (char *)realloc(buf, bufsize);
      if(!buf) {
	fprintf(stderr, "Clearcut: Memory allocation error in NJ_read_fasta()\n");
	goto XIT_BAD;
      }
    }

    switch(state) {
      
    case NJ_FASTA_MODE_UNKNOWN:
      
      if(!NJ_is_whitespace(c)) {
	if(c == '>') {
	  state = NJ_FASTA_MODE_TITLE;
	  buf[0] = '>';
	} else {
	  goto XIT_BAD;
	}
      }

      break;

    case NJ_FASTA_MODE_TITLE:

      if( c == '\n' ||
	  c == '\r' ) {

	buf[index] = '\0';
	state = NJ_FASTA_MODE_SEQUENCE;
	index = 0;
	x     = -1;

	/* make sure we've allocated enough space for titles and sequences */
	if(seq == nseqs) {

	  //	  printf("realloc().  seq = %d, nseqs = %d\n", seq, nseqs);

	  nseqs *= 2;

	  alignment->titles = (char **)realloc(alignment->titles, nseqs*sizeof(char *));
	  if(!alignment->titles) {
	    fprintf(stderr, "Clearcut:  Memory allocation error in NJ_read_fasta()\n");
	    goto XIT_BAD;
	  }

	  alignment->data = (char *)realloc(alignment->data, alignment->length*nseqs*sizeof(char));
	  if(!alignment->data) {
	    fprintf(stderr, "Clearcut: Allocation error in NJ_read_fasta()\n");
	    goto XIT_BAD;
	  }
	}

	// printf("Allocating %d bytes for title %d: %s\n", (int)strlen(buf), (int)seq, buf);

	alignment->titles[seq] = (char *)calloc(strlen(buf), sizeof(char));
	if(!alignment->titles[seq]) {
	  fprintf(stderr, "Clearcut:  Memory allocation error in NJ_read_fasta()\n");
	  goto XIT_BAD;
	}

	/* lets forward to the first non-space (space/tab) character after the '>' */

	if(first_sequence_flag) {
	  ptr = buf;
	} else {
	  ptr = &buf[1];
	}
	while(*ptr == '\t' || *ptr == ' ') {
	  ptr++;
	}
	sscanf(ptr, "%s", alignment->titles[seq]);  /* get the first word and use as the title */

	alignment->nseq++;
      }
	
      buf[index++] = c;

      break;


    case NJ_FASTA_MODE_SEQUENCE:

      if(c == '>') {

	if(first_sequence_flag) {
	  first_sequence_flag = 0;

	  /* allocate our alignment data section here */
	  alignment->length = index-1;

	  nseqs = NJ_INITIAL_NSEQS;
	  alignment->data = (char *)calloc(alignment->length*nseqs, sizeof(char));
	  if(!alignment->data) {
	    fprintf(stderr, "Clearcut: Allocation error in NJ_read_fasta()\n");
	    goto XIT_BAD;
	  }
	} 
	
	if(!first_sequence_flag) {
	  if(index-1 < alignment->length) {
	    fprintf(stderr, "Clearcut: Sequences must be of uniform length in alignment at sequence %ld\n", seq);
	    goto XIT_BAD;
	  }
	}

	/* re-allocate if necessary */
	/*
	if(seq >= nseqs) {
	  nseqs *= 2;
	  alignment->data = (char *)realloc(alignment->data, alignment->length*nseqs*sizeof(char));
	  if(!alignment->data) {
	    fprintf(stderr, "Clearcut: Allocation error in NJ_read_fasta()\n");
	    goto XIT_BAD;
	  }
	}
	*/

	/* copy buf to alignment */
	for(i=1;i<=alignment->length;i++) {
	  alignment->data[seq*alignment->length+i-1] = buf[i];
	}
	  
	state = NJ_FASTA_MODE_TITLE;
	index = 1;
	x     = 1;
	  
	buf[0] = c;
	
	seq++;

      } else {
	  
	if(NJ_is_whitespace(c)) {
	  break;
	}
		
	if(!first_sequence_flag) {
	  if(index-1 >= alignment->length) {
	    fprintf(stderr, "Clearcut: Sequences must be of uniform length in alignment at sequence %ld\n", seq);
	    goto XIT_BAD;
	  }
	}


	/* 
	 * Here we check to make sure that the symbol read is appropriate
	 * for the type of data the user specified.  (dna or protein).
	 * We also handle ambiguity codes by converting them to a specific
	 * assigned ambiguity code character.  Ambiguity codes are ignored
	 * when computing distances
	 */

	if(nj_args->dna_flag) {
	  if(NJ_is_dna(c)) {
	    buf[index++] = toupper(c);
	  } else {
	    if(NJ_is_dna_ambiguity(c)) {
	      buf[index++] = NJ_AMBIGUITY_CHAR;
	    } else {
	      fprintf(stderr, "Clearcut: Unknown symbol '%c' in nucleotide sequence %ld.\n", c, seq);
	      goto XIT_BAD;
	    }
	  }
	} else if(nj_args->protein_flag) {
	  if(NJ_is_protein(c)) {
	    buf[index++] = toupper(c);
	  } else {
	    if(NJ_is_protein_ambiguity(c)) {
	      buf[index++] = NJ_AMBIGUITY_CHAR;
	    } else {
	      fprintf(stderr, "Clearcut: Unknown symbol '%c' in protein sequence %ld.\n", c, seq);
	      goto XIT_BAD;
	    }
	  }
	}

      }

      break;
	
    default:
      goto XIT_BAD;
	
      break;

    }
  }
  
  if(index-1 != alignment->length) {
    fprintf(stderr, "Clearcut: Sequences must be of uniform length in alignment at sequence %ld\n", seq);
    goto XIT_BAD;
  }
  
  /* check for duplicate taxon labels */
  if(!NJ_taxaname_unique(alignment)) {
    goto XIT_BAD;
  }
  
  return(alignment);

  
 XIT_BAD:

  if(fp) {
    fprintf(stderr, "Clearcut: Fatal error parsing FASTA file at file offset %ld.\n", ftell(fp));
  }
  
  if(buf) {
    free(buf);
  }
  
  NJ_free_alignment(alignment);

  return(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x40, -0x68(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x75cb
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x75df
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x75fc
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x75fc
movq 0x7a12(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x4233(%rip), %rsi      # 0xb823
movb $0x0, %al
callq 0x2150
jmp 0x7d16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x7616
movq 0x79cb(%rip), %rax      # 0xefd8
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x7666
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x46ed(%rip), %rsi      # 0xbd11
callq 0x21c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7664
movq 0x79bd(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x4204(%rip), %rsi      # 0xb850
movb $0x0, %al
callq 0x2150
leaq 0x3f8d(%rip), %rdi      # 0xb5e7
callq 0x21d0
jmp 0x7d16
jmp 0x7666
movq $0x200, -0x60(%rbp)     # imm = 0x200
movq -0x60(%rbp), %rdi
movl $0x1, %esi
callq 0x2130
movq %rax, -0x20(%rbp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2130
movq %rax, -0x30(%rbp)
movl $0x40, %edi
movl $0x8, %esi
callq 0x2130
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x76c6
cmpq $0x0, -0x30(%rbp)
je 0x76c6
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x76e3
movq 0x792b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x41a8(%rip), %rsi      # 0xb87f
movb $0x0, %al
callq 0x2150
jmp 0x7d16
movl $0x1, -0x6c(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x67, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2110
movb %al, -0x31(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2170
cmpl $0x0, %eax
je 0x778c
cmpl $0x65, -0x38(%rbp)
jne 0x7787
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movb $0x0, 0x1(%rax,%rcx)
movq $0x1, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x7785
movq -0x20(%rbp), %rax
movq -0x58(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rsi
imulq 0x8(%rsi), %rcx
addq -0x58(%rbp), %rcx
subq $0x1, %rcx
movb %dl, (%rax,%rcx)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x773e
jmp 0x7787
jmp 0x7ccc
movq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
jl 0x77d8
movq -0x60(%rbp), %rax
shlq %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x21b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x77d6
movq 0x7838(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x40b5(%rip), %rsi      # 0xb87f
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x77d8
movl -0x38(%rbp), %eax
movl %eax, -0x70(%rbp)
subl $0x64, %eax
je 0x7834
jmp 0x77e5
movl -0x70(%rbp), %eax
subl $0x65, %eax
je 0x7a1e
jmp 0x77f3
movl -0x70(%rbp), %eax
subl $0x67, %eax
jne 0x7cc5
jmp 0x7801
movsbl -0x31(%rbp), %edi
callq 0x7d80
cmpl $0x0, %eax
jne 0x782f
movsbl -0x31(%rbp), %eax
cmpl $0x3e, %eax
jne 0x7828
movl $0x64, -0x38(%rbp)
movq -0x20(%rbp), %rax
movb $0x3e, (%rax)
jmp 0x782d
jmp 0x7d16
jmp 0x782f
jmp 0x7cc7
movsbl -0x31(%rbp), %eax
cmpl $0xa, %eax
je 0x784a
movsbl -0x31(%rbp), %eax
cmpl $0xd, %eax
jne 0x7a00
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x65, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $-0x1, -0x48(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x7921
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x68(%rbp), %rsi
shlq $0x3, %rsi
callq 0x21b0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x78ce
movq 0x7740(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3ff3(%rip), %rsi      # 0xb8b5
movb $0x0, %al
callq 0x2150
jmp 0x7d16
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
imulq -0x68(%rbp), %rsi
shlq $0x0, %rsi
callq 0x21b0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x791f
movq 0x76ef(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3fd9(%rip), %rsi      # 0xb8ec
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7921
movq -0x20(%rbp), %rdi
callq 0x20c0
movq %rax, %rdi
movl $0x1, %esi
callq 0x2130
movq %rax, %rdx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x797a
movq 0x7694(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3f47(%rip), %rsi      # 0xb8b5
movb $0x0, %al
callq 0x2150
jmp 0x7d16
cmpl $0x0, -0x6c(%rbp)
je 0x798a
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7996
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7998
movq -0x28(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x71(%rbp)
je 0x79b9
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x79c2
jmp 0x79d0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7998
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x4376(%rip), %rsi      # 0xbd61
movb $0x0, %al
callq 0x21a0
movq -0x30(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movb -0x31(%rbp), %dl
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x40(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x7cc7
movsbl -0x31(%rbp), %eax
cmpl $0x3e, %eax
jne 0x7b57
cmpl $0x0, -0x6c(%rbp)
je 0x7a9c
movl $0x0, -0x6c(%rbp)
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x40, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
imulq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x2130
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x7a9a
movq 0x7574(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x3e5e(%rip), %rsi      # 0xb8ec
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7a9c
cmpl $0x0, -0x6c(%rbp)
jne 0x7ad7
movq -0x40(%rbp), %rax
subq $0x1, %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x7ad5
movq 0x753d(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x50(%rbp), %rdx
leaq 0x3e52(%rip), %rsi      # 0xb91b
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7ad7
movq $0x1, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x7b26
movq -0x20(%rbp), %rax
movq -0x58(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rsi
imulq 0x8(%rsi), %rcx
addq -0x58(%rbp), %rcx
subq $0x1, %rcx
movb %dl, (%rax,%rcx)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x7adf
movl $0x64, -0x38(%rbp)
movq $0x1, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
movb -0x31(%rbp), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x7cc3
movsbl -0x31(%rbp), %edi
callq 0x7d80
cmpl $0x0, %eax
je 0x7b6a
jmp 0x7cc7
cmpl $0x0, -0x6c(%rbp)
jne 0x7ba5
movq -0x40(%rbp), %rax
subq $0x1, %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x7ba3
movq 0x746f(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x50(%rbp), %rdx
leaq 0x3d84(%rip), %rsi      # 0xb91b
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7ba5
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x7c37
movsbl -0x31(%rbp), %edi
callq 0x7de0
cmpl $0x0, %eax
je 0x7be4
movsbl -0x31(%rbp), %edi
callq 0x2090
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x40(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x7c32
movsbl -0x31(%rbp), %edi
callq 0x7e50
cmpl $0x0, %eax
je 0x7c0b
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb $0x3f, (%rax,%rcx)
jmp 0x7c30
movq 0x73e6(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movsbl -0x31(%rbp), %edx
movq -0x50(%rbp), %rcx
leaq 0x3d43(%rip), %rsi      # 0xb967
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7c32
jmp 0x7cc1
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x7cbf
movsbl -0x31(%rbp), %edi
callq 0x7ec0
cmpl $0x0, %eax
je 0x7c72
movsbl -0x31(%rbp), %edi
callq 0x2090
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x40(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x7cbd
movsbl -0x31(%rbp), %edi
callq 0x7f30
cmpl $0x0, %eax
je 0x7c99
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb $0x3f, (%rax,%rcx)
jmp 0x7cbb
movq 0x7358(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movsbl -0x31(%rbp), %edx
movq -0x50(%rbp), %rcx
leaq 0x3cf0(%rip), %rsi      # 0xb9a2
movb $0x0, %al
callq 0x2150
jmp 0x7d16
jmp 0x7cbd
jmp 0x7cbf
jmp 0x7cc1
jmp 0x7cc3
jmp 0x7cc7
jmp 0x7d16
jmp 0x7709
movq -0x40(%rbp), %rax
subq $0x1, %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x7cfc
movq 0x7313(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x50(%rbp), %rdx
leaq 0x3c28(%rip), %rsi      # 0xb91b
movb $0x0, %al
callq 0x2150
jmp 0x7d16
movq -0x30(%rbp), %rdi
callq 0x7fa0
cmpl $0x0, %eax
jne 0x7d0c
jmp 0x7d16
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7d6a
cmpq $0x0, -0x18(%rbp)
je 0x7d49
movq 0x72d4(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2160
movq -0x80(%rbp), %rdi
movq %rax, %rdx
leaq 0x3c98(%rip), %rsi      # 0xb9da
movb $0x0, %al
callq 0x2150
cmpq $0x0, -0x20(%rbp)
je 0x7d59
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x30(%rbp), %rdi
callq 0x8080
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)