// File: /workspace/github_cpp_makefile_star2_O1/rofl0r[P]ascc/cs_parser.cpp
// Function: parse_variable_declaration(long, int*, int, int, ccCompiledScript*, ccInternalList*, int, int, int)
int parse_variable_declaration(long cursym,int *next_type,int isglobal,
    int varsize,ccCompiledScript*scrip,ccInternalList*targ, int vtwas,
    int isPointer, int isRawPointer) {
  long lbuffer = 0;
  std::vector<char> xbuffer;
  long *getsvalue = &lbuffer;
  int need_fixup = 0;
  int array_size = 1;
  if (sym.get_type(cursym) != 0) {
    cc_error ("Symbol '%s' already defined");
    return -1;
  }

  if ((sym.entries[vtwas].flags & SFLG_MANAGED) && (!isPointer) && (isglobal != 2)) {
    // managed structs must be allocated via ccRegisterObject,
    // and cannot be declared normally in the script (unless imported)
    cc_error("Cannot declare local instance of managed type");
    return -1;
  }

  if (vtwas == sym.normalVoidSym) {
    cc_error("'void' not a valid variable type");
    return -1;
  }

  sym.entries[cursym].extends = 0;
  sym.entries[cursym].stype = (isglobal != 0) ? SYM_GLOBALVAR : SYM_LOCALVAR;
  if (isRawPointer) {
    sym.entries[cursym].flags |= SFLG_ARRAY;
    sym.entries[cursym].vartype = sym.normalIntSym;
    sym.entries[cursym].arrsize = 0;
    sym.entries[cursym].ssize = varsize;
    vtwas = sym.normalIntSym;
    varsize = 4;
  } else {
    if (isPointer) {
      varsize = 4;
    }
    sym.entries[cursym].arrsize = 1;
    sym.entries[cursym].vartype = vtwas;
    if (isPointer)
      sym.entries[cursym].flags |= SFLG_POINTER;
    sym.entries[cursym].ssize = varsize;
  }

  if (((sym.entries[vtwas].flags & SFLG_MANAGED) == 0) && (isPointer) && (isglobal != 2)) {
    // can only point to managed structs
    cc_error("Cannot declare pointer to non-managed type");
    return -1;
  }

  if (next_type[0] == SYM_OPENBRACKET) {
    // an array
    targ->getnext();  // skip the [

    if (sym.get_type(targ->peeknext()) == SYM_CLOSEBRACKET)
    {
      sym.entries[cursym].flags |= SFLG_DYNAMICARRAY;
      array_size = 0;
      varsize = 4;
      //cc_error("dynamic arrays not yet supported"); return -1;
    }
    else
    {
      int nextt = targ->getnext();

      if (accept_literal_or_constant_value(nextt, array_size, false, "Array size must be constant value") < 0) {
        return -1;
      }

      if (sym.entries[vtwas].flags & SFLG_HASDYNAMICARRAY) {
        cc_error("Cannot declare an array of a type containing dynamic array(s)");
        return -1;
      }

      if (array_size < 1) {
        cc_error("Array size must be >=1");
        return -1;
      }

      varsize *= array_size;
    }
    sym.entries[cursym].flags |= SFLG_ARRAY;
    sym.entries[cursym].arrsize = array_size;

    if (sym.get_type(targ->getnext()) != SYM_CLOSEBRACKET)
    {
      cc_error("expected ']'");
      return -1;
    }

    next_type[0] = sym.get_type(targ->peeknext());
    xbuffer.resize(varsize + 1);
    getsvalue = (long*)&xbuffer.front();
  }
  else if (varsize > 4) {
    xbuffer.resize(varsize + 1);
    getsvalue = (long*)&xbuffer.front();
  }

  if (strcmp(sym.get_name(vtwas),"string")==0) {
    sym.entries[cursym].flags |= SFLG_ISSTRING;
    // if it's a string, allocate it some space
    if (ccGetOption(SCOPT_OLDSTRINGS) == 0) {
      cc_error("type 'string' is no longer supported; use String instead");
      return -1;
    }
    else if (sym.entries[cursym].flags & SFLG_DYNAMICARRAY)
    {
      cc_error("arrays of old-style strings are not supported");
      return -1;
    }
    else if (isglobal == 2) {
      // importing a string
      // cannot import, because string is really char*, and the pointer
      // won't resolve properly
      cc_error("cannot import string; use char[] instead");
      return -1;
    }
    else if (isglobal == 1) {
      getsvalue[0] = scrip->add_global(STRING_LENGTH,NULL);
      if (getsvalue[0] < 0)
        return -1;
      need_fixup = 1;
    }
    else if (isglobal == 0) {
      //getsvalue[0] = scrip->cur_sp;
      getsvalue = NULL;
      // save the address of this bit of memory to assign the pointer to it
      // we can't use scrip->cur_sp since we don't know if we'll be in
      // a nested function call at the time
      scrip->write_cmd2(SCMD_REGTOREG, SREG_SP, SREG_CX);
      //scrip->add_fixup(scrip->codesize-2,FIXUP_STACK);
      scrip->cur_sp += STRING_LENGTH;
      scrip->write_cmd2(SCMD_ADD,SREG_SP,STRING_LENGTH);
      sym.entries[cursym].flags |= SFLG_STRBUFFER;
      //need_fixup = 1;
    }
  }

  // assign an initial value to the variable
  if (next_type[0] == SYM_ASSIGN) {
    if (isglobal == 2) {
      cc_error("cannot set initial value of imported variables");
      return -1;
    }
    if ((sym.entries[cursym].flags & (SFLG_ARRAY | SFLG_DYNAMICARRAY)) == SFLG_ARRAY &&
         !isRawPointer) {
      cc_error("cannot assign value to array");
      return -1;
    }
    if (sym.entries[cursym].flags & SFLG_ISSTRING) {
      cc_error("cannot assign value to string, use StrCopy");
      return -1;
    }
    targ->getnext();  // skip the '='

    int actualVarType = vtwas;
    if (sym.entries[cursym].flags & SFLG_POINTER)
      actualVarType |= STYPE_POINTER;

    if (sym.entries[cursym].flags & SFLG_DYNAMICARRAY)
      actualVarType |= STYPE_DYNARRAY;

    if (isglobal) {
      if ((sym.entries[cursym].flags & (SFLG_POINTER | SFLG_DYNAMICARRAY)) != 0) {
        cc_error("cannot assign initial value to global pointer");
        return -1;
      }
      bool is_neg = false;
      if (sym.get_name(targ->peeknext())[0] == '-') {
        is_neg = true;
        targ->getnext();
      }
      if (sym.entries[cursym].vartype == sym.normalFloatSym) {
        // initialize float
        if (sym.get_type(targ->peeknext()) != SYM_LITERALFLOAT) {
          cc_error("Expected floating point value after '='");
          return -1;
        }
        float tehValue = (float)atof(sym.get_name(targ->getnext()));
        if (is_neg)
          tehValue = -tehValue;
        getsvalue[0] = float_to_int_raw(tehValue);
      }
      else if (sym.entries[cursym].ssize > 4) {
        cc_error("cannot initialize struct type");
        return -1;
      }
      else {
        int getsvalue_int;
        if (accept_literal_or_constant_value(targ->getnext(), getsvalue_int, is_neg, "Expected integer value after '='") < 0) {
          return -1;
        }
        getsvalue[0] = (long)getsvalue_int;

      }
    }
    else {

      if (evaluate_expression(targ,scrip,0,false))
        return -1;

      PerformStringConversionInAX(scrip, &scrip->ax_val_type, actualVarType);

      if (check_type_mismatch(scrip->ax_val_type, actualVarType, 1))
        return -1;
      need_fixup = 2;
    }
    next_type[0] = sym.get_type(targ->peeknext());
  }

  if (isglobal == 2) {
    // an imported variable
    sym.entries[cursym].soffs = scrip->add_new_import(sym.get_name(cursym));
    sym.entries[cursym].flags |= SFLG_IMPORTED;
    if (sym.entries[cursym].soffs == -1) {
      cc_error("Internal error: import table overflow");
      return -1;
      }
    }
  else if (isglobal) {
    // a global variable
    sym.entries[cursym].soffs = scrip->add_global(varsize,reinterpret_cast<const char*>(&getsvalue[0]));
    if (sym.entries[cursym].soffs < 0)
      return -1;
    if (need_fixup == 1) scrip->add_fixup(sym.entries[cursym].soffs,FIXUP_DATADATA);
    }
  else {
    // local variable
    sym.entries[cursym].soffs = scrip->cur_sp;
    scrip->write_cmd2(SCMD_REGTOREG,SREG_SP,SREG_MAR);
    if (need_fixup == 2) {
      // expression worked out into ax
      if ((sym.entries[cursym].flags & (SFLG_POINTER | SFLG_DYNAMICARRAY)) != 0)
      {
        scrip->write_cmd1(SCMD_MEMINITPTR, SREG_AX);
      }
      else
        scrip->write_cmd1(get_readcmd_for_size(varsize,1),SREG_AX);
    }
    else if (getsvalue == NULL)
      // local string, so the memory chunk pointer needs to be written
      scrip->write_cmd1(SCMD_MEMWRITE, SREG_CX);
    else { // local variable without initial value -- zero it
      if(compiler_max_command >= SCMD_ZEROMEMORY)
        scrip->write_cmd1(SCMD_ZEROMEMORY, varsize);
      else
        scrip->write_cmd2(SCMD_WRITELIT, varsize, 0);
    }

    if (need_fixup == 1) {
      sym.entries[cursym].flags |= SFLG_STRBUFFER;
      scrip->fixup_previous(FIXUP_STACK);
    }
    if(varsize > 0) {
      scrip->cur_sp += varsize;
      scrip->write_cmd2(SCMD_ADD,SREG_SP,varsize);
    }
  }
  if (next_type[0] == SYM_COMMA) {
    targ->getnext();  // skip the comma
    return 2;
    }
  if (check_not_eof(*targ))
    return -1;
  if (next_type[0] != SYM_SEMICOLON) {
    cc_error("Expected ',' or ';', not '%s'",sym.get_friendly_name(targ->peeknext()).c_str());
    return -1;
    }
  targ->getnext();  // skip the semicolon
  return 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, (%rsp)
movq %r8, 0x10(%rsp)
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r13
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movl $0x1, 0x24(%rsp)
leaq 0x1a4f0(%rip), %rbx     # 0x256e0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x111aa
testl %eax, %eax
je 0xb20b
leaq 0x10662(%rip), %rdi     # 0x1b868
jmp 0xb2f9
movl 0xb8(%rsp), %ecx
movl 0xb0(%rsp), %r12d
movq 0x28(%rbx), %rax
cmpl $0x2, %ebp
je 0xb24a
testl %ecx, %ecx
jne 0xb24a
movslq %r12d, %rdx
imulq $0xb0, %rdx, %rdx
movq 0x28(%rax,%rdx), %rdx
andl $0x1000, %edx           # imm = 0x1000
je 0xb24a
leaq 0x1063f(%rip), %rdi     # 0x1b884
jmp 0xb2f9
cmpl %r12d, 0x18(%rbx)
jne 0xb25c
leaq 0x1065b(%rip), %rdi     # 0x1b8b2
jmp 0xb2f9
imulq $0xb0, %r13, %rdi
leaq (%rax,%rdi), %rdx
movw $0x0, 0x50(%rax,%rdi)
xorl %esi, %esi
cmpl $0x1, %ebp
adcw $0x1, %si
movq %rdi, 0x8(%rsp)
movw %si, 0x20(%rax,%rdi)
cmpl $0x0, 0xc0(%rsp)
je 0xb2a6
orb $0x2, 0x28(%rdx)
movl (%rbx), %r12d
movw %r12w, 0x30(%rdx)
movq $0x0, 0x48(%rdx)
movl $0x4, %esi
jmp 0xb2c7
movl $0x4, %esi
movq $0x1, 0x48(%rdx)
movw %r12w, 0x30(%rdx)
testl %ecx, %ecx
cmovnel %esi, %r15d
je 0xb2c4
orb $0x1, 0x29(%rdx)
movl %r15d, %esi
movq %rsi, 0x18(%rsp)
movslq %r15d, %rsi
movq %rsi, 0x38(%rdx)
movslq %r12d, %rdx
imulq $0xb0, %rdx, %rbx
cmpl $0x2, %ebp
je 0xb32f
testl %ecx, %ecx
je 0xb32f
movq 0x28(%rax,%rbx), %rax
andl $0x1000, %eax           # imm = 0x1000
jne 0xb32f
leaq 0xfbf4(%rip), %rdi      # 0x1aeed
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x10418
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xb31d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3320
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x7, (%r14)
jne 0xb38a
movq (%rsp), %rdi
callq 0x10f88
movq (%rsp), %rdi
callq 0x10f22
leaq 0x1a392(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x111aa
cmpl $0x8, %eax
jne 0xb3b0
leaq 0x1a37f(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
orq $0x40000, 0x28(%rax,%rcx) # imm = 0x40000
movl $0x0, 0x24(%rsp)
movl $0x4, %eax
movq %rax, 0x18(%rsp)
jmp 0xb428
movq 0x18(%rsp), %rax
cmpl $0x5, %eax
jl 0xb3a6
leal 0x1(%rax), %esi
leaq 0x30(%rsp), %rdi
callq 0xfb22
jmp 0xb496
leaq 0x70(%rsp), %rax
jmp 0xb49b
movq (%rsp), %rdi
callq 0x10f88
leaq 0x10513(%rip), %rcx     # 0x1b8d3
leaq 0x24(%rsp), %rsi
movl %eax, %edi
xorl %edx, %edx
callq 0x60a8
testl %eax, %eax
movq 0x18(%rsp), %rcx
js 0xb3fd
leaq 0x1a302(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
testb $0x10, 0x2a(%rax,%rbx)
jne 0xb401
movl 0x24(%rsp), %eax
testl %eax, %eax
jle 0xb40a
imull %ecx, %eax
movb $0x1, %bl
movq %rax, 0x18(%rsp)
jmp 0xb41a
xorl %ebx, %ebx
jmp 0xb41a
leaq 0x104ed(%rip), %rdi     # 0x1b8f5
jmp 0xb411
leaq 0x10522(%rip), %rdi     # 0x1b933
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10418
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %bl, %bl
je 0xb306
leaq 0x1a2b1(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rdx
orq $0x2, 0x28(%rax,%rdx)
movslq 0x24(%rsp), %rcx
movq %rcx, 0x48(%rax,%rdx)
movq (%rsp), %rdi
callq 0x10f88
leaq 0x1a288(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x111aa
cmpl $0x8, %eax
jne 0xb569
movq (%rsp), %rdi
callq 0x10f22
leaq 0x1a268(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x111aa
movl %eax, (%r14)
movq 0x18(%rsp), %rax
incl %eax
movslq %eax, %rsi
leaq 0x30(%rsp), %rdi
callq 0xfb22
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x1a239(%rip), %rdi     # 0x256e0
movl %r12d, %esi
callq 0x1263e
leaq 0x11f43(%rip), %rsi     # 0x1d3f9
movq %rax, %rdi
callq 0x3450
xorl %ebx, %ebx
testl %eax, %eax
je 0xb4e3
cmpl $0x19, (%r14)
jne 0xb828
cmpl $0x2, %ebp
jne 0xb575
leaq 0x10509(%rip), %rdi     # 0x1b9e7
jmp 0xb2f9
leaq 0x1a1f6(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
orq $0x20, 0x28(%rax,%rcx)
movl $0x80, %edi
callq 0x140a4
testl %eax, %eax
je 0xb5f4
leaq 0x1a1ce(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
testb $0x4, 0x2a(%rax,%rcx)
jne 0xb600
testl %ebp, %ebp
je 0xb630
cmpl $0x2, %ebp
je 0xb624
cmpl $0x1, %ebp
jne 0xb4c4
movq 0x10(%rsp), %rdi
movl $0xc8, %esi
xorl %edx, %edx
callq 0x13816
cltq
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, %ebx
testl %eax, %eax
jns 0xb4c4
jmp 0xb950
leaq 0x103da(%rip), %rdi     # 0x1b94a
jmp 0xb2f9
cmpl $0x0, 0xc0(%rsp)
sete %cl
leaq 0x1a159(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rdx
movq 0x28(%rax,%rdx), %rax
movl %eax, %edx
andl $0x40002, %edx          # imm = 0x40002
cmpl $0x2, %edx
sete %dl
testb %dl, %cl
jne 0xb60c
testb $0x20, %al
jne 0xb618
movq (%rsp), %rdi
callq 0x10f88
leaq 0x1a125(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x28(%rax,%rcx), %r15
testl %ebp, %ebp
je 0xb693
testl $0x40100, %r15d         # imm = 0x40100
je 0xb6fd
xorl %r12d, %r12d
leaq 0x10476(%rip), %rdi     # 0x1ba5e
xorl %eax, %eax
callq 0x10418
jmp 0xb819
leaq 0x1035c(%rip), %rdi     # 0x1b957
jmp 0xb2f9
leaq 0x10389(%rip), %rdi     # 0x1b990
jmp 0xb2f9
leaq 0x10403(%rip), %rdi     # 0x1ba16
jmp 0xb2f9
leaq 0x10414(%rip), %rdi     # 0x1ba33
jmp 0xb2f9
leaq 0x10393(%rip), %rdi     # 0x1b9be
jmp 0xb2f9
movq 0x10(%rsp), %rdi
movl $0x3, %esi
movl $0x1, %edx
movl $0x5, %ecx
callq 0x1361c
movq 0x10(%rsp), %rdi
addq $0xc8, 0x8d40(%rdi)
movl $0x1, %esi
movl $0x1, %edx
movl $0xc8, %ecx
callq 0x1361c
leaq 0x1a06c(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
orq $0x10, 0x28(%rax,%rcx)
movq $0x0, 0x28(%rsp)
xorl %ebx, %ebx
jmp 0xb4c4
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x592e
testl %eax, %eax
jne 0xb6f5
movl %r15d, %eax
shll $0x16, %eax
andl $0x40000000, %eax       # imm = 0x40000000
shll $0xa, %r15d
andl $0x10000000, %r15d      # imm = 0x10000000
orl %eax, %r15d
orl %r12d, %r15d
movq 0x10(%rsp), %rdi
leaq 0x8d4c(%rdi), %r12
movq %r12, %rsi
movl %r15d, %edx
callq 0x7fab
movl (%r12), %edi
movl %r15d, %esi
movl $0x1, %edx
callq 0x76b5
testl %eax, %eax
je 0xb7f7
xorl %r12d, %r12d
jmp 0xb819
movq (%rsp), %rdi
callq 0x10f22
leaq 0x19fd3(%rip), %r15     # 0x256e0
movq %r15, %rdi
movl %eax, %esi
callq 0x1263e
movb (%rax), %r12b
cmpb $0x2d, %r12b
jne 0xb729
movq (%rsp), %rdi
callq 0x10f88
movq 0x28(%r15), %rax
movq 0x8(%rsp), %rdx
movswl 0x30(%rax,%rdx), %ecx
cmpl %ecx, 0x14(%r15)
jne 0xb795
movq (%rsp), %rdi
callq 0x10f22
leaq 0x19f93(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x111aa
cmpl $0x16, %eax
jne 0xb7e4
movq (%rsp), %rdi
callq 0x10f88
leaq 0x19f73(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x1263e
movq %rax, %rdi
callq 0x3410
cvtsd2ss %xmm0, %xmm0
cmpb $0x2d, %r12b
jne 0xb78d
xorps 0xf0b3(%rip), %xmm0     # 0x1a840
movd %xmm0, %eax
cltq
jmp 0xb7da
addq %rdx, %rax
cmpq $0x5, 0x38(%rax)
jl 0xb7a8
leaq 0x1030e(%rip), %rdi     # 0x1bab4
jmp 0xb7eb
movq (%rsp), %rdi
callq 0x10f88
xorl %edx, %edx
cmpb $0x2d, %r12b
sete %dl
leaq 0x10311(%rip), %rcx     # 0x1bad2
leaq 0x50(%rsp), %rsi
movl %eax, %edi
callq 0x60a8
testl %eax, %eax
js 0xb6f5
movslq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
jmp 0xb7fc
leaq 0x102a1(%rip), %rdi     # 0x1ba8c
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x10418
jmp 0xb819
movl $0x2, %ebx
movq (%rsp), %rdi
callq 0x10f22
leaq 0x19ed4(%rip), %rdi     # 0x256e0
movl %eax, %esi
callq 0x111aa
movl %eax, (%r14)
movb $0x1, %r12b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %r12b, %r12b
je 0xb306
cmpl $0x2, %ebp
jne 0xb873
leaq 0x19eac(%rip), %rbx     # 0x256e0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x1263e
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x139e4
movq 0x28(%rbx), %rcx
movq 0x8(%rsp), %rdx
movl %eax, 0x34(%rcx,%rdx)
orb $0x4, 0x28(%rcx,%rdx)
cmpl $-0x1, %eax
jne 0xb9f4
leaq 0x10285(%rip), %rdi     # 0x1baf3
jmp 0xb2f9
testl %ebp, %ebp
je 0xb8c6
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x13816
leaq 0x19e4e(%rip), %rcx     # 0x256e0
movq 0x28(%rcx), %rcx
movq 0x8(%rsp), %rdx
movl %eax, 0x34(%rcx,%rdx)
testl %eax, %eax
js 0xb950
cmpl $0x1, %ebx
jne 0xb9f4
movq 0x10(%rsp), %rdi
movl %eax, %esi
movl $0x5, %edx
callq 0x138f8
jmp 0xb9f4
movq 0x10(%rsp), %rdi
movl 0x8d40(%rdi), %eax
leaq 0x19e08(%rip), %rcx     # 0x256e0
movq 0x28(%rcx), %rcx
movq 0x8(%rsp), %rdx
movl %eax, 0x34(%rcx,%rdx)
movl $0x3, %esi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x1361c
cmpl $0x2, %ebx
jne 0xb95b
leaq 0x19ddb(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
movzwl 0x29(%rax,%rcx), %eax
movl $0x3, %edx
movl $0x32, %esi
testl $0x401, %eax            # imm = 0x401
movq 0x18(%rsp), %rdi
jne 0xb997
cmpl $0x2, %edi
movl $0x1b, %eax
movl $0x8, %ecx
cmovel %eax, %ecx
cmpl $0x1, %edi
movl $0x1a, %esi
cmovnel %ecx, %esi
testl %edi, %edi
je 0xb997
movl %edi, 0x19d62(%rip)     # 0x256b0
jmp 0xb997
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0xb306
cmpq $0x0, 0x28(%rsp)
movq 0x18(%rsp), %rax
je 0xb98d
movl $0x3f, %esi
cmpl $0x3f, 0x1998c(%rip)    # 0x25300
movl %eax, %edx
jge 0xb997
movq 0x10(%rsp), %rdi
movl $0x4, %esi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x1361c
jmp 0xb9a1
movl $0x5, %edx
movl $0x8, %esi
movq 0x10(%rsp), %rdi
callq 0x135fc
cmpl $0x1, %ebx
jne 0xb9cb
leaq 0x19d33(%rip), %rax     # 0x256e0
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rcx
orq $0x10, 0x28(%rax,%rcx)
movq 0x10(%rsp), %rdi
movl $0x6, %esi
callq 0x13950
cmpl $0x0, 0x18(%rsp)
jle 0xb9f4
movq 0x18(%rsp), %rcx
movl %ecx, %eax
movq 0x10(%rsp), %rdi
addq %rax, 0x8d40(%rdi)
movl $0x1, %esi
movl $0x1, %edx
callq 0x1361c
cmpl $0x2a, (%r14)
jne 0xba0e
movl $0x2, %r15d
movq (%rsp), %rdi
callq 0x10f88
jmp 0xb306
movq (%rsp), %rdi
callq 0x62f5
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xb306
cmpl $0x28, (%r14)
jne 0xba3c
xorl %r15d, %r15d
movq (%rsp), %rdi
callq 0x10f88
jmp 0xb306
movq (%rsp), %rdi
callq 0x10f22
leaq 0x19c94(%rip), %rsi     # 0x256e0
leaq 0x50(%rsp), %rdi
movl %eax, %edx
callq 0x11fa0
movq 0x50(%rsp), %rsi
leaq 0x100b5(%rip), %rdi     # 0x1bb19
xorl %eax, %eax
callq 0x10418
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb306
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3320
jmp 0xb306
jmp 0xbabb
jmp 0xbabb
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbabe
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3320
jmp 0xbabe
jmp 0xbabb
jmp 0xbabb
jmp 0xbabb
jmp 0xbabb
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xbad5
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3320
movq %rbx, %rdi
callq 0x3560