LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_parser.cpp
// Function: extractPathIntoParts(VariableSymlist*, int, long*)
int extractPathIntoParts(VariableSymlist *variablePath, int slilen, long *syml) {
  int variablePathSize = 0;
  int lastOffs = 0;
  int pp;

  // Separate out syml into a VariablePath for the clause
  // between each dot. If it's just a simple variable access,
  // we will only create one.
  for (pp = 0; pp < slilen; pp++) {
    if ((sym.get_type(syml[pp]) == SYM_OPENBRACKET) ||
        (sym.get_type(syml[pp]) == SYM_OPENPARENTHESIS)) {
      // an array index, skip it
      pp = findClosingBracketOffs(pp, syml, slilen);
    }

    int createPath = 0;

    if (sym.get_type(syml[pp]) == SYM_DOT) {
      createPath = 1;
    }
    else if (pp >= slilen - 1) {
      // end of data stream, store the last bit
      pp++;
      createPath = 1;
    }

    if (createPath) {
      if (variablePathSize >= MAX_VARIABLE_PATH) {
        cc_error("variable path too long");
        return -1;
      }
      VariableSymlist *vpp = &variablePath[variablePathSize];
      vpp->init(pp - lastOffs);
      for (int ee = 0; ee < vpp->len; ee++) {
        vpp->syml[ee] = syml[lastOffs + ee];
      }
      lastOffs = pp + 1;
      variablePathSize++;
    }
  }

  return variablePathSize;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
testl %esi, %esi
jle 0x80e1
movq %rdx, %rbx
movl %esi, %r14d
leal -0x1(%r14), %eax
movl %eax, (%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %r14, 0x8(%rsp)
movslq %r13d, %r15
movl (%rbx,%r15,8), %esi
leaq 0x1d6cc(%rip), %rdi     # 0x256e0
callq 0x1106e
cmpl $0x7, %eax
je 0x8033
movl (%rbx,%r15,8), %esi
leaq 0x1d6b7(%rip), %rdi     # 0x256e0
callq 0x1106e
cmpl $0x5, %eax
jne 0x8047
movl %r13d, %edi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x7f04
movl %eax, %r13d
movslq %eax, %r15
movl (%rbx,%r15,8), %esi
leaq 0x1d68e(%rip), %rdi     # 0x256e0
callq 0x1106e
cmpl $0x9, %eax
jne 0x8061
movl %r13d, %r15d
jmp 0x806b
leal 0x1(%r13), %r15d
cmpl (%rsp), %r13d
jl 0x80d3
cmpl $0x9, %ebp
jg 0x80e5
movl %ebp, 0x4(%rsp)
movslq %ebp, %r13
shlq $0x4, %r13
movl %r15d, %eax
subl %r12d, %eax
movq 0x10(%rsp), %rbp
movl %eax, (%rbp,%r13)
movslq %eax, %r14
leaq (,%r14,8), %rdi
callq 0x3440
movq %rax, 0x8(%rbp,%r13)
testl %r14d, %r14d
jle 0x80c2
movslq %r12d, %rcx
leaq (%rbx,%rcx,8), %rsi
notl %r12d
addl %r15d, %r12d
leaq 0x8(,%r12,8), %rdx
movq %rax, %rdi
callq 0x3290
incl %r15d
movl 0x4(%rsp), %ebp
incl %ebp
movl %r15d, %r12d
movq 0x8(%rsp), %r14
movl %r15d, %r13d
cmpl %r14d, %r15d
jl 0x8006
jmp 0x80f8
xorl %ebp, %ebp
jmp 0x80f8
leaq 0x13100(%rip), %rdi     # 0x1b1ec
xorl %eax, %eax
callq 0x102f4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_parser.cpp
// Function: get_readcmd_for_size(int, int)
int get_readcmd_for_size(int sizz, int writeinstead) {
  int readcmd = SCMD_MEMREAD;
  if (writeinstead) {
    readcmd = SCMD_MEMWRITE;
    if (sizz == 1)
      readcmd = SCMD_MEMWRITEB;
    else if (sizz == 2)
      readcmd = SCMD_MEMWRITEW;
    }
  else if (sizz == 1)
    readcmd = SCMD_MEMREADB;
  else if (sizz == 2)
    readcmd = SCMD_MEMREADW;

  if (sizz!=0)
    readcmd_lastcalledwith = sizz;
  return readcmd;
  }

// Assembly:
testl %edi, %edi
je 0x8113
movl %edi, 0x1d59d(%rip)     # 0x256b0
cmpl $0x2, %edi
movl $0x19, %eax
movl $0x7, %ecx
cmovel %eax, %ecx
movl $0x1b, %eax
movl $0x8, %edx
cmovel %eax, %edx
cmpl $0x1, %edi
movl $0x18, %edi
cmovnel %ecx, %edi
movl $0x1a, %eax
cmovnel %edx, %eax
testl %esi, %esi
cmovel %edi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_parser.cpp
// Function: isRawPointer(int)
static int isRawPointer(int n) {
  return sym.entries[n].vartype == sym.normalIntSym &&
         sym.entries[n].flags & SFLG_ARRAY &&
         sym.entries[n].arrsize == 0 &&
         (sym.entries[n].flags & SFLG_DYNAMICARRAY) == 0;
}

// Assembly:
movslq %edi, %rax
leaq 0x1bfdf(%rip), %rsi     # 0x256e0
movq 0x28(%rsi), %rcx
imulq $0xb0, %rax, %rdx
movswl 0x30(%rcx,%rdx), %edi
xorl %eax, %eax
cmpl %edi, (%rsi)
jne 0x972a
addq %rdx, %rcx
movq 0x28(%rcx), %rdx
testb $0x2, %dl
je 0x972a
cmpq $0x0, 0x48(%rcx)
je 0x972b
retq
xorl %eax, %eax
btl $0x12, %edx
setae %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cs_parser.cpp
// Function: cc_compile(char const*, ccCompiledScript*)
int cc_compile(const char*inpl, ccCompiledScript*scrip) {
    int toret = 0;
   /* this block of code until after free() is commented out in upstream ags,
      they replaced it with a C# version */
    /* this malloc might not alloc enough memory */
    char*mainbuf=(char*)malloc(strlen(inpl)+5000);
    ccError = 0;
    // run the preprocessor on the code
    cc_preprocess(inpl, mainbuf);
    if (ccError) return -1;
    // now, compile the preprocessed code
    if (__cc_compile_file(mainbuf,scrip))
    toret=-1;
    free(mainbuf);

    return toret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x31a0
leaq 0x1388(%rax), %rdi
callq 0x3440
movq %rax, %r14
leaq 0x15e83(%rip), %r12     # 0x256c0
movl $0x0, (%r12)
movq %r15, %rdi
movq %rax, %rsi
callq 0x1773d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x0, (%r12)
jne 0xf875
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb7ec
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
movq %r14, %rdi
callq 0x33c0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_treemap.cpp
// Function: ccTreeMap::findValue(char const*)
int ccTreeMap::findValue(const char *key) {
	if (!key || strlen(key) <= 0) { return -1; }
    std::string cppkey(key);
    if (this->storage.count(cppkey) <= 0) { return -1; }
    return this->storage[cppkey];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x1061b
movq %rsi, %r14
cmpb $0x0, (%rsi)
je 0x1061b
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r14, %rdi
callq 0x31a0
leaq (%rax,%r14), %rdx
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1015a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10868
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x10600
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x106f8
movl (%rax), %ebp
jmp 0x10605
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1061b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3320
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x10643
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3320
movq %rbx, %rdi
callq 0x3560
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_internallist.cpp
// Function: ccInternalList::peeknext()
long ccInternalList::peeknext() {
    int tpos = pos;
	// this should work even if 3 bytes aren't remaining
	while (isPosValid(tpos) && (script[tpos] == SCODE_META)) {
        tpos+=3;
	}

	if (isPosValid(tpos)) {
		return script[tpos];
	} else {
        return SCODE_INVALID;
	}
}

// Assembly:
movl (%rdi), %ecx
movl 0x10(%rdi), %edx
testl %edx, %edx
setns %al
cmpl %edx, %ecx
setg %sil
andb %al, %sil
movq $-0x1, %rax
cmpb $0x1, %sil
jne 0x10e3b
movl %edx, %esi
movq 0x8(%rdi), %rdx
cmpq $-0x2, (%rdx,%rsi,8)
jne 0x10e3c
addq $0x3, %rsi
cmpl %esi, %ecx
jg 0x10e2c
retq
movl %esi, %eax
movq (%rdx,%rax,8), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_internallist.cpp
// Function: ccInternalList::write(int)
void ccInternalList::write(int value) {
    if ((length+1) * sizeof(long) >= (unsigned long)allocated) {

		if (allocated < 1000) {
            allocated += 1000;
		} else {
            allocated *= 2;
		}

        script = (long*)realloc(script, allocated);
		// TODO: this doesn't check realloc result
    }
    script[length] = value;
    length ++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq (%rdi), %rcx
leaq 0x8(,%rcx,8), %rdx
movslq 0x4(%rdi), %rax
cmpq %rax, %rdx
jae 0x10f2c
movq %rcx, %rdx
incq %rdx
movq 0x8(%rbx), %rax
jmp 0x10f54
leal (%rax,%rax), %ecx
movl $0x3e8, %edx            # imm = 0x3E8
leal (%rax,%rdx), %esi
cmpl %edx, %eax
cmovgel %ecx, %esi
movl %esi, 0x4(%rbx)
movq 0x8(%rbx), %rdi
movslq %esi, %rsi
callq 0x3520
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movslq %ebp, %rsi
movslq %ecx, %rcx
movq %rsi, (%rax,%rcx,8)
movl %edx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_symboltable.cpp
// Function: symbolTable::get_type(int)
int symbolTable::get_type(int ii) {
    // just return the real type, regardless of pointerness/constness
    ii &= STYPE_MASK;
	if ((ii < 0) || ((size_t)ii >= entries.size())) { return -1; }
    return entries[ii].stype;
}

// Assembly:
andl $0xfffffff, %esi        # imm = 0xFFFFFFF
movq 0x28(%rdi), %rcx
movq 0x30(%rdi), %rax
subq %rcx, %rax
sarq $0x4, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rdx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rax, %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
jbe 0x110a7
imulq $0xb0, %rsi, %rax
movswl 0x20(%rcx,%rax), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_symboltable.cpp
// Function: symbolTable::add_operator(char const*, int, int)
int symbolTable::add_operator(const char *nta, int priority, int vcpucmd) {
    int nss = add_ex(nta, SYM_OPERATOR, priority);
	if (nss >= 0) {
        entries[nss].vartype = vcpucmd;
	}
    return nss;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdi, %r14
movsbl %dl, %ecx
movl $0x3, %edx
callq 0x11aaa
testl %eax, %eax
js 0x11e14
movl %eax, %ecx
movq 0x28(%r14), %rdx
imulq $0xb0, %rcx, %rcx
movw %bx, 0x30(%rdx,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_symboltable.cpp
// Function: symbolTable::get_name(int)
const char *symbolTable::get_name(int idx) {
	if (nameGenCache.count(idx) > 0) {
		return nameGenCache[idx];
	}

	int actualIdx = idx & STYPE_MASK;
	if (actualIdx < 0 || (size_t)actualIdx >= entries.size()) { return NULL; }

	std::string resultString = get_name_string(idx);
	char *result = (char *)malloc(resultString.length() + 1);
	strcpy(result, resultString.c_str());
	nameGenCache[idx] = result;
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %edx
movq %rdi, %rsi
movl %edx, 0xc(%rsp)
leaq 0x40(%rdi), %rbx
movq 0x50(%rdi), %rax
testq %rax, %rax
je 0x1250e
leaq 0x48(%rsi), %rdi
movq %rdi, %rcx
xorl %r8d, %r8d
cmpl %edx, 0x20(%rax)
setl %r8b
cmovgeq %rax, %rcx
movq 0x10(%rax,%r8,8), %rax
testq %rax, %rax
jne 0x124ec
cmpq %rdi, %rcx
je 0x1250e
cmpl %edx, 0x20(%rcx)
jle 0x1258d
movl %edx, %eax
andl $0xfffffff, %eax        # imm = 0xFFFFFFF
movq 0x30(%rsi), %rcx
subq 0x28(%rsi), %rcx
sarq $0x4, %rcx
movabsq $0x2e8ba2e8ba2e8ba3, %rdi # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rdi
cmpq %rax, %rdi
jbe 0x12588
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1214a
movq 0x8(%r15), %rdi
incq %rdi
callq 0x3440
movq %rax, %r14
movq (%r15), %rsi
movq %rax, %rdi
callq 0x32d0
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x125da
movq %r14, (%rax)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1259d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3320
jmp 0x1259d
xorl %r14d, %r14d
jmp 0x1259d
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x125da
movq (%rax), %r14
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x125c8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3320
movq %rbx, %rdi
callq 0x3560
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/fmem.cpp
// Function: fmem_create()
FMEM*fmem_create() {
  tempy=(FMEM*)malloc(sizeof(FMEM));
  tempy->size=100;
  tempy->len=0;
  tempy->data=(char*)malloc(tempy->size+10);
  tempy->data[0]=0;
  tempy->magic=FMEM_MAGIC;
  tempy->pos=0;
  return tempy;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x28, %edi
callq 0x3440
movq %rax, %rbx
movq %rax, 0x12628(%rip)     # 0x25798
movq $0x64, 0x10(%rax)
xorl %r14d, %r14d
movq %r14, 0x8(%rax)
movl $0x6e, %edi
callq 0x3440
movq %rax, (%rbx)
movb $0x0, (%rax)
movl $0xcddebeef, %eax       # imm = 0xCDDEBEEF
movq %rax, 0x18(%rbx)
movq %r14, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/fmem.cpp
// Function: fmem_close(FMEM*)
void fmem_close(FMEM*cloo) {
  if (cloo==NULL) return;
  if (cloo->magic != FMEM_MAGIC) return;   // uninitialized
  free(cloo->data);
  free(cloo);
  }

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x1322e
movq %rdi, %rbx
movl $0xcddebeef, %eax       # imm = 0xCDDEBEEF
cmpq %rax, 0x18(%rdi)
jne 0x1322e
movq (%rbx), %rdi
callq 0x33c0
movq %rbx, %rdi
popq %rbx
jmp 0x33c0
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/fmem.cpp
// Function: fmem_putc(char, FMEM*)
void fmem_putc(char toput,FMEM*fill) {
  char templ[2];
  templ[0]=toput;
  templ[1]=0;
  fmem_write(&templ[0],1,fill);
  }

// Assembly:
pushq %rax
movq %rsi, %rdx
leaq 0x6(%rsp), %rax
movb %dil, (%rax)
movb $0x0, 0x1(%rax)
movl $0x1, %esi
movq %rax, %rdi
callq 0x13230
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/fmem.cpp
// Function: fmem_puts(char const*, FMEM*)
void fmem_puts(const char*strin,FMEM*ooo) {
  char buf[1024], *p;
  size_t l = strlen(strin);
  if(l+3 < sizeof buf)
    p = buf;
  else
    p = (char*)malloc(l+3);
  sprintf(p, "%s\r\n",strin);
  fmem_write(p,l+2,ooo);
  if(p != buf) free(p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %rbx
movq %rdi, %r12
callq 0x31a0
movq %rax, %r14
leaq 0x3(%rax), %rdi
movq %rsp, %r13
movq %r13, %r15
cmpq $0x400, %rdi            # imm = 0x400
jb 0x13314
callq 0x3440
movq %rax, %r15
leaq 0x9805(%rip), %rsi      # 0x1cb20
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x30d0
addq $0x2, %r14
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x13230
cmpq %r13, %r15
je 0x13347
movq %r15, %rdi
callq 0x33c0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::write_code(int)
void ccCompiledScript::write_code(int32_t byy) {
    flush_line_numbers();
    if (codesize >= codeallocated - 2) {
        codeallocated += 500;
        code = (int32_t*)realloc(code,codeallocated*sizeof(int32_t));
    }
    code[codesize] = byy;
    codesize++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x13c16
movslq 0x20(%rbx), %rcx
movq 0x90(%rbx), %rax
leaq -0x2(%rax), %rdx
cmpq %rcx, %rdx
jle 0x13439
movq 0x18(%rbx), %rax
jmp 0x13460
leaq 0x1f4(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq 0x18(%rbx), %rdi
leaq 0x7d0(,%rax,4), %rsi
callq 0x3520
movq %rax, 0x18(%rbx)
movslq 0x20(%rbx), %rcx
movl %ebp, (%rax,%rcx,4)
incl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::write_cmd3(int, int, int, int)
void ccCompiledScript::write_cmd3(int cmdd,int param,int param2,int param3) {
    write_code(cmdd);
    write_code(param);
    write_code(param2);
    write_code(param3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %r15
callq 0x13412
movq %r15, %rdi
movl %r14d, %esi
callq 0x13412
movq %r15, %rdi
movl %ebp, %esi
callq 0x13412
movq %r15, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13412
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::add_global(int, char const*)
int ccCompiledScript::add_global(int siz,const char*vall) {
    //  printf("Add global size %d at %d\n",siz,globaldatasize);
    //  if (remove_any_import (vall)) return -2;
    globaldata = (char*)realloc(globaldata, globaldatasize + siz);
    if (vall != NULL)
        memcpy(&globaldata[globaldatasize],vall,siz);
    else memset(&globaldata[globaldatasize],0,siz);
    int toret = globaldatasize;
    globaldatasize += siz;
    return toret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movslq 0x10(%r14), %rsi
movslq %ebx, %r12
addq %r12, %rsi
callq 0x3520
movq %rax, 0x8(%r14)
movslq 0x10(%r14), %r15
addq %r15, %rax
movq %rax, %rdi
testq %r13, %r13
je 0x136cc
movq %r13, %rsi
movq %r12, %rdx
callq 0x3290
jmp 0x136d6
xorl %esi, %esi
movq %r12, %rdx
callq 0x3210
addl %r15d, %ebx
movl %ebx, 0x10(%r14)
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::add_string(char const*)
int ccCompiledScript::add_string(const char*strr) {
    size_t len = strlen(strr);
    strings = (char*)realloc(strings, stringssize + len + 1);
    char *write_ptr = strings + stringssize;
    for (size_t src = 0; src <= len; ++src) {
        char ch = strr[src];
        if (ch=='\\') {
            src++;
            ch = strr[src];
            if (ch == 'n') {ch = '\n';}
            else if (ch == 'r') {ch = '\r';}
            else if (ch == '[') { // pass through as \[
                *write_ptr = '\\';
                write_ptr++;
            }
        }
        *write_ptr = ch;
        write_ptr++;
    }
    int toret = stringssize;
    stringssize += write_ptr - (strings + stringssize);
    return toret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x31a0
movq %rax, %r15
movq 0x28(%rbx), %rdi
movslq 0x30(%rbx), %rax
leaq (%r15,%rax), %rsi
incq %rsi
callq 0x3520
movq %rax, 0x28(%rbx)
movslq 0x30(%rbx), %rcx
addq %rax, %rcx
xorl %eax, %eax
movb (%r14,%rax), %dl
cmpb $0x5c, %dl
jne 0x13752
movzbl 0x1(%r14,%rax), %edx
incq %rax
cmpl $0x5b, %edx
je 0x1374a
cmpl $0x6e, %edx
je 0x13746
cmpl $0x72, %edx
jne 0x13752
movb $0xd, %dl
jmp 0x13752
movb $0xa, %dl
jmp 0x13752
movb $0x5c, (%rcx)
incq %rcx
movb $0x5b, %dl
movb %dl, (%rcx)
incq %rcx
incq %rax
cmpq %r15, %rax
jbe 0x13721
movl 0x30(%rbx), %eax
subl 0x28(%rbx), %ecx
movl %ecx, 0x30(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::add_new_function(char const*, int*)
int ccCompiledScript::add_new_function(const char*namm, int *idx) {
    if (numfunctions >= MAX_FUNCTIONS) return -1;
    //  if (remove_any_import (namm)) return -2;
    functions[numfunctions] = (char*)malloc(strlen(namm)+20);
    strcpy(functions[numfunctions],namm);
    funccodeoffs[numfunctions] = codesize;
    funcnumparams[numfunctions] = 0;
    //  code = (long*)realloc(code, codesize + 5000);
    if (idx)
        *idx = numfunctions;
    numfunctions++;
    return codesize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x8d38(%rdi), %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x7cf, %r12            # imm = 0x7CF
jg 0x1384e
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x31a0
leaq 0x14(%rax), %rdi
callq 0x3440
movq %rax, 0x98(%rbx,%r12,8)
movq %rax, %rdi
movq %r15, %rsi
callq 0x32d0
movslq 0x20(%rbx), %rax
movq %rax, 0x3f18(%rbx,%r12,8)
movq 0x8d38(%rbx), %rcx
movw $0x0, 0x7d98(%rbx,%rcx,2)
testq %r14, %r14
je 0x13844
movl %ecx, (%r14)
movl 0x20(%rbx), %eax
incq %rcx
movq %rcx, 0x8d38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::add_new_import(char const*)
int ccCompiledScript::add_new_import(const char*namm)
{
    if (numimports >= importsCapacity)
    {
        importsCapacity += 1000;
        imports = (char**)realloc(imports, sizeof(char*) * importsCapacity);
    }
    imports[numimports] = (char*)malloc(strlen(namm)+12);
    strcpy(imports[numimports],namm);
    numimports++;
    return numimports-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x58(%rdi), %ebp
movslq 0x4c(%rdi), %rax
cmpl %eax, %ebp
jge 0x13878
movq 0x50(%rbx), %r15
jmp 0x1389d
leaq 0x3e8(%rax), %rcx
movl %ecx, 0x4c(%rbx)
movq 0x50(%rbx), %rdi
leaq 0x1f40(,%rax,8), %rsi
callq 0x3520
movq %rax, %r15
movq %rax, 0x50(%rbx)
movl 0x58(%rbx), %ebp
movq %r14, %rdi
callq 0x31a0
leaq 0xc(%rax), %rdi
callq 0x3440
movslq %ebp, %rcx
movq %rax, (%r15,%rcx,8)
movq 0x50(%rbx), %rax
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x32d0
movl 0x58(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::add_new_export(char const*, int, long, int)
int ccCompiledScript::add_new_export(const char*namm,int etype,long eoffs, int numArgs)
{
    if (numexports >= exportsCapacity)
    {
        exportsCapacity += 1000;
        exports = (char**)realloc(exports, sizeof(char*) * exportsCapacity);
        export_addr = (int32_t*)realloc(export_addr, sizeof(int32_t) * exportsCapacity);
    }
    if (eoffs >= 0x00ffffff) {
        cc_error("export offset too high; script data size too large?");
        return -1;
    }
    char *newName = (char*)malloc(strlen(namm)+20);
    strcpy(newName, namm);
    // mangle the name for functions to record parameters
    if (etype == EXPORT_FUNCTION) {
        char tempAddition[20];
        sprintf(tempAddition, "$%d", numArgs);
        strcat(newName, tempAddition);
    }
    // Check if it's already exported
    for (int aa = 0; aa < numexports; aa++) {
        if (strcmp(exports[aa], newName) == 0) {
            free(newName);
            return aa;
        }
    }
    exports[numexports] = newName;

    export_addr[numexports] = eoffs | ((long)etype << 24L);
    numexports++;
    return numexports-1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r15d
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
movslq 0x5c(%rdi), %rax
cmpl %eax, 0x70(%rdi)
jl 0x13b41
leaq 0x3e8(%rax), %rcx
movl %ecx, 0x5c(%rbx)
movq 0x60(%rbx), %rdi
leaq 0x1f40(,%rax,8), %rsi
callq 0x3520
movq %rax, 0x60(%rbx)
movq 0x68(%rbx), %rdi
movslq 0x5c(%rbx), %rsi
shlq $0x2, %rsi
callq 0x3520
movq %rax, 0x68(%rbx)
cmpq $0xffffff, %r14         # imm = 0xFFFFFF
jl 0x13b63
leaq 0x9040(%rip), %rdi      # 0x1cb91
xorl %eax, %eax
callq 0x102f4
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x13c04
movq %r13, %rdi
callq 0x31a0
leaq 0x14(%rax), %rdi
callq 0x3440
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x32d0
movl %ebp, 0xc(%rsp)
cmpl $0x1, %ebp
jne 0x13baf
leaq 0x9033(%rip), %rsi      # 0x1cbc5
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x30d0
movq %r12, %rdi
movq %r13, %rsi
callq 0x3570
movslq 0x70(%rbx), %r13
movq 0x60(%rbx), %rbp
testq %r13, %r13
jle 0x13bd8
xorl %r15d, %r15d
movq (%rbp,%r15,8), %rdi
movq %r12, %rsi
callq 0x3450
testl %eax, %eax
je 0x13bfc
incq %r15
cmpq %r15, %r13
jne 0x13bbf
movq %r12, (%rbp,%r13,8)
movl 0xc(%rsp), %eax
shll $0x18, %eax
orl %eax, %r14d
movq 0x68(%rbx), %rax
movl %r14d, (%rax,%r13,4)
movl 0x70(%rbx), %r15d
leal 0x1(%r15), %eax
movl %eax, 0x70(%rbx)
jmp 0x13c04
movq %r12, %rdi
callq 0x33c0
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::flush_line_numbers()
void ccCompiledScript::flush_line_numbers() {
    if (next_line) {
        int linum = next_line;
        next_line = 0;
        if(ccGetOption(SCOPT_LINENUMBERS)) {
            write_code(SCMD_LINENUM);
            write_code(linum);
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8d48(%rdi), %ebx
testl %ebx, %ebx
je 0x13c5d
movq %rdi, %r14
movl $0x0, 0x8d48(%rdi)
movl $0x4, %edi
callq 0x13f2c
testl %eax, %eax
je 0x13c5d
movq %r14, %rdi
movl $0x24, %esi
callq 0x13412
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x13412
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::start_new_section(char const*)
const char* ccCompiledScript::start_new_section(const char *name) {

    if ((numSections == 0) ||
        (codesize != sectionOffsets[numSections - 1]))
    {
        if (numSections >= capacitySections)
        {
            capacitySections += 100;
            sectionNames = (char**)realloc(sectionNames, sizeof(char*) * capacitySections);
            sectionOffsets = (int32_t*)realloc(sectionOffsets, sizeof(int32_t) * capacitySections);
        }
        sectionNames[numSections] = (char*)malloc(strlen(name) + 1);
        strcpy(sectionNames[numSections], name);
        sectionOffsets[numSections] = codesize;

        numSections++;
    }
    else
    {
        // nothing was in the last section, so overwrite it with this new one
        free(sectionNames[numSections - 1]);
        sectionNames[numSections - 1] = (char*)malloc(strlen(name) + 1);
        strcpy(sectionNames[numSections - 1], name);
    }

    return sectionNames[numSections - 1];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x88(%rdi), %r15
testq %r15, %r15
je 0x13cd9
movl 0x20(%rbx), %eax
movq 0x80(%rbx), %rcx
cmpl -0x4(%rcx,%r15,4), %eax
jne 0x13cd9
movq 0x78(%rbx), %rax
movq -0x8(%rax,%r15,8), %rdi
callq 0x33c0
movq %r14, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdi
callq 0x3440
movq 0x78(%rbx), %rcx
movslq 0x88(%rbx), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
movq 0x78(%rbx), %rax
movq -0x8(%rax,%rdx,8), %rdi
movq %r14, %rsi
callq 0x32d0
movl 0x88(%rbx), %eax
jmp 0x13d77
movslq 0x8c(%rbx), %rax
cmpl %eax, %r15d
jl 0x13d29
leaq 0x64(%rax), %rcx
movl %ecx, 0x8c(%rbx)
movq 0x78(%rbx), %rdi
leaq 0x320(,%rax,8), %rsi
callq 0x3520
movq %rax, 0x78(%rbx)
movq 0x80(%rbx), %rdi
movslq 0x8c(%rbx), %rsi
shlq $0x2, %rsi
callq 0x3520
movq %rax, 0x80(%rbx)
movl 0x88(%rbx), %r15d
movq %r14, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdi
callq 0x3440
movq 0x78(%rbx), %rcx
movslq %r15d, %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x78(%rbx), %rax
movq (%rax,%rdx,8), %rdi
movq %r14, %rsi
callq 0x32d0
movl 0x20(%rbx), %eax
movq 0x80(%rbx), %rcx
movslq 0x88(%rbx), %rdx
movl %eax, (%rcx,%rdx,4)
movl 0x88(%rbx), %eax
incl %eax
movl %eax, 0x88(%rbx)
movq 0x78(%rbx), %rcx
cltq
movq -0x8(%rcx,%rax,8), %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_compiledscript.cpp
// Function: ccCompiledScript::free_extra()
void ccCompiledScript::free_extra() {
    int aa;
	for (aa=0;aa<numfunctions;aa++) {
        free(functions[aa]);
	}
    numfunctions=0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8d38(%rdi)
jle 0x13db5
xorl %r14d, %r14d
movq 0x98(%rbx,%r14,8), %rdi
callq 0x33c0
incq %r14
cmpq %r14, 0x8d38(%rbx)
jg 0x13d9c
movq $0x0, 0x8d38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_script.cpp
// Function: freadstring(char**, AGS::Common::Stream*)
void freadstring(char **strptr, Stream *in)
{
    static char ibuffer[300];
    int idxx = 0;

    while ((ibuffer[idxx] = in->ReadInt8()) != 0)
        idxx++;

    if (ibuffer[0] == 0) {
        strptr[0] = nullptr;
        return;
    }

    strptr[0] = (char *)malloc(strlen(ibuffer) + 1);
    strcpy(strptr[0], ibuffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1179a(%rip), %r15     # 0x257b0
movq (%r14), %rax
movq %r14, %rdi
callq *0x70(%rax)
movb %al, (%r15)
incq %r15
testb %al, %al
jne 0x14016
cmpb $0x0, 0x11780(%rip)     # 0x257b0
je 0x1405d
leaq 0x11777(%rip), %r14     # 0x257b0
movq %r14, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdi
callq 0x3440
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x32d0
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_script.cpp
// Function: ccScript::CreateFromStream(AGS::Common::Stream*)
ccScript *ccScript::CreateFromStream(Stream *in)
{
    ccScript *scri = new ccScript();
    if (!scri->Read(in))
    {
        delete scri;
        return nullptr;
    }
    return scri;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x90, %edi
callq 0x3310
movq %rax, %rbx
leaq 0x10c53(%rip), %rax     # 0x24cd8
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movl %eax, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movl %eax, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movl %eax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x78(%rbx)
movq %rax, 0x88(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x140e2
testb %al, %al
jne 0x140d7
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_script.cpp
// Function: ccScript::Free()
void ccScript::Free()
{
    if (globaldata != nullptr)
        free(globaldata);

    if (code != nullptr)
        free(code);

    if (strings != nullptr)
        free(strings);

    if (fixups != nullptr && numfixups > 0)
        free(fixups);

    if (fixuptypes != nullptr && numfixups > 0)
        free(fixuptypes);

    globaldata = nullptr;
    code = nullptr;
    strings = nullptr;
    fixups = nullptr;
    fixuptypes = nullptr;

    int aa;
    for (aa = 0; aa < numimports; aa++) {
        if (imports[aa] != nullptr)
            free(imports[aa]);
    }

    for (aa = 0; aa < numexports; aa++)
        free(exports[aa]);

    for (aa = 0; aa < numSections; aa++)
        free(sectionNames[aa]);

    if (sectionNames != nullptr)
    {
        free(sectionNames);
        free(sectionOffsets);
        sectionNames = nullptr;
        sectionOffsets = nullptr;
    }

    if (imports != nullptr)
    {
        free(imports);
        free(exports);
        free(export_addr);
        imports = nullptr;
        exports = nullptr;
        export_addr = nullptr;
    }
    numimports = 0;
    numexports = 0;
    numSections = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x146dd
callq 0x33c0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x146eb
callq 0x33c0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x146f9
callq 0x33c0
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
setne %cl
movl 0x48(%rbx), %eax
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1471a
callq 0x33c0
movl 0x48(%rbx), %eax
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x14730
testl %eax, %eax
jle 0x14730
callq 0x33c0
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl 0x58(%rbx), %eax
testl %eax, %eax
jle 0x1476f
xorl %r14d, %r14d
movq 0x50(%rbx), %rcx
movq (%rcx,%r14,8), %rdi
testq %rdi, %rdi
je 0x14764
callq 0x33c0
movl 0x58(%rbx), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x1474f
cmpl $0x0, 0x70(%rbx)
jle 0x14791
xorl %r14d, %r14d
movq 0x60(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x33c0
incq %r14
movslq 0x70(%rbx), %rax
cmpq %rax, %r14
jl 0x14778
cmpl $0x0, 0x88(%rbx)
jle 0x147b9
xorl %r14d, %r14d
movq 0x78(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x33c0
incq %r14
movslq 0x88(%rbx), %rax
cmpq %rax, %r14
jl 0x1479d
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x147de
leaq 0x78(%rbx), %r14
callq 0x33c0
movq 0x80(%rbx), %rdi
callq 0x33c0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x1480d
callq 0x33c0
movq 0x60(%rbx), %rdi
callq 0x33c0
movq 0x68(%rbx), %rdi
callq 0x33c0
movq $0x0, 0x50(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
xorl %eax, %eax
movl %eax, 0x58(%rbx)
movl %eax, 0x70(%rbx)
movl %eax, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_script.cpp
// Function: ccScript::GetSectionName(int)
const char* ccScript::GetSectionName(int32_t offs) {

    int i;
    for (i = 0; i < numSections; i++) {
        if (sectionOffsets[i] < offs)
            continue;
        break;
    }

    // if no sections in script, return unknown
    if (i == 0)
        return "(unknown section)";

    return sectionNames[i - 1];
}

// Assembly:
movl 0x88(%rdi), %edx
leaq 0x84be(%rip), %rax      # 0x1cfe9
testl %edx, %edx
jle 0x14b57
movq 0x80(%rdi), %r8
xorl %ecx, %ecx
cmpl %esi, (%r8,%rcx,4)
jge 0x14b48
incq %rcx
cmpq %rcx, %rdx
jne 0x14b38
movl %edx, %ecx
testl %ecx, %ecx
je 0x14b57
movq 0x78(%rdi), %rax
movl %ecx, %ecx
movq -0x8(%rax,%rcx,8), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string_compat.c
// Function: ags_strlwr
char *ags_strlwr(char *s)
{
    char *p = s;
    for (; *p; p++)
        *p = tolower(*p);
    return s;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x14b87
callq 0x30c0
leaq 0x1(%rbx), %rcx
movq (%rax), %rdx
movsbq %bpl, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x14b6f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string_compat.c
// Function: ags_strupr
char *ags_strupr(char *s)
{
    char *p = s;
    for (; *p; p++)
        *p = toupper(*p);
    return s;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x14bc0
callq 0x30a0
leaq 0x1(%rbx), %rcx
movq (%rax), %rdx
movsbq %bpl, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x14ba8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::operator=(AGS::Common::String const&)
String &String::operator=(const String& str)
{
    if (_data != str._data)
    {
        Free();
        if (str._data && str._meta->Length > 0)
        {
            _data = str._data;
            if (_meta)
            {
                _meta->RefCount++;
            }
        }
    }
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
cmpq (%rsi), %rax
je 0x14c43
movq %rsi, %r14
movq %rbx, %rdi
callq 0x14d68
movq (%r14), %rax
testq %rax, %rax
je 0x14c43
cmpq $0x0, 0x10(%rax)
je 0x14c43
movq %rax, (%rbx)
incq (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::SetString(char const*, unsigned long)
void String::SetString(const char *cstr, size_t length)
{
    if (cstr)
    {
        length = Math::Min(length, strlen(cstr));
        if (length > 0)
        {
            ReserveAndShift(false, Math::Surplus(length, GetLength()));
            memcpy(_meta->CStr, cstr, length);
            _meta->Length = length;
            _meta->CStr[length] = 0;
        }
        else
        {
            Empty();
        }
    }
    else
    {
        Empty();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x14cb9
movq %rdx, %rbx
movq %rsi, %r15
movq %rsi, %rdi
callq 0x31a0
cmpq %rbx, %rax
cmovbq %rax, %rbx
testq %rbx, %rbx
je 0x14cb9
movq (%r14), %rax
testq %rax, %rax
je 0x14cc6
movq 0x10(%rax), %rax
jmp 0x14cc8
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x14e6e
xorl %eax, %eax
xorl %edx, %edx
movq %rbx, %rcx
subq %rax, %rcx
cmovaeq %rcx, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x14f6a
movq (%r14), %rax
movq 0x18(%rax), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3290
movq (%r14), %rax
movq %rbx, 0x10(%rax)
movq (%r14), %rax
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::FillString(char, unsigned long)
void String::FillString(char c, size_t count)
{
    Empty();
    if (count > 0)
    {
        ReserveAndShift(false, count);
        memset(_meta->CStr, c, count);
        _meta->Length = count;
        _meta->CStr[count] = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x14e6e
testq %rbx, %rbx
je 0x14d5c
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x14f6a
movq (%r14), %rax
movq 0x18(%rax), %rdi
movzbl %bpl, %esi
movq %rbx, %rdx
callq 0x3210
movq (%r14), %rax
movq %rbx, 0x10(%rax)
movq (%r14), %rax
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Free()
void String::Free()
{
    if (_meta)
    {
        assert(_meta->RefCount > 0);
        _meta->RefCount--;
        if (!_meta->RefCount)
        {
            delete [] _data;
        }
    }
    _data = nullptr;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x14d90
movq (%rax), %rcx
testq %rcx, %rcx
je 0x14d99
decq %rcx
movq %rcx, (%rax)
movq (%rbx), %rdi
cmpq $0x0, (%rdi)
jne 0x14d90
callq 0x3430
movq $0x0, (%rbx)
popq %rbx
retq
leaq 0x82e4(%rip), %rdi      # 0x1d084
leaq 0x826b(%rip), %rsi      # 0x1d012
leaq 0x82ea(%rip), %rcx      # 0x1d098
movl $0x271, %edx            # imm = 0x271
callq 0x3240
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Read(AGS::Common::Stream*, unsigned long, bool)
void String::Read(Stream *in, size_t max_chars, bool stop_at_limit)
{
    Empty();
    if (!in)
    {
        return;
    }
    if (max_chars == 0 && stop_at_limit)
    {
        return;
    }

    char buffer[1024];
    char *read_ptr = buffer;
    size_t read_size = 0;
    int ichar;
    do
    {
        ichar = in->ReadByte();
        read_size++;
        if (read_size > max_chars)
        {
            continue;
        }
        *read_ptr = (char)(ichar >= 0 ? ichar : 0);
        if (!*read_ptr || ((read_ptr - buffer) == (sizeof(buffer) - 1 - 1)))
        {
            buffer[sizeof(buffer) - 1] = 0;
            Append(buffer);
            read_ptr = buffer;
        }
        else
        {
            read_ptr++;
        }
    }
    while(ichar > 0 && !(stop_at_limit && read_size == max_chars));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
callq 0x14e6e
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
andb %bl, %cl
orb %al, %cl
jne 0x14e5b
leaq 0x10(%rsp), %r13
movl $0x1, %r12d
movq (%r15), %rax
movq %r15, %rdi
callq *0x58(%rax)
movl %eax, %ebp
cmpq %r14, %r12
ja 0x14e4a
movl %ebp, %eax
testl %ebp, %ebp
jg 0x14e10
xorl %eax, %eax
movb %al, (%r13)
testb %al, %al
je 0x14e30
movq %r13, %rax
leaq 0x10(%rsp), %rcx
subq %rcx, %rax
cmpq $0x3fe, %rax            # imm = 0x3FE
je 0x14e30
incq %r13
jmp 0x14e4a
movb $0x0, 0x40f(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
callq 0x14ea6
cmpq %r12, %r14
sete %al
testb %bl, %al
jne 0x14e5b
incq %r12
testl %ebp, %ebp
jg 0x14df8
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Empty()
void String::Empty()
{
    if (_meta)
    {
        BecomeUnique();
        _meta->Length = 0;
        _meta->CStr[0] = 0;
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x14ea4
pushq %rbx
movq %rdi, %rbx
cmpq $0x2, (%rax)
jb 0x14e91
movq 0x10(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x15bf8
movq (%rbx), %rax
movq $0x0, 0x10(%rax)
movq (%rbx), %rax
movq 0x18(%rax), %rax
movb $0x0, (%rax)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::Append(char const*)
void String::Append(const char *cstr)
{
    if (cstr)
    {
        size_t length = strlen(cstr);
        if (length > 0)
        {
            ReserveAndShift(false, length);
            memcpy(_meta->CStr + _meta->Length, cstr, length);
            _meta->Length += length;
            _meta->CStr[_meta->Length] = 0;
        }
    }
}

// Assembly:
testq %rsi, %rsi
je 0x14f04
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x31a0
testq %rax, %rax
je 0x14eff
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x14f6a
movq (%rbx), %rax
movq 0x18(%rax), %rdi
addq 0x10(%rax), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3290
movq (%rbx), %rax
addq %r15, 0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movb $0x0, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ReadCount(AGS::Common::Stream*, unsigned long)
void String::ReadCount(Stream *in, size_t count)
{
    Empty();
    if (in && count > 0)
    {
        ReserveAndShift(false, count);
        count = in->Read(_meta->CStr, count);
        _meta->CStr[count] = 0;
        _meta->Length = strlen(_meta->CStr);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x14e6e
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x14f64
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x14f6a
movq (%rbx), %rax
movq 0x18(%rax), %rsi
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rdx
callq *0x50(%rax)
movq (%rbx), %rcx
movq 0x18(%rcx), %rcx
movb $0x0, (%rcx,%rax)
movq (%rbx), %rbx
movq 0x18(%rbx), %rdi
callq 0x31a0
movq %rax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::ReserveAndShift(bool, unsigned long)
void String::ReserveAndShift(bool left, size_t more_length)
{
    if (_meta)
    {
        size_t total_length = _meta->Length + more_length;
        if (_meta->Capacity < total_length)
        {
            // grow by 50% or at least to total_size
            size_t grow_length = _meta->Capacity + (_meta->Capacity >> 1);
            Copy(Math::Max(total_length, grow_length), left ? more_length : 0u);
        }
        else if (_meta->RefCount > 1)
        {
            Copy(total_length, left ? more_length : 0u);
        }
        else
        {
            // make sure we make use of all of our space
            const char *cstr_head = _data + sizeof(String::Header);
            size_t free_space = left ?
                _meta->CStr - cstr_head :
                (cstr_head + _meta->Capacity) - (_meta->CStr + _meta->Length);
            if (free_space < more_length)
            {
                Align((left ?
                    _meta->CStr + (more_length - free_space) :
                    _meta->CStr - (more_length - free_space)) - cstr_head);
            }
        }
    }
    else
    {
        Create(more_length);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x14fae
movq 0x8(%rcx), %rdi
movq 0x10(%rcx), %rdx
leaq (%rdx,%r14), %rax
cmpq %rax, %rdi
jae 0x14fe1
movq %rdi, %rcx
shrq %rcx
addq %rdi, %rcx
cmpq %rcx, %rax
cmovaq %rax, %rcx
xorl %edx, %edx
testb %sil, %sil
cmovneq %r14, %rdx
movq %rbx, %rdi
movq %rcx, %rsi
jmp 0x14ff6
leaq 0x21(%r14), %rdi
callq 0x3040
movq %rax, (%rbx)
movq $0x1, (%rax)
movq %r14, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x20(%rax), %rcx
movq %rcx, 0x18(%rax)
movb $0x0, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x2, (%rcx)
jb 0x15002
xorl %edx, %edx
testb %sil, %sil
cmovneq %r14, %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x15bf8
leaq 0x20(%rcx), %rax
testb %sil, %sil
je 0x1501f
movq 0x18(%rcx), %rsi
movq %rsi, %rcx
subq %rax, %rcx
subq %rcx, %r14
jbe 0x14fd9
addq %rsi, %r14
jmp 0x15037
addq %rax, %rdi
movq 0x18(%rcx), %rsi
subq %rsi, %rdi
subq %rdx, %rdi
subq %r14, %rdi
jae 0x14fd9
addq %rsi, %rdi
movq %rdi, %r14
subq %rax, %r14
addq %rax, %r14
incq %rdx
movq %r14, %rdi
callq 0x3500
movq (%rbx), %rax
movq %r14, 0x18(%rax)
jmp 0x14fd9
nop
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::WriteCount(AGS::Common::Stream*, unsigned long) const
void String::WriteCount(Stream *out, size_t count) const
{
    if (out)
    {
        size_t str_out_len = Math::Min(count - 1, GetLength());
        if (str_out_len > 0)
            out->Write(GetCStr(), str_out_len);
        size_t null_out_len = count - str_out_len;
        if (null_out_len > 0)
            out->WriteByteCount(0, null_out_len);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x150ce
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x150c6
leaq -0x1(%rbx), %rcx
movq 0x10(%rax), %r15
cmpq %r15, %rcx
cmovbq %rcx, %r15
testq %r15, %r15
je 0x150c6
movq 0x18(%rax), %rsi
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rdx
callq *0x60(%rax)
jmp 0x150c9
xorl %r15d, %r15d
subq %r15, %rbx
jne 0x150d4
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x16810
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::CompareRight(char const*, unsigned long) const
int String::CompareRight(const char *cstr, size_t count) const
{
    cstr = cstr ? cstr : "";
    count = count != -1 ? count : strlen(cstr);
    size_t off = Math::Min(GetLength(), count);
    return strncmp(GetCStr() + GetLength() - off, cstr, count);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
leaq 0x7f23(%rip), %r14      # 0x1d1e8
cmoveq %r14, %rbx
cmpq $-0x1, %rdx
jne 0x152da
movq %rbx, %rdi
callq 0x31a0
movq %rax, %rdx
movq (%r15), %rax
testq %rax, %rax
je 0x152f6
movq 0x10(%rax), %rcx
movq 0x18(%rax), %r14
cmpq %rdx, %rcx
movq %rdx, %rax
cmovbq %rcx, %rax
jmp 0x152fa
xorl %eax, %eax
xorl %ecx, %ecx
addq %rcx, %r14
subq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x31d0
// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/util_string.cpp
// Function: AGS::Common::String::CompareRightNoCase(char const*, unsigned long) const
int String::CompareRightNoCase(const char *cstr, size_t count) const
{
    cstr = cstr ? cstr : "";
    count = count != -1 ? count : strlen(cstr);
    size_t off = Math::Min(GetLength(), count);
    return ags_strnicmp(GetCStr() + GetLength() - off, cstr, count);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
testq %rsi, %rsi
leaq 0x7ec3(%rip), %r14      # 0x1d1e8
cmoveq %r14, %rbx
cmpq $-0x1, %rdx
jne 0x1533a
movq %rbx, %rdi
callq 0x31a0
movq %rax, %rdx
movq (%r15), %rax
testq %rax, %rax
je 0x15356
movq 0x10(%rax), %rcx
movq 0x18(%rax), %r14
cmpq %rdx, %rcx
movq %rdx, %rax
cmovbq %rcx, %rax
jmp 0x1535a
xorl %eax, %eax
xorl %ecx, %ecx
addq %rcx, %r14
subq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x14bcf