// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/ciclib.c
// Function: cclib_read_string
void cclib_read_string()
{
    view windowView;
    window *stringWindow;
    linkedlist *theString;
    ccInt counter, numArgs, oneLetterType;
    char *stringPositionMarker, *holdString, *stringOverflow[2];
    
    numArgs = numBIF_args();
    if (numArgs < 1)  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
    
    
        // read in the source string:  argument 1
    
    stringWindow = getBIFstringArg(1);
    if (errCode != passed)  return;
    theString = &(stringWindow->variable_ptr->mem.data);   
    
    
        // make a copy of the source string, just in case the copy process would overwrite the source string
    
    holdString = (char *) malloc(stringWindow->width+1);
    if (holdString == NULL)  {  setError(out_of_memory_err, pcCodePtr-1);  return;  }
    getElements(theString, stringWindow->offset+1, stringWindow->offset+stringWindow->width, (void *) holdString);
    holdString[stringWindow->width] = 0;
    stringOverflow[0] = holdString+stringWindow->width;     // the end of the string
    
    
        // get past any weird characters at the beginning
    
    stringPositionMarker = holdString;
    oneLetterType = lettertype(stringPositionMarker);
    while ((oneLetterType != a_symbol) && (oneLetterType != a_number) && (oneLetterType != a_letter)
                    && (stringPositionMarker < stringOverflow[0]))  {
        stringPositionMarker++;
        oneLetterType = lettertype(stringPositionMarker);     }
    
    
        // Read the string into the subsequent argument variables.  String variables are read up through the next space.
    
    for (counter = 2; counter <= numArgs; counter++)   {
        windowView.windowPtr = getBIFmember(counter);
        if (windowView.windowPtr != NULL)  {
            windowView.offset = windowView.windowPtr->offset;
            windowView.width = windowView.windowPtr->width;
            readViewString(&windowView, (void *) &stringPositionMarker, stringOverflow);
            if (warningCode != passed)  errIndex--;
            if (errCode != passed)  {  free((void *) holdString);  return;  }
    }   }
    
    
        // Finally, check to see if there seem to be any left-over useful fields in the string -- if so, set a warning.
    
    oneLetterType = lettertype(stringPositionMarker);
    while ((oneLetterType != a_symbol) && (oneLetterType != a_number)
                    && (oneLetterType != a_letter) && (stringPositionMarker < stringOverflow[0]))  {
        stringPositionMarker++;
        oneLetterType = lettertype(stringPositionMarker);         }
    
    if ((stringPositionMarker != holdString+stringWindow->width) && (warningCode == passed))  {
        stringOverflow[1] = stringPositionMarker;
        if (stringOverflow[1] >= stringOverflow[0])  stringOverflow[1] = stringOverflow[0]-1;
        setWarning(string_read_err, pcCodePtr-1);       }
    
    if ((warningCode != passed) && (doPrintError))  {
        printError(NULL, -1, holdString, (ccInt) (stringOverflow[1]-holdString), ccTrue);
        warningCode = passed;       }
    
    free((void *) holdString);      // clean up
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
callq 0x1fa40
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x30(%rbp)
jge 0x1df47
leaq 0xe823(%rip), %rax      # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
callq 0xf740
jmp 0x1e23d
movl $0x1, %edi
callq 0x1fd70
movq %rax, -0x20(%rbp)
leaq 0xe7f4(%rip), %rax      # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1df67
jmp 0x1e23d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x81d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1dfb5
leaq 0xe7b5(%rip), %rax      # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
callq 0xf740
jmp 0x1e23d
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %esi
addl $0x1, %esi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x20(%rbp), %rax
addl 0x1c(%rax), %edx
movq -0x48(%rbp), %rcx
callq 0x9540
movq -0x48(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x1c(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq -0x48(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x1c(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xb15b(%rip), %rax      # 0x29170
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x5, -0x34(%rbp)
movb %al, -0x61(%rbp)
je 0x1e04a
xorl %eax, %eax
cmpl $0x4, -0x34(%rbp)
movb %al, -0x61(%rbp)
je 0x1e04a
xorl %eax, %eax
cmpl $0x3, -0x34(%rbp)
movb %al, -0x61(%rbp)
je 0x1e04a
movq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
setb %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x1e053
jmp 0x1e077
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xb101(%rip), %rax      # 0x29170
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
jmp 0x1e01b
movl $0x2, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jg 0x1e113
movl -0x2c(%rbp), %edi
callq 0x1fab0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1e103
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xc(%rbp)
leaq -0x60(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x111e0
leaq 0xe687(%rip), %rax      # 0x2c750
cmpl $0x0, 0x20(%rax)
je 0x1e0e6
leaq 0xe67a(%rip), %rax      # 0x2c750
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
leaq 0xe66d(%rip), %rax      # 0x2c750
movl %ecx, 0x1c(%rax)
leaq 0xe663(%rip), %rax      # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1e101
movq -0x48(%rbp), %rdi
callq 0x81c0
jmp 0x1e23d
jmp 0x1e103
jmp 0x1e105
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1e07e
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xb04d(%rip), %rax      # 0x29170
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x5, -0x34(%rbp)
movb %al, -0x62(%rbp)
je 0x1e158
xorl %eax, %eax
cmpl $0x4, -0x34(%rbp)
movb %al, -0x62(%rbp)
je 0x1e158
xorl %eax, %eax
cmpl $0x3, -0x34(%rbp)
movb %al, -0x62(%rbp)
je 0x1e158
movq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
setb %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x1e161
jmp 0x1e185
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0xaff3(%rip), %rax      # 0x29170
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
jmp 0x1e129
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0x1c(%rdx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x1e1e4
leaq 0xe5ac(%rip), %rax      # 0x2c750
cmpl $0x0, 0x20(%rax)
jne 0x1e1e4
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jb 0x1e1c8
movq -0x60(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x58(%rbp)
leaq 0xe581(%rip), %rax      # 0x2c750
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x5, %edi
callq 0xf940
leaq 0xe565(%rip), %rax      # 0x2c750
cmpl $0x0, 0x20(%rax)
je 0x1e234
leaq 0xe558(%rip), %rax      # 0x2c750
cmpb $0x0, 0x2a9(%rax)
je 0x1e234
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %r8d
callq 0x21350
leaq 0xe523(%rip), %rax      # 0x2c750
movl $0x0, 0x20(%rax)
movq -0x48(%rbp), %rdi
callq 0x81c0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)