LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GBase.cpp
// Function: parseUInt(char*&, unsigned int&)
bool parseUInt(char* &p, uint& i) { //pointer p is advanced after the number
 while (*p==' ' || *p=='\t') p++;
 char* p0=p;
 char* start=p;
 if (*p=='-') return false;
       else if (*p=='+') { p++;start++; }
 while (*p>='0' && *p<='9') p++;
 //now p is on a non-digit;
 if (start==p) {
	 p=p0;
	 return false;
 }
 char* endptr=NULL;
 unsigned long l=strtoul(start,&endptr,10);
 i=(uint) l;
 if (endptr!=p || endptr==start || i!=l) {
	 p=p0;
	 return false;
 }
 return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r13
movzbl (%r13), %eax
cmpl $0x9, %eax
je 0x3e69
cmpl $0x20, %eax
jne 0x3e71
incq %r13
movq %r13, (%rbx)
jmp 0x3e5a
cmpl $0x2b, %eax
je 0x3e80
cmpl $0x2d, %eax
je 0x3ee9
movq %r13, %r15
jmp 0x3e87
leaq 0x1(%r13), %r15
movq %r15, (%rbx)
leaq 0x1(%r15), %rcx
xorl %eax, %eax
movb -0x1(%rcx), %dl
addb $-0x30, %dl
cmpb $0x9, %dl
ja 0x3ea3
movq %rcx, (%rbx)
decq %rax
incq %rcx
jmp 0x3e8d
testq %rax, %rax
je 0x3ee6
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
pushq $0xa
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x20d0
movl %eax, (%r14)
movq (%r12), %rcx
movq (%rbx), %rdx
xorq %rcx, %rdx
cmpq %r15, %rcx
setne %cl
shrq $0x20, %rax
orq %rdx, %rax
sete %al
andb %cl, %al
jne 0x3eeb
movq %r13, (%rbx)
jmp 0x3eeb
movq %r13, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GBase.cpp
// Function: parseHex(char*&, unsigned int&)
bool parseHex(char* &p, uint& i) {
 //skip initial spaces/prefix
 while (*p==' ' || *p=='\t' || *p=='0' || *p=='x') p++;
 char* start=p;
 if (*p=='-') return false;
       else if (*p=='+') { p++;start++; }
 while (isxdigit(*p)) p++;
 //now p is on a non-hexdigit;
 if (p==start+1) return false;
 char saved=*p;
 *p='\0';
 char* endptr=p;
 unsigned long l=strtoul(start,&endptr,16);
 i=(uint) l;
 *p=saved;
 if (endptr!=p || i!=l) return false;
 return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
movzbl (%r15), %eax
cmpl $0x9, %eax
je 0x3f25
cmpl $0x20, %eax
je 0x3f25
cmpl $0x30, %eax
je 0x3f25
cmpl $0x78, %eax
jne 0x3f2d
incq %r15
movq %r15, (%r14)
jmp 0x3f0d
cmpl $0x2b, %eax
je 0x3f39
cmpl $0x2d, %eax
jne 0x3f3f
jmp 0x3fa3
incq %r15
movq %r15, (%r14)
leaq 0x1(%r15), %r12
pushq $0x1
popq %r13
movb -0x1(%r12), %bpl
movsbl %bpl, %edi
callq 0x20a0
testl %eax, %eax
je 0x3f64
movq %r12, (%r14)
incq %r12
decq %r13
jmp 0x3f47
testq %r13, %r13
je 0x3fa3
movb $0x0, -0x1(%r12)
movq (%r14), %rax
movq %rsp, %r12
movq %rax, (%r12)
pushq $0x10
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x20d0
movl %eax, (%rbx)
movq (%r14), %rcx
movb %bpl, (%rcx)
movq (%r12), %rcx
xorq (%r14), %rcx
movl (%rbx), %edx
xorq %rax, %rdx
orq %rcx, %rdx
sete %al
jmp 0x3fa5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GBase.cpp
// Function: writeFasta(_IO_FILE*, char const*, char const*, char const*, int, int)
void writeFasta(FILE *fw, const char* seqid, const char* descr,
        const char* seq, int linelen, int seqlen) {
  fflush(fw);
  // write header line only if given!
  if (seqid!=NULL) {
    if (descr==NULL || descr[0]==0)
             fprintf(fw,">%s\n",seqid);
        else fprintf(fw,">%s %s\n",seqid, descr);
    }
  fflush(fw);
  if (seq==NULL || *seq==0) return; //nothing to print
  if (linelen==0) { //unlimited line length: write the whole sequence on a line
     if (seqlen>0)
             fwrite((const void*)seq, 1, seqlen,fw);
        else fprintf(fw,"%s",seq);
     fprintf(fw,"\n");
     fflush(fw);
     return;
     }
  int ilen=0;
  if (seqlen>0) { //seq length given, so we know when to stop
    for (int i=0; i < seqlen; i++, ilen++) {
            if (ilen == linelen) {
                 fputc('\n', fw);
                 ilen = 0;
                 }
            fputc(seq[i], fw);
            }
    fputc('\n', fw);
    }
  else { //seq length not given, stop when 0 encountered
    for (int i=0; seq[i]!=0; i++, ilen++) {
            if (ilen == linelen) {
                 fputc('\n', fw);
                 ilen = 0;
                 }
            fputc(seq[i], fw);
            } //for
    fputc('\n', fw);
    }
  fflush(fw);
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r15d
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
callq 0x22c0
testq %r12, %r12
je 0x4014
testq %r13, %r13
je 0x4000
cmpb $0x0, (%r13)
je 0x4000
leaq 0x80e6(%rip), %rsi      # 0xc0d4
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2370
jmp 0x4014
leaq 0x80c8(%rip), %rsi      # 0xc0cf
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2370
movq %rbx, %rdi
callq 0x22c0
testq %r14, %r14
je 0x406b
movb (%r14), %al
testb %al, %al
je 0x406b
testl %ebp, %ebp
je 0x407a
testl %r15d, %r15d
jle 0x4092
movl %r15d, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r13, %r12
je 0x40d8
cmpl %ebp, %r15d
jne 0x4056
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x2300
xorl %r15d, %r15d
movsbl (%r14,%r13), %edi
movq %rbx, %rsi
callq 0x2300
incq %r13
incl %r15d
jmp 0x403a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r15d, %r15d
jle 0x40cd
movl %r15d, %edx
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq 0x2450
jmp 0x40d8
incq %r14
xorl %r12d, %r12d
pushq $0xa
popq %r15
testb %al, %al
je 0x40d8
cmpl %ebp, %r12d
jne 0x40b7
movl %r15d, %edi
movq %rbx, %rsi
callq 0x2300
movb -0x1(%r14), %al
xorl %r12d, %r12d
movsbl %al, %edi
movq %rbx, %rsi
callq 0x2300
incl %r12d
movb (%r14), %al
incq %r14
jmp 0x409c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22b0
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x2300
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22c0
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GBase.cpp
// Function: commaprintnum(unsigned long)
char* commaprintnum(uint64 n) {
  char retbuf[48];
  int comma = ',';
  char *p = &retbuf[sizeof(retbuf)-1];
  int i = 0;
  *p = '\0';
  do {
    if(i%3 == 0 && i != 0)
        *--p = comma;
    *--p = '0' + n % 10;
    n /= 10;
    i++;
  } while(n != 0);
  return Gstrdup(p);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, %rcx
leaq 0x2f(%rsp), %rdi
movb $0x0, (%rdi)
xorl %r8d, %r8d
pushq $0x3
popq %r9
pushq $0xa
popq %r10
xorl %esi, %esi
movl %r8d, %r11d
movl %esi, %eax
xorl %edx, %edx
divl %r9d
addl $-0x1, %r8d
jae 0x4134
leal (%rax,%rax,2), %eax
addl %eax, %r11d
jne 0x4134
movb $0x2c, -0x1(%rdi)
decq %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %r10
orb $0x30, %dl
movb %dl, -0x1(%rdi)
decq %rdi
incl %esi
cmpq $0x9, %rcx
movq %rax, %rcx
ja 0x4115
xorl %esi, %esi
callq 0x2704
addq $0x38, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/./GBase.h
// Function: GMalloc(void**, unsigned long)
inline bool GMalloc(pointer* ptr,unsigned long size){
    //GASSERT(ptr);
    *ptr=nullptr;
    if (size!=0)
  	  *ptr=malloc(size);
    return *ptr!=nullptr;
 }

// Assembly:
andq $0x0, (%rdi)
testq %rsi, %rsi
je 0x417c
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2330
movq %rax, (%rbx)
testq %rax, %rax
setne %al
popq %rbx
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/./GBase.h
// Function: GDynArray<char*>::Grow()
void Grow() {
    	int delta = (fCapacity>16) ? (fCapacity>>2) : 2;
    	if (GDynArray_MAXCOUNT-delta<=fCapacity)
    		delta=GDynArray_MAXCOUNT-fCapacity;
    	if (delta<=1) GError("Error at GDynArray::Grow(): max capacity reached!\n");
    	growTo(fCapacity + delta);
    }

// Assembly:
movl 0x1c(%rdi), %esi
movl %esi, %eax
shrl $0x2, %eax
cmpl $0x11, %esi
pushq $0x2
popq %rcx
cmovael %eax, %ecx
pushq $-0x2
popq %rax
movl %eax, %edx
subl %ecx, %edx
subl %esi, %eax
cmpl %esi, %edx
cmoval %ecx, %eax
cmpl $0x1, %eax
jle 0x435f
addl %eax, %esi
jmp 0x436e
pushq %rax
leaq 0x7dc0(%rip), %rdi      # 0xc127
xorl %eax, %eax
callq 0x25ca
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/./GBase.h
// Function: GDynArray<char*>::growTo(unsigned int)
void growTo(uint newcap) {
    	if (newcap==0) { Clear(); return; }
    	if (newcap <= fCapacity) return; //never shrink! (use Pack() for shrinking)
    	GREALLOC(fArray, newcap*sizeof(OBJ));
    	fCapacity=newcap;
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x439c
movl %esi, %ebp
cmpl %esi, 0x1c(%rbx)
jae 0x4395
leaq 0x10(%rbx), %rdi
movl %ebp, %esi
shlq $0x3, %rsi
callq 0x43e9
testb %al, %al
je 0x43aa
movl %ebp, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x43b8
leaq 0x7c6f(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/./GBase.h
// Function: GDynArray<char*>::Clear()
void Clear() { // clear array, shrinking its allocated memory
    	fCount = 0;
    	GREALLOC(fArray, sizeof(OBJ)*dyn_array_defcap);
    	// set initial memory size again
    	fCapacity = dyn_array_defcap;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
andl $0x0, 0x18(%rdi)
addq $0x10, %rdi
movl $0x80, %esi
callq 0x43e9
testb %al, %al
je 0x43db
movl $0x10, 0x1c(%rbx)
popq %rbx
retq
leaq 0x7c3e(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/./GBase.h
// Function: GRealloc(void**, unsigned long)
inline bool GRealloc(pointer* ptr,unsigned long size){
    //GASSERT(ptr);
    if (size==0) {
      GFree(ptr);
      return true;
      }
    if (*ptr==NULL) {//simple malloc
     void *p=malloc(size);
     if (p != NULL) {
       *ptr=p;
       return true;
       }
      else return false;
     }//malloc
    else {//realloc
     void *p=realloc(*ptr,size);
     if (p) {
         *ptr=p;
         return true;
         }
     return false;
     }
 }

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x4401
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x440b
callq 0x23d0
jmp 0x4413
movq %rbx, %rdi
callq 0x420d
jmp 0x441b
movq %rsi, %rdi
callq 0x2330
testq %rax, %rax
je 0x441f
movq %rax, (%rbx)
movb $0x1, %al
jmp 0x4421
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::new_data(unsigned int, unsigned int)
GStr::Data * GStr::new_data(uint len, uint addcap) {
//static method to return a new Data object (allocate length)
//content is undefined, but it's null terminated
    if (len > 0) {
        Data* data;
        GMALLOC(data, sizeof(Data)+len+addcap);
        data->ref_count = 0;
        data->length = len;
        data->cap=len+addcap;
        data->chars[len] = '\0';
        return data;
        }
    else
        return &null_data;
 }

// Assembly:
testl %edi, %edi
je 0x4531
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movl %edi, %ebp
movl %edi, %r14d
movl %esi, %eax
leaq (%r14,%rax), %rsi
addq $0x10, %rsi
leaq 0x8(%rsp), %rdi
callq 0x415c
testb %al, %al
jne 0x450d
leaq 0x7b1a(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
movq 0x8(%rsp), %rax
andl $0x0, (%rax)
movl %ebp, 0x8(%rax)
addl %ebp, %ebx
movl %ebx, 0x4(%rax)
movb $0x0, 0xc(%rax,%r14)
movq 0x8(%rsp), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xdd18(%rip), %rax      # 0x12250
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::new_data(char const*, unsigned int)
GStr::Data* GStr::new_data(const char* str, uint addcap) {
//static method to return a new Data object (allocate: length+addcap)
//as a copy of a given string
 //if (str==NULL) return &null_data;
 int len= (str==NULL)? 0 : strlen(str);
 if (len+addcap > 0) {
        Data* data;
        GMALLOC(data, sizeof(Data)+len+addcap);
        if (len) strcpy(data->chars, str);
        data->ref_count = 0;
        data->cap=len+addcap;
        data->length = len;
        data->chars[len] = '\0';
        return data;
        }
    else
        return &null_data;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x455c
movq %rbx, %rdi
callq 0x2140
movq %rax, %r14
jmp 0x455f
xorl %r14d, %r14d
movl %r14d, %r15d
addl %ebp, %r15d
je 0x45bc
movslq %r14d, %r12
movl %ebp, %eax
leaq (%rax,%r12), %rsi
addq $0x10, %rsi
movq %rsp, %rdi
callq 0x415c
testb %al, %al
jne 0x458e
leaq 0x7a99(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
movq (%rsp), %r13
testl %r14d, %r14d
je 0x45a3
leaq 0xc(%r13), %rdi
movq %rbx, %rsi
callq 0x2220
andl $0x0, (%r13)
movl %r15d, 0x4(%r13)
movl %r14d, 0x8(%r13)
movb $0x0, 0xc(%r13,%r12)
movq (%rsp), %rax
jmp 0x45c3
leaq 0xdc8d(%rip), %rax      # 0x12250
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::prep_data(unsigned int, unsigned int)
void GStr::prep_data(uint len, uint addcap) {
	uint newcap=len+addcap;
    if (newcap > 0 && my_data->ref_count <= 1 &&
    	   my_data->cap>=newcap && my_data->cap-newcap<(newcap>>1)+2) {
    	//no need to shrink/reallocate the already allocated space
    	my_data->length = len;
    	my_data->chars[len]=0;
        return;
    }
    if (my_data != &null_data && --my_data->ref_count == 0)
        GFREE(my_data);

    if (len + addcap> 0) {
        GMALLOC(my_data, sizeof(Data)+len+addcap);
        my_data->ref_count = 1;
        my_data->length = len;
        my_data->cap=len+addcap;
        my_data->chars[len] = 0;
    }
    else
        my_data = &null_data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movl %edx, %r15d
movq 0x20(%rdi), %rax
addl %esi, %r15d
je 0x4612
cmpl $0x1, (%rax)
ja 0x4612
movl 0x4(%rax), %ecx
subl %r15d, %ecx
jb 0x4612
movl %r15d, %edx
shrl %edx
addl $0x2, %edx
cmpl %edx, %ecx
jae 0x4612
movl %ebx, 0x8(%rax)
movl %ebx, %ecx
movb $0x0, 0xc(%rax,%rcx)
jmp 0x4675
addq $0x20, %r14
leaq 0xdc33(%rip), %r12      # 0x12250
cmpq %r12, %rax
je 0x462e
decl (%rax)
jne 0x462e
movq %r14, %rdi
callq 0x420d
testl %r15d, %r15d
je 0x4672
movl %ebx, %r12d
movl %ebp, %eax
leaq (%r12,%rax), %rsi
addq $0x10, %rsi
movq %r14, %rdi
callq 0x415c
testb %al, %al
jne 0x465a
leaq 0x79cd(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
movq (%r14), %rax
movl $0x1, (%rax)
movl %ebx, 0x8(%rax)
movl %r15d, 0x4(%rax)
movb $0x0, 0xc(%rax,%r12)
jmp 0x4675
movq %r12, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::make_unique()
void GStr::make_unique() {//make sure it's not a reference to other string
    if (my_data->ref_count > 1) {
        Data *data = new_data(my_data->length, 0);
        ::memcpy(data->chars, my_data->chars, my_data->length);
        my_data->ref_count--;
        my_data = data;
        my_data->ref_count++;
    }
}

// Assembly:
movq 0x20(%rdi), %rax
cmpl $0x2, (%rax)
jb 0x46e9
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rax), %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r14
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rsi
movl 0x8(%rsi), %edx
addq $0xc, %rsi
callq 0x21e0
movq 0x20(%rbx), %rax
decl (%rax)
movq %r14, 0x20(%rbx)
incl (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::replace_data(GStr::Data*)
void GStr::replace_data(Data *data) {
    if (my_data != &null_data && --my_data->ref_count == 0)
        GFREE(my_data);
    if (data != &null_data)
        data->ref_count++;
    my_data = data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rax
addq $0x20, %r14
leaq 0xdb4c(%rip), %r15      # 0x12250
cmpq %r15, %rax
je 0x4715
decl (%rax)
jne 0x4715
movq %r14, %rdi
callq 0x420d
cmpq %r15, %rbx
je 0x471c
incl (%rbx)
movq %rbx, (%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr()
GStr::GStr():my_data(&null_data) {
 fTokenDelimiter=NULL;
 fTokenizeMode=tkCharSet;
 fLastTokenStart=0;
 readbuf=NULL;
 readbufsize=0;
 }

// Assembly:
leaq 0xda91(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::detach()
char* GStr::detach() {
 make_unique();
 char *r=my_data->chars;
 my_data=&null_data;
 fTokenDelimiter=NULL;
 fTokenizeMode=tkCharSet;
 fLastTokenStart=0;
 readbuf=NULL;
 readbufsize=0;
 return r;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x46a4
movq 0x20(%rbx), %rax
addq $0xc, %rax
leaq 0xda5a(%rip), %rcx      # 0x12250
movq %rcx, 0x20(%rbx)
andq $0x0, (%rbx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr(GStr const&)
GStr::GStr(const GStr& s): my_data(&null_data){
 fTokenDelimiter=NULL;
 fTokenizeMode=tkCharSet;
 fLastTokenStart=0;
 readbuf=NULL;
 readbufsize=0;
 replace_data(s.my_data);
 }

// Assembly:
leaq 0xda33(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq 0x20(%rsi), %rsi
jmp 0x46ea
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr(char const*, unsigned int)
GStr::GStr(const char *s, uint addcap): my_data(&null_data) {
  fTokenDelimiter=NULL;
  fTokenizeMode=tkCharSet;
  fLastTokenStart=0;
  readbuf=NULL;
  readbufsize=0;
  my_data=new_data(s, addcap);
  my_data->ref_count = 1;
 }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xda01(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq %rsi, %rdi
movl %edx, %esi
callq 0x453a
movq %rax, 0x20(%rbx)
movl $0x1, (%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr(int, unsigned int)
GStr::GStr(const int i, uint addcap): my_data(&null_data) {
 fTokenDelimiter=NULL;
 fTokenizeMode=tkCharSet;
 fLastTokenStart=0;
 readbuf=NULL;
 readbufsize=0;
 char buf[20];
 sprintf(buf,"%d",i);
 my_data=new_data(buf, addcap);
 }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movl %esi, %edx
movq %rdi, %r14
leaq 0xd9b7(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
leaq 0x78ba(%rip), %rsi      # 0xc177
movq %rsp, %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
movq %r15, %rdi
movl %ebx, %esi
callq 0x453a
movq %rax, 0x20(%r14)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr(double)
GStr::GStr(const double f): my_data(&null_data) {
 fTokenDelimiter=NULL;
 fTokenizeMode=tkCharSet;
 fLastTokenStart=0;
 readbuf=NULL;
 readbufsize=0;
 char buf[20];
 sprintf(buf,"%f",f);
 const int len = ::strlen(buf);
 prep_data(len);
 ::memcpy(chrs(), buf, len);
 }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0xd95b(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rdi)
leaq 0x7861(%rip), %rsi      # 0xc17a
movq %rsp, %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x2080
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::GStr(char, int)
GStr::GStr(const char c, int n): my_data(&null_data) {
  fTokenDelimiter=NULL;
  fTokenizeMode=tkCharSet;
  fLastTokenStart=0;
  readbuf=NULL;
  readbufsize=0;
  prep_data(n);
  ::memset(chrs(), c, n);
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leaq 0xd8e2(%rip), %rax      # 0x12250
movq %rax, 0x20(%rdi)
andq $0x0, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl %edx, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%r14), %rdi
addq $0xc, %rdi
movslq %ebx, %rdx
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::~GStr()
GStr::~GStr() {
  if (my_data != &null_data && --my_data->ref_count == 0)
             GFREE(my_data);
  GFREE(fTokenDelimiter);
  GFREE(readbuf);
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
leaq 0xd897(%rip), %rcx      # 0x12250
cmpq %rcx, %rax
je 0x49cb
decl (%rax)
jne 0x49cb
leaq 0x20(%rbx), %rdi
callq 0x420d
movq %rbx, %rdi
callq 0x420d
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x420d
popq %rbx
retq
movq %rax, %rdi
callq 0x765e
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::peelInt() const
char& GStr::operator[](int idx){
//returns reference to char (can be l-value)
  if (idx < 0) idx += length();
  if (idx < 0 || idx >= length()) invalid_index_error("operator[]");
  make_unique();  //because the user will probably modify this char!
  return chrs()[idx];
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x20(%rdi), %rsi
movl 0x8(%rsi), %eax
testl %eax, %eax
je 0x7501
addq $0xc, %rsi
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
pushq $0x1
popq %rdi
xorl %r9d, %r9d
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x74d3
movsbl (%rsi,%rdx), %r10d
addl $-0x30, %r10d
cmpl $0xa, %r10d
setb %r8b
testb $0x1, %r9b
je 0x74bb
movb $0x1, %r8b
movl %edi, %r9d
cmpl $0xa, %r10d
jb 0x74c6
jmp 0x74d1
xorl %r9d, %r9d
cmpl $0xa, %r10d
setb %r9b
addl %r9d, %ecx
incq %rdx
movl %r8d, %r9d
jmp 0x7491
movl %edx, %eax
testl %ecx, %ecx
je 0x7501
subl %ecx, %eax
cltq
addq %rax, %rsi
movl %ecx, %ebx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2180
movb $0x0, (%rsp,%rbx)
pushq $0xa
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2360
jmp 0x7503
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::operator[](int) const
char GStr::operator[](int idx) const {
//returns char copy (cannot be l-value!)
  if (idx < 0) idx += length();
  if (idx < 0 || idx >= length()) invalid_index_error("operator[]");
  return my_data->chars[idx];
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x20(%rdi), %rax
movl 0x8(%rax), %ecx
testl %esi, %esi
jns 0x4a5a
addl %ecx, %ebx
js 0x4a5e
cmpl %ecx, %ebx
jl 0x4a6e
leaq 0x7718(%rip), %rdi      # 0xc17d
callq 0x4a30
movq 0x20(%r14), %rax
movslq %ebx, %rcx
movb 0xc(%rax,%rcx), %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::operator=(GStr const&)
GStr& GStr::operator=(const GStr& s) {
  if (s.my_data!=my_data) {
    make_unique(); //edit operation ahead
    replace_data(s.my_data);
  }
  return *this;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rsi), %rax
cmpq 0x20(%rdi), %rax
je 0x4aa6
movq %rsi, %r14
movq %rbx, %rdi
callq 0x46a4
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x46ea
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::operator=(char const*)
GStr& GStr::operator=(const char *s) {
  make_unique(); //edit operation ahead
  if (s==NULL) {
    prep_data(0);
    return *this;
  }
  const int len = ::strlen(s); prep_data(len);
  ::memcpy(my_data->chars, s, len);
  return *this;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x46a4
testq %r14, %r14
je 0x4af4
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
jmp 0x4b00
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::assign(char const*)
GStr& GStr::assign(const char* s) {
  make_unique(); //edit operation ahead
  if (s==NULL) {
    prep_data(0, my_data->cap);
    return *this;
  }
  const int len = ::strlen(s);
  prep_data(len, my_data->cap-len-2);
  ::memcpy(my_data->chars, s, len);
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x46a4
testq %r14, %r14
je 0x4b57
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq 0x20(%rbx), %rax
movl 0x4(%rax), %edx
subl %r15d, %edx
addl $-0x2, %edx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
jmp 0x4b68
movq 0x20(%rbx), %rax
movl 0x4(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45d2
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::assign(int)
GStr& GStr::assign(const int v) {
  make_unique(); //edit operation ahead
  char buf[20];
  sprintf(buf,"%d",v);
  const int len = ::strlen(buf);
  prep_data(len, my_data->cap-len-2);
  ::memcpy(my_data->chars, buf, len);
  return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x46a4
leaq 0x75ea(%rip), %rsi      # 0xc177
movq %rsp, %r14
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2080
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq 0x20(%rbx), %rax
movl 0x4(%rax), %edx
subl %r15d, %edx
addl $-0x2, %edx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::operator=(double)
GStr& GStr::operator=(const double f) {
 make_unique(); //edit operation ahead
 char buf[20];
 sprintf(buf,"%f",f);
 const int len = ::strlen(buf);
 prep_data(len);
 ::memcpy(my_data->chars, buf, len);
 return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0x46a4
leaq 0x757c(%rip), %rsi      # 0xc17a
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x2080
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::operator=(int)
GStr& GStr::operator=(const int i) {
 make_unique(); //edit operation ahead
 char buf[20];
 sprintf(buf,"%d",i);
 const int len = ::strlen(buf);
 prep_data(len);
 ::memcpy(my_data->chars, buf, len);
 return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x46a4
leaq 0x7510(%rip), %rsi      # 0xc177
movq %rsp, %r14
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2080
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x21e0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::append(char const*)
GStr& GStr::append(const char* s) {
  make_unique(); //edit operation ahead
  uint len=::strlen(s);
  uint newlen=len+my_data->length;
  if (newlen<=my_data->length) return *this;
  if (my_data->length==0 && my_data->cap<newlen) {
    prep_data(len,4);
    ::memcpy(my_data->chars, s, len);
    return *this;
   }
  if (newlen>=my_data->cap) {
	  //not enough room to append these chars
	  GREALLOC(my_data, sizeof(Data)+newlen+1);
	  my_data->cap=newlen+1;
  }
  ::memcpy(my_data->chars+my_data->length, s, len);
  my_data->length=newlen;
  my_data->chars[newlen]='\0';
  return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x46a4
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq 0x20(%rbx), %rax
movl 0x8(%rax), %ecx
leal (%rcx,%r15), %r13d
cmpl %ecx, %r13d
jbe 0x4f9f
testl %ecx, %ecx
sete %sil
movl 0x4(%rax), %edx
cmpl %r13d, %edx
setb %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x4f45
pushq $0x4
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movl %r15d, %edx
movq %r14, %rsi
callq 0x21e0
jmp 0x4f9f
leaq 0x20(%rbx), %r12
movl %r13d, %ebp
cmpl %edx, %r13d
jb 0x4f7d
leaq 0x11(%rbp), %rsi
movq %r12, %rdi
callq 0x43e9
testb %al, %al
jne 0x4f6f
leaq 0x70b8(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
leal 0x1(%r13), %ecx
movq (%r12), %rax
movl %ecx, 0x4(%rax)
movl 0x8(%rax), %ecx
movl %ecx, %ecx
leaq (%rax,%rcx), %rdi
addq $0xc, %rdi
movl %r15d, %edx
movq %r14, %rsi
callq 0x21e0
movq (%r12), %rax
movl %r13d, 0x8(%rax)
movb $0x0, 0xc(%rax,%rbp)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::index(char const*, int) const
int GStr::index(const char *s, int start_index) const {
    // A negative index specifies an index from the right of the string.
    if (strlen(s)>(size_t)length()) return -1;
    if (start_index < 0)
        start_index += length();

    if (start_index < 0 || start_index >= length())
        invalid_index_error("index()");
    const char* idx = strstr(&my_data->chars[start_index], s);
    if (!idx)
        return -1;
    else
        return idx - my_data->chars;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2140
movq 0x20(%r14), %r15
movslq 0x8(%r15), %rcx
cmpq %rcx, %rax
jbe 0x50d1
pushq $-0x1
popq %rax
jmp 0x5116
testl %ebp, %ebp
jns 0x50d9
addl %ecx, %ebp
js 0x50dd
cmpl %ecx, %ebp
jl 0x50ed
leaq 0x70d0(%rip), %rdi      # 0xc1b4
callq 0x4a30
movq 0x20(%r14), %r15
movslq %ebp, %rax
leaq (%r15,%rax), %rdi
addq $0xc, %rdi
addq $0xc, %r15
movq %rbx, %rsi
callq 0x2090
movq %rax, %rcx
movl %ecx, %edx
subl %r15d, %edx
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
orl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::format(char const*, ...)
GStr& GStr::format(const char *fmt,...) {
// Format as in sprintf
  make_unique(); //edit operation ahead
  char* buf;
  GMALLOC(buf, strlen(fmt)+1024);
  va_list arguments;
  va_start(arguments,fmt);
  //+1K buffer, should be enough for common expressions
  int len=vsprintf(buf,fmt,arguments);
  va_end(arguments);
  prep_data(len); //this also adds the '\0' at the end!
                     //and sets the right len
  ::memcpy(chrs(), buf, len);
  GFREE(buf);
  return *this;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x58(%rsp)
testb %al, %al
je 0x5275
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
callq 0x46a4
movq %r14, %rdi
callq 0x2140
leaq 0x400(%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x415c
testb %al, %al
jne 0x52a5
leaq 0x6d82(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
leaq 0x30(%rsp), %rax
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2160
movl %eax, %ebp
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x45d2
movq 0x20(%rbx), %rdi
addq $0xc, %rdi
movq 0x8(%rsp), %r14
movslq %ebp, %rdx
movq %r14, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x22e0
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::appendfmt(char const*, ...)
GStr& GStr::appendfmt(const char *fmt,...) {
// Format as in sprintf
  make_unique(); //edit operation ahead
  char* buf;
  GMALLOC(buf, strlen(fmt)+1024);
  va_list arguments;
  va_start(arguments,fmt);
  //+1K buffer, should be enough for common expressions
  vsprintf(buf,fmt,arguments);
  va_end(arguments);
  append(buf);
  GFREE(buf);
  return *this;
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x58(%rsp)
testb %al, %al
je 0x5378
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
callq 0x46a4
movq %r14, %rdi
callq 0x2140
leaq 0x400(%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x415c
testb %al, %al
jne 0x53a8
leaq 0x6c7f(%rip), %rdi      # 0xc020
xorl %eax, %eax
callq 0x25ca
leaq 0x30(%rsp), %rax
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2160
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4ed4
movq 0x8(%rsp), %rdi
callq 0x22e0
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trim(char)
GStr& GStr::trim(char c) {
 int istart;
 int iend;
 for (istart=0; istart<length() && my_data->chars[istart]==c;istart++) ;
 if (istart==length()) {
       make_unique(); //edit operation ahead
       prep_data(0); //string was entirely trimmed
       return *this;
       }
 for (iend=length()-1; iend>istart && my_data->chars[iend]==c;iend--) ;
 int newlen=iend-istart+1;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead
 Data *data = new_data(newlen);
 ::memcpy(data->chars, &my_data->chars[istart], newlen);
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
movl 0x8(%rcx), %eax
movslq %eax, %rdx
xorl %edi, %edi
testl %edx, %edx
movl $0x0, %r15d
cmovgl %eax, %r15d
cmpq %rdi, %r15
je 0x5438
cmpb %sil, 0xc(%rcx,%rdi)
jne 0x5435
incq %rdi
jmp 0x5424
movl %edi, %r15d
cmpl %eax, %r15d
jne 0x5453
movq %rbx, %rdi
callq 0x46a4
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
jmp 0x54c3
movslq %r15d, %rdi
leal -0x1(%rax), %r8d
cmpl %r8d, %r15d
cmovll %r15d, %r8d
decq %rdx
movl %eax, %ebp
cmpq %rdi, %rdx
jle 0x547d
decl %ebp
leaq -0x1(%rdx), %r9
cmpb %sil, 0xc(%rcx,%rdx)
movq %r9, %rdx
je 0x5466
jmp 0x5480
movl %r8d, %ebp
subl %r15d, %ebp
incl %ebp
cmpl %eax, %ebp
je 0x54c3
movq %rbx, %rdi
callq 0x46a4
movl %ebp, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r14
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rax
movl %r15d, %ecx
leaq (%rax,%rcx), %rsi
addq $0xc, %rsi
movslq %ebp, %rdx
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x46ea
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trim(char const*)
GStr& GStr::trim(const char* c) {
 int istart;
 int iend;
 for (istart=0; istart<length() && strchr(c, my_data->chars[istart])!=NULL ;istart++) ;
 if (istart==length()) {
        prep_data(0); //string was entirely trimmed
        return *this;
        }
 for (iend=length()-1; iend>istart && strchr(c, my_data->chars[iend])!=NULL;iend--) ;
 int newlen=iend-istart+1;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead
 Data *data = new_data(newlen);
 ::memcpy(data->chars, & (my_data->chars[istart]), newlen);
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq 0x20(%rdi), %r13
movl 0x8(%r13), %ebp
movslq %ebp, %rbx
xorl %r12d, %r12d
testl %ebx, %ebx
movl $0x0, %r15d
cmovgl %ebp, %r15d
cmpq %r12, %r15
je 0x5522
movsbl 0xc(%r13,%r12), %esi
movq %r14, %rdi
callq 0x2100
testq %rax, %rax
je 0x551f
incq %r12
jmp 0x5502
movl %r12d, %r15d
cmpl %ebp, %r15d
jne 0x553d
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
jmp 0x55c3
movslq %r15d, %r12
leal -0x1(%rbp), %eax
cmpl %eax, %r15d
cmovll %r15d, %eax
movl %eax, 0x4(%rsp)
decq %rbx
movq %rbp, 0x10(%rsp)
cmpq %r12, %rbx
jle 0x5575
movsbl 0xc(%r13,%rbx), %esi
movq %r14, %rdi
callq 0x2100
decl %ebp
decq %rbx
testq %rax, %rax
jne 0x5556
jmp 0x5579
movl 0x4(%rsp), %ebp
subl %r15d, %ebp
incl %ebp
cmpl 0x10(%rsp), %ebp
movq 0x8(%rsp), %rbx
je 0x55c3
movq %rbx, %rdi
callq 0x46a4
movl %ebp, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r14
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rax
movl %r15d, %ecx
leaq (%rax,%rcx), %rsi
addq $0xc, %rsi
movslq %ebp, %rdx
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x46ea
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trimR(char)
GStr& GStr::trimR(char c) {
 //only trim the right end
 int iend;
 for (iend=length()-1; iend>=0 && my_data->chars[iend]==c;iend--) ;
 if (iend==-1) {
       make_unique();
       prep_data(0); //string was entirely trimmed
       return *this;
       }
 int newlen=iend+1;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead
 my_data->length=newlen;
 my_data->chars[newlen]='\0';
 /*

 Data *data = new_data(newlen);
 ::memcpy(data->chars, my_data->chars, newlen);
 replace_data(data);
 */
 return *this;
 }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movslq 0x8(%rax), %rdx
movl %edx, %edi
xorl %r8d, %r8d
movq %rdi, %r15
movq %rdx, %r14
movl %r8d, %ecx
testl %r15d, %r15d
jle 0x560e
leaq -0x1(%r15), %rdi
leaq -0x1(%r14), %rdx
leal 0x1(%rcx), %r8d
cmpb %sil, 0xb(%rax,%r15)
je 0x55eb
jmp 0x5613
testq %r15, %r15
je 0x562f
testl %ecx, %ecx
je 0x5643
movq %rbx, %rdi
callq 0x46a4
movq 0x20(%rbx), %rax
movl %r15d, 0x8(%rax)
movb $0x0, 0xc(%rax,%r14)
jmp 0x5643
movq %rbx, %rdi
callq 0x46a4
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trimR(char const*)
GStr& GStr::trimR(const char* c) {
 int iend;
 for (iend=length()-1; iend>=0 && strchr(c,my_data->chars[iend])!=NULL;iend--) ;
 if (iend==-1) {
       make_unique();
       prep_data(0); //string was entirely trimmed
       return *this;
       }
 int newlen=iend+1;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead
 my_data->length=newlen;
 my_data->chars[newlen]='\0';
 /*
 Data *data = new_data(newlen);
 ::memcpy(data->chars, my_data->chars, newlen);
 replace_data(data);
 */
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, (%rsp)
movq 0x20(%rdi), %r13
movslq 0x8(%r13), %rcx
movl %ecx, %ebx
xorl %edx, %edx
movq %rbx, %r12
movq %rcx, %r15
movl %edx, %ebp
testl %r12d, %r12d
jle 0x5698
leaq -0x1(%r12), %rbx
movsbl 0xb(%r13,%r12), %esi
movq %r14, %rdi
callq 0x2100
leaq -0x1(%r15), %rcx
leal 0x1(%rbp), %edx
testq %rax, %rax
jne 0x566a
jmp 0x569d
testq %r12, %r12
je 0x56bd
testl %ebp, %ebp
movq (%rsp), %rbx
je 0x56d5
movq %rbx, %rdi
callq 0x46a4
movq 0x20(%rbx), %rax
movl %r12d, 0x8(%rax)
movb $0x0, 0xc(%rax,%r15)
jmp 0x56d5
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x46a4
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::chomp(char const*)
GStr& GStr::chomp(const char* cstr) {
 int iend;
 if (cstr==NULL || *cstr==0) return *this;
 //check if this ends with cstr
 int cend=strlen(cstr)-1;
 iend=my_data->length-1;
 while (iend>=0 && cend>=0) {
  if (my_data->chars[iend]!=cstr[cend]) return *this;
  iend--;
  cend--;
  }
 if (iend==-1) {
       make_unique();
       prep_data(0); //string will be entirely trimmed
       return *this;
       }
 int newlen=iend+1;
 make_unique(); //edit operation ahead
 my_data->length=newlen;
 my_data->chars[newlen]='\0';
 //Data *data = new_data(newlen);
 //::memcpy(data->chars, my_data->chars, newlen);
 //replace_data(data);
 return *this;
 }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x5799
movq %rsi, %r14
cmpb $0x0, (%rsi)
je 0x5799
movq %r14, %rdi
callq 0x2140
movq 0x20(%rbx), %rcx
movl 0x8(%rcx), %r12d
movl %eax, %eax
decq %rax
movq %r12, %r15
shlq $0x20, %r15
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
leaq -0x1(%r12), %rdi
movl %edi, %r8d
orl %eax, %r8d
btl $0x1f, %r8d
jb 0x5767
movq %rdi, %r8
andq %rdx, %r8
movb 0xc(%rcx,%r8), %r8b
movq %rax, %r9
andq %rdx, %r9
decq %rax
addq %rsi, %r15
movq %rdi, %r12
cmpb (%r14,%r9), %r8b
je 0x5733
jmp 0x5799
movq %rbx, %rdi
testq %r12, %r12
je 0x5788
callq 0x46a4
movq 0x20(%rbx), %rax
movl %r12d, 0x8(%rax)
sarq $0x20, %r15
movb $0x0, 0xc(%rax,%r15)
jmp 0x5799
callq 0x46a4
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trimL(char)
GStr& GStr::trimL(char c) {
 int istart;
 for (istart=0; istart<length() && my_data->chars[istart]==c;istart++) ;
 if (istart==length()) {
       prep_data(0); //string was entirely trimmed
       return *this;
       }
 int newlen=length()-istart;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead
 Data *data = new_data(newlen);
 ::memcpy(data->chars, &my_data->chars[istart], newlen);
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
movl 0x8(%rcx), %ebp
xorl %eax, %eax
testl %ebp, %ebp
movl $0x0, %r15d
cmovgl %ebp, %r15d
cmpq %rax, %r15
je 0x57db
cmpb %sil, 0xc(%rcx,%rax)
jne 0x57d8
incq %rax
jmp 0x57c7
movl %eax, %r15d
subl %r15d, %ebp
jne 0x57ee
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
jmp 0x582d
testl %r15d, %r15d
je 0x582d
movq %rbx, %rdi
callq 0x46a4
movl %ebp, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r14
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rax
movl %r15d, %ecx
leaq (%rax,%rcx), %rsi
addq $0xc, %rsi
movslq %ebp, %rdx
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x46ea
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::trimL(char const*)
GStr& GStr::trimL(const char* c) {
 int istart;
 for (istart=0; istart<length() && strchr(c,my_data->chars[istart])!=NULL;istart++) ;
 if (istart==length()) {
       prep_data(0); //string was entirely trimmed
       return *this;
       }
 int newlen=length()-istart;
 if (newlen==length())  //nothing to trim
           return *this;
 make_unique(); //edit operation ahead

 Data *data = new_data(newlen);
 ::memcpy(data->chars, &my_data->chars[istart], newlen);
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %r13
movl 0x8(%r13), %ebp
xorl %r12d, %r12d
testl %ebp, %ebp
movl $0x0, %r15d
cmovgl %ebp, %r15d
cmpq %r12, %r15
je 0x5884
movsbl 0xc(%r13,%r12), %esi
movq %r14, %rdi
callq 0x2100
testq %rax, %rax
je 0x5881
incq %r12
jmp 0x5864
movl %r12d, %r15d
subl %r15d, %ebp
jne 0x5897
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45d2
jmp 0x58d6
testl %r15d, %r15d
je 0x58d6
movq %rbx, %rdi
callq 0x46a4
movl %ebp, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r14
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rax
movl %r15d, %ecx
leaq (%rax,%rcx), %rsi
addq $0xc, %rsi
movslq %ebp, %rdx
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x46ea
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::padR(unsigned int, char)
GStr& GStr::padR(uint len, char c) {
 //pad with c until total string length is len
 if (my_data->length>=len) return *this; //no room for padding
 make_unique(); //edit operation ahead
 if (my_data->cap>=len) {
	 ::memset(my_data->chars, c, len-my_data->length);
	 my_data->length=len;
	 return *this;
 }
 Data *data = new_data(len);
 ::memset(data->chars,c,len-my_data->length);
 ::memcpy(&data->chars[len-length()], my_data->chars, my_data->length);
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
cmpl %esi, 0x8(%rax)
jae 0x5979
movl %edx, %ebp
movl %esi, %r14d
movq %rbx, %rdi
callq 0x46a4
movq 0x20(%rbx), %rdi
cmpl %r14d, 0x4(%rdi)
jae 0x595e
movl %r14d, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r15
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rax
movl %r14d, %edx
subl 0x8(%rax), %edx
movzbl %bpl, %esi
callq 0x2190
movq 0x20(%rbx), %rsi
movl 0x8(%rsi), %edx
subl %edx, %r14d
leaq (%r15,%r14), %rdi
addq $0xc, %rdi
addq $0xc, %rsi
callq 0x21e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x46ea
jmp 0x5979
movl %r14d, %edx
subl 0x8(%rdi), %edx
addq $0xc, %rdi
movzbl %bpl, %esi
callq 0x2190
movq 0x20(%rbx), %rax
movl %r14d, 0x8(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/GStr.cpp
// Function: GStr::padL(unsigned int, char)
GStr& GStr::padL(uint len, char c) { //align left the string
 if (my_data->length>=len) return *this; //no room for padding
 make_unique(); //edit operation ahead
 Data *data = new_data(len);
 ::memcpy(data->chars, my_data->chars, length());
 ::memset(&data->chars[length()],c,len-length());
 replace_data(data);
 return *this;
 }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
cmpl %esi, 0x8(%rax)
jae 0x59f4
movl %edx, %ebp
movl %esi, %r14d
movq %rbx, %rdi
callq 0x46a4
movl %r14d, %edi
xorl %esi, %esi
callq 0x44d4
movq %rax, %r15
leaq 0xc(%rax), %rdi
movq 0x20(%rbx), %rsi
movslq 0x8(%rsi), %rdx
addq $0xc, %rsi
callq 0x21e0
movq 0x20(%rbx), %rax
movslq 0x8(%rax), %rax
leaq (%r15,%rax), %rdi
addq $0xc, %rdi
subl %eax, %r14d
movzbl %bpl, %esi
movq %r14, %rdx
callq 0x2190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x46ea
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq