// File: rofl0r[P]ascc/cs_parser.cpp
// Function: do_variable_memory_access(ccCompiledScript*, int, int, bool, int, int, bool, bool, int, bool, bool, int, int, bool, bool, int)
int do_variable_memory_access(ccCompiledScript *scrip, int variableSym,
                              int variableSymType, bool isProperty,
                              int writing, int mustBeWritable,
                              bool addressof, bool extraoffset,
                              int soffset, bool isPointer,
                              bool wholePointerAccess,
                              int mainVariableSym, int mainVariableType,
                              bool isDynamicArray, bool negateLiteral,
                              int extra_struct_offset) {
  int gotValType = 0;
  int readcmd = get_readcmd_for_size(sym.entries[variableSym].ssize, writing);

  if (mainVariableType == SYM_VARTYPE) {
    // it's a static member property
    if (!isProperty) {
      cc_error("static non-property access: internal error");
      return -1;
    }
    // just write 0 to AX for ease of debugging if anything
    // goes wrong
    scrip->write_cmd2(SCMD_LITTOREG, SREG_AX, 0);

    gotValType = sym.entries[variableSym].vartype;
    if (sym.entries[variableSym].flags & SFLG_CONST)
      gotValType |= STYPE_CONST;
  }
  else if ((mainVariableType == SYM_LITERALVALUE) || (mainVariableType == SYM_CONSTANT)) {
    if ((writing) || (mustBeWritable)) {
      if(mainVariableType == SYM_LITERALVALUE)
        cc_error("cannot write to a literal value");
      else
        cc_error("cannot write to constant");
      return -1;
    }
    int varSymValue;
    if (accept_literal_or_constant_value(variableSym, varSymValue, negateLiteral, "Error parsing integer value") < 0) {
      return -1;
    }
    if(negateLiteral && varSymValue < 0 && ccGetOption(SCOPT_OLDNEGATE)!=0) {
      scrip->write_cmd2(SCMD_LITTOREG, SREG_AX, varSymValue*-1);
      scrip->write_cmd2(SCMD_LITTOREG, SREG_BX, 0);
      scrip->write_cmd2(SCMD_SUBREG, SREG_BX, SREG_AX);
      scrip->write_cmd2(SCMD_REGTOREG, SREG_BX, SREG_AX);
    } else {
      scrip->write_cmd2(SCMD_LITTOREG,SREG_AX, varSymValue);
    }
    gotValType = sym.normalIntSym;
  }
  else if (mainVariableType == SYM_LITERALFLOAT) {
    if ((writing) || (mustBeWritable)) {
      cc_error("cannot write to a literal value");
      return -1;
    }
    scrip->write_cmd2(SCMD_LITTOREG, SREG_AX, float_to_int_raw((float)atof(sym.get_name(variableSym))));
    gotValType = sym.normalFloatSym;
  }
  else if ((mainVariableType == SYM_LOCALVAR) ||
           (mainVariableType == SYM_GLOBALVAR)) {

    gotValType = sym.entries[variableSym].vartype;
    if (sym.entries[variableSym].flags & SFLG_CONST)
      gotValType |= STYPE_CONST;

    // a "normal" variable
    if (isPointer) {
      // the address is already in MAR by the caller
      if ((!wholePointerAccess) && ((!addressof) || (soffset) || (extraoffset)))
        scrip->write_cmd(SCMD_CHECKNULL);
      if (soffset)
        scrip->write_cmd2(SCMD_ADD, SREG_MAR, soffset);
    }
    else if (mainVariableType == SYM_LOCALVAR) {
      // a local one
      load_stack_variable(scrip, scrip->cur_sp - soffset);
    }
    else {
      // global variable
      if (sym.entries[mainVariableSym].flags & SFLG_IMPORTED) {
        // imported variable, so get the import address and then add any offset
        scrip->write_cmd2(SCMD_LITTOREG,SREG_MAR,sym.entries[mainVariableSym].soffs);
        scrip->fixup_previous(FIXUP_IMPORT);
        if (soffset != 0)
          scrip->write_cmd2(SCMD_ADD,SREG_MAR,soffset);
      }
      else {
        scrip->write_cmd2(SCMD_LITTOREG,SREG_MAR,soffset);
        scrip->fixup_previous(FIXUP_GLOBALDATA);
      }
    }

    if (extraoffset && !isRawPointer(variableSym))
    {
      if (isDynamicArray)
      {
        scrip->write_cmd1(SCMD_MEMREADPTR, SREG_MAR);
        scrip->write_cmd(SCMD_CHECKNULL);
        scrip->write_cmd1(SCMD_DYNAMICBOUNDS, SREG_CX);
      }

      scrip->write_cmd2(SCMD_ADDREG,SREG_MAR,SREG_CX);
    }
    else if (isDynamicArray)
    {
      // not accessing an element of it, must be whole thing
      wholePointerAccess = true;
      gotValType |= STYPE_DYNARRAY;
    }

    if (extra_struct_offset)
      scrip->write_cmd2(SCMD_ADD, SREG_MAR, extra_struct_offset);

    if ((wholePointerAccess) && (writing))
      scrip->write_cmd1(SCMD_MEMWRITEPTR, SREG_AX);
    else if ((wholePointerAccess) && (!writing))
      scrip->write_cmd1(SCMD_MEMREADPTR, SREG_AX);
    else if (addressof)
      scrip->write_cmd2(SCMD_REGTOREG,SREG_MAR,SREG_AX);
    else if(isRawPointer(variableSym)) {
      if (extraoffset) {
        // load pointer value into mar
        scrip->write_cmd1(SCMD_MEMREAD, SREG_MAR);
        // add offset
        scrip->write_cmd2(SCMD_ADDREG,SREG_MAR,SREG_CX);
        // read pointed-to value
        scrip->write_cmd1(readcmd,SREG_AX);
      } else {
        // put pointer value into AX
        scrip->write_cmd1(writing ? SCMD_MEMWRITE : SCMD_MEMREAD, SREG_AX);
      }
    } else
      scrip->write_cmd1(readcmd,SREG_AX);
    }
  else if (mainVariableType == SYM_STRING) {
    if (writing) {
      cc_error("cannot write to a literal string");
      return -1;
    }

    scrip->write_cmd2(SCMD_LITTOREG,SREG_AX,soffset);
    scrip->fixup_previous(FIXUP_STRING);
    gotValType = sym.normalStringSym | STYPE_CONST;
  }
  else if (mainVariableType == SYM_STRUCTMEMBER) {
    cc_error("must include parent structure of member '%s'",sym.get_friendly_name(mainVariableSym).c_str());
    return -1;
    }
  else if (mainVariableType == SYM_NULL) {
    if (writing) {
      cc_error("Invalid use of null");
      return -1;
    }
    scrip->write_cmd2(SCMD_LITTOREG, SREG_AX, 0);
    gotValType = sym.nullSym | STYPE_POINTER;
  }
  else {
    cc_error("read/write ax called with non-variable parameter ('%s')",sym.get_friendly_name(variableSym).c_str());
    return -1;
    }

  if ((addressof) && (!isProperty))
    gotValType |= STYPE_POINTER;
  else if ((isProperty) && (sym.entries[variableSym].flags & SFLG_POINTER))
    gotValType |= STYPE_POINTER;

  if (writing) {
    if (check_type_mismatch(scrip->ax_val_type, gotValType, 1))
      return -1;
  }
  else
    scrip->ax_val_type = gotValType;

  if (isProperty) {
    // process_arrays_and_members will have set addressOf to true,
    // so AX now contains the struct address, and BX
    // contains the new value if this is a Set
    if (call_property_func(scrip, variableSym, writing))
      return -1;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movl %r8d, %r10d
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movb %cl, %r11b
movl 0x58(%rbp), %eax
movb 0x50(%rbp), %al
movb 0x48(%rbp), %cl
movl 0x40(%rbp), %edx
movl 0x38(%rbp), %edx
movb 0x30(%rbp), %dl
movb 0x28(%rbp), %sil
movl 0x20(%rbp), %edi
movb 0x18(%rbp), %dil
movb 0x10(%rbp), %r8b
movq %r15, -0x28(%rbp)
movl %r14d, -0x2c(%rbp)
movl %ebx, -0x30(%rbp)
andb $0x1, %r11b
movb %r11b, -0x31(%rbp)
movl %r10d, -0x38(%rbp)
movl %r9d, -0x3c(%rbp)
andb $0x1, %r8b
movb %r8b, -0x3d(%rbp)
andb $0x1, %dil
movb %dil, -0x3e(%rbp)
andb $0x1, %sil
movb %sil, -0x3f(%rbp)
andb $0x1, %dl
movb %dl, -0x40(%rbp)
andb $0x1, %cl
movb %cl, -0x41(%rbp)
andb $0x1, %al
movb %al, -0x42(%rbp)
movl $0x0, -0x48(%rbp)
movslq -0x2c(%rbp), %rsi
leaq 0x347ab(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq 0x38(%rax), %rax
movl %eax, %edi
movl -0x38(%rbp), %esi
callq 0xb960
movl %eax, -0x4c(%rbp)
cmpl $0x2e, 0x40(%rbp)
jne 0xe16d
testb $0x1, -0x31(%rbp)
jne 0xe109
leaq 0x2414a(%rip), %rdi     # 0x32240
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq -0x28(%rbp), %rdi
movl $0x6, %esi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x25240
movslq -0x2c(%rbp), %rsi
leaq 0x34747(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x30(%rax), %eax
movl %eax, -0x48(%rbp)
movslq -0x2c(%rbp), %rsi
leaq 0x3472c(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq 0x28(%rax), %rax
andq $0x10000, %rax          # imm = 0x10000
cmpq $0x0, %rax
je 0xe168
movl -0x48(%rbp), %eax
orl $0x20000000, %eax       # imm = 0x20000000
movl %eax, -0x48(%rbp)
jmp 0xe7ad
cmpl $0x13, 0x40(%rbp)
je 0xe17d
cmpl $0x14, 0x40(%rbp)
jne 0xe282
cmpl $0x0, -0x38(%rbp)
jne 0xe189
cmpl $0x0, -0x3c(%rbp)
je 0xe1b9
cmpl $0x13, 0x40(%rbp)
jne 0xe19f
leaq 0x240d5(%rip), %rdi     # 0x3226b
movb $0x0, %al
callq 0x1bac0
jmp 0xe1ad
leaq 0x240e5(%rip), %rdi     # 0x3228b
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movl -0x2c(%rbp), %edi
movb -0x42(%rbp), %al
leaq -0x50(%rbp), %rsi
leaq 0x240da(%rip), %rcx     # 0x322a4
andb $0x1, %al
movzbl %al, %edx
callq 0x86e0
cmpl $0x0, %eax
jge 0xe1e5
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
testb $0x1, -0x42(%rbp)
je 0xe25b
cmpl $0x0, -0x50(%rbp)
jge 0xe25b
movl $0x400, %edi            # imm = 0x400
callq 0x265a0
cmpl $0x0, %eax
je 0xe25b
movq -0x28(%rbp), %rdi
imull $-0x1, -0x50(%rbp), %ecx
movl $0x6, %esi
movl $0x3, %edx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0x6, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0xc, %esi
movl $0x4, %edx
movl $0x3, %ecx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0x3, %ecx
movl $0x4, %edx
movl %ecx, %esi
callq 0x25240
jmp 0xe271
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %ecx
movl $0x6, %esi
movl $0x3, %edx
callq 0x25240
leaq 0x345f8(%rip), %rax     # 0x42870
movl (%rax), %eax
movl %eax, -0x48(%rbp)
jmp 0xe7ab
cmpl $0x16, 0x40(%rbp)
jne 0xe303
cmpl $0x0, -0x38(%rbp)
jne 0xe294
cmpl $0x0, -0x3c(%rbp)
je 0xe2ae
leaq 0x23fd0(%rip), %rdi     # 0x3226b
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq -0x28(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x2c(%rbp), %esi
leaq 0x345ad(%rip), %rdi     # 0x42870
callq 0x1f730
movq %rax, %rdi
callq 0x44c0
cvtsd2ss %xmm0, %xmm0
callq 0xa1e0
movq -0xa8(%rbp), %rdi
movl %eax, %ecx
movl $0x6, %esi
movl $0x3, %edx
callq 0x25240
leaq 0x34578(%rip), %rax     # 0x42870
movl 0x14(%rax), %eax
movl %eax, -0x48(%rbp)
jmp 0xe7a9
cmpl $0x2, 0x40(%rbp)
je 0xe313
cmpl $0x1, 0x40(%rbp)
jne 0xe612
movslq -0x2c(%rbp), %rsi
leaq 0x34552(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movswl 0x30(%rax), %eax
movl %eax, -0x48(%rbp)
movslq -0x2c(%rbp), %rsi
leaq 0x34537(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq 0x28(%rax), %rax
andq $0x10000, %rax          # imm = 0x10000
cmpq $0x0, %rax
je 0xe35d
movl -0x48(%rbp), %eax
orl $0x20000000, %eax       # imm = 0x20000000
movl %eax, -0x48(%rbp)
testb $0x1, -0x3f(%rbp)
je 0xe3aa
testb $0x1, -0x40(%rbp)
jne 0xe389
testb $0x1, -0x3d(%rbp)
je 0xe37b
cmpl $0x0, 0x20(%rbp)
jne 0xe37b
testb $0x1, -0x3e(%rbp)
je 0xe389
movq -0x28(%rbp), %rdi
movl $0x34, %esi
callq 0x25140
cmpl $0x0, 0x20(%rbp)
je 0xe3a5
movq -0x28(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0x1, %esi
movl $0x2, %edx
callq 0x25240
jmp 0xe480
cmpl $0x2, 0x40(%rbp)
jne 0xe3d2
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8d40(%rax), %rax
movslq 0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
callq 0x72c0
jmp 0xe47e
movslq 0x38(%rbp), %rsi
leaq 0x34493(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq 0x28(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0xe458
movq -0x28(%rbp), %rax
movq %rax, -0xb0(%rbp)
movslq 0x38(%rbp), %rsi
leaq 0x34466(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq -0xb0(%rbp), %rdi
movl 0x34(%rax), %ecx
movl $0x6, %esi
movl $0x2, %edx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0x4, %esi
callq 0x25820
cmpl $0x0, 0x20(%rbp)
je 0xe456
movq -0x28(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0x1, %esi
movl $0x2, %edx
callq 0x25240
jmp 0xe47c
movq -0x28(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0x6, %esi
movl $0x2, %edx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x25820
jmp 0xe47e
jmp 0xe480
testb $0x1, -0x3e(%rbp)
je 0xe4e7
movl -0x2c(%rbp), %edi
callq 0xdb90
cmpl $0x0, %eax
jne 0xe4e7
testb $0x1, -0x41(%rbp)
je 0xe4cd
movq -0x28(%rbp), %rdi
movl $0x30, %esi
movl $0x2, %edx
callq 0x25200
movq -0x28(%rbp), %rdi
movl $0x34, %esi
callq 0x25140
movq -0x28(%rbp), %rdi
movl $0x47, %esi
movl $0x5, %edx
callq 0x25200
movq -0x28(%rbp), %rdi
movl $0xb, %esi
movl $0x2, %edx
movl $0x5, %ecx
callq 0x25240
jmp 0xe4fe
testb $0x1, -0x41(%rbp)
je 0xe4fc
movb $0x1, -0x40(%rbp)
movl -0x48(%rbp), %eax
orl $0x10000000, %eax       # imm = 0x10000000
movl %eax, -0x48(%rbp)
jmp 0xe4fe
cmpl $0x0, 0x58(%rbp)
je 0xe51a
movq -0x28(%rbp), %rdi
movl 0x58(%rbp), %ecx
movl $0x1, %esi
movl $0x2, %edx
callq 0x25240
testb $0x1, -0x40(%rbp)
je 0xe53e
cmpl $0x0, -0x38(%rbp)
je 0xe53e
movq -0x28(%rbp), %rdi
movl $0x2f, %esi
movl $0x3, %edx
callq 0x25200
jmp 0xe60d
testb $0x1, -0x40(%rbp)
je 0xe562
cmpl $0x0, -0x38(%rbp)
jne 0xe562
movq -0x28(%rbp), %rdi
movl $0x30, %esi
movl $0x3, %edx
callq 0x25200
jmp 0xe60b
testb $0x1, -0x3d(%rbp)
je 0xe582
movq -0x28(%rbp), %rdi
movl $0x3, %ecx
movl $0x2, %edx
movl %ecx, %esi
callq 0x25240
jmp 0xe609
movl -0x2c(%rbp), %edi
callq 0xdb90
cmpl $0x0, %eax
je 0xe5f6
testb $0x1, -0x3e(%rbp)
je 0xe5d3
movq -0x28(%rbp), %rdi
movl $0x7, %esi
movl $0x2, %edx
callq 0x25200
movq -0x28(%rbp), %rdi
movl $0xb, %esi
movl $0x2, %edx
movl $0x5, %ecx
callq 0x25240
movq -0x28(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl $0x3, %edx
callq 0x25200
jmp 0xe5f4
movq -0x28(%rbp), %rdi
movl -0x38(%rbp), %ecx
movl $0x7, %esi
movl $0x8, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movl $0x3, %edx
callq 0x25200
jmp 0xe607
movq -0x28(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl $0x3, %edx
callq 0x25200
jmp 0xe609
jmp 0xe60b
jmp 0xe60d
jmp 0xe7a7
cmpl $0x12, 0x40(%rbp)
jne 0xe673
cmpl $0x0, -0x38(%rbp)
je 0xe638
leaq 0x23c9b(%rip), %rdi     # 0x322c0
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq -0x28(%rbp), %rdi
movl 0x20(%rbp), %ecx
movl $0x6, %esi
movl $0x3, %edx
callq 0x25240
movq -0x28(%rbp), %rdi
movl $0x3, %esi
callq 0x25820
leaq 0x3420d(%rip), %rax     # 0x42870
movl 0x10(%rax), %eax
orl $0x20000000, %eax       # imm = 0x20000000
movl %eax, -0x48(%rbp)
jmp 0xe7a5
cmpl $0xa, 0x40(%rbp)
jne 0xe6e1
movl 0x38(%rbp), %edx
leaq 0x341ed(%rip), %rsi     # 0x42870
leaq -0x70(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x1f080
movq -0xb8(%rbp), %rdi
callq 0x41b0
movq %rax, %rsi
leaq 0x23c38(%rip), %rdi     # 0x322e1
xorl %eax, %eax
callq 0x1bac0
jmp 0xe6b2
leaq -0x70(%rbp), %rdi
callq 0x4270
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4270
jmp 0xe874
cmpl $0x15, 0x40(%rbp)
jne 0xe730
cmpl $0x0, -0x38(%rbp)
je 0xe707
leaq 0x23c1a(%rip), %rdi     # 0x3230e
movb $0x0, %al
callq 0x1bac0
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq -0x28(%rbp), %rdi
movl $0x6, %esi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x25240
leaq 0x3414d(%rip), %rax     # 0x42870
movl 0x1c(%rax), %eax
orl $0x40000000, %eax       # imm = 0x40000000
movl %eax, -0x48(%rbp)
jmp 0xe7a1
movl -0x2c(%rbp), %edx
leaq 0x34136(%rip), %rsi     # 0x42870
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x1f080
movq -0xc0(%rbp), %rdi
callq 0x41b0
movq %rax, %rsi
leaq 0x23bbf(%rip), %rdi     # 0x32322
xorl %eax, %eax
callq 0x1bac0
jmp 0xe76c
leaq -0xa0(%rbp), %rdi
callq 0x4270
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4270
jmp 0xe874
jmp 0xe7a3
jmp 0xe7a5
jmp 0xe7a7
jmp 0xe7a9
jmp 0xe7ab
jmp 0xe7ad
testb $0x1, -0x3d(%rbp)
je 0xe7c6
testb $0x1, -0x31(%rbp)
jne 0xe7c6
movl -0x48(%rbp), %eax
orl $0x40000000, %eax       # imm = 0x40000000
movl %eax, -0x48(%rbp)
jmp 0xe7fd
testb $0x1, -0x31(%rbp)
je 0xe7fb
movslq -0x2c(%rbp), %rsi
leaq 0x34099(%rip), %rdi     # 0x42870
addq $0x28, %rdi
callq 0x17e60
movq 0x28(%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
je 0xe7fb
movl -0x48(%rbp), %eax
orl $0x40000000, %eax       # imm = 0x40000000
movl %eax, -0x48(%rbp)
jmp 0xe7fd
cmpl $0x0, -0x38(%rbp)
je 0xe82a
movq -0x28(%rbp), %rax
movl 0x8d4c(%rax), %edi
movl -0x48(%rbp), %esi
movl $0x1, %edx
callq 0xa7c0
cmpl $0x0, %eax
je 0xe828
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
jmp 0xe837
movl -0x48(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8d4c(%rax)
testb $0x1, -0x31(%rbp)
je 0xe85c
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x38(%rbp), %edx
callq 0xdc50
cmpl $0x0, %eax
je 0xe85a
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0xe863
jmp 0xe85c
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x4670
nopl (%rax)