// File: /workspace/github_c_makefile_star2_O3/heltilda[P]cicada/ciclib.c
// Function: cclib_print_string
void cclib_print_string()
{
    window *precisionWindow, *fieldWidthWindow, *stringWindow, *charWindow;
    member *charMember;
    view windowView;
    char *stringPositionMarker;
    ccInt dataSize, sizeofStrings, counter, numArgs, stringWindowPosition = 1, rtrn;
    linkedlist tempPrintLL;
    
    numArgs = numBIF_args();
    if (numArgs < 1)  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
    
    
        // read in the (optional) field width and floating-point precision arguments; otherwise use default values
    
    fieldWidth = 0;
    maxDigits = maxPrintableDigits;
    
    fieldWidthWindow = getBIFmember(1);
    if (fieldWidthWindow == NULL)  {  setError(void_member_err, pcCodePtr-1);  return;  }
    
    if (fieldWidthWindow->variable_ptr->type <= double_type)  {
        stringWindowPosition++;
        if (numArgs < 2)  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
        fieldWidth = (ccInt) getBIFnumArg(1, 0., (ccFloat) maxFieldWidth);
        
        precisionWindow = getBIFmember(2);
        if (precisionWindow == NULL)  {  setError(void_member_err, pcCodePtr-1);  return;  }
        
        if (precisionWindow->variable_ptr->type <= double_type)  {
            stringWindowPosition++;
            if (numArgs < 3)  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
            maxDigits = (ccInt) getBIFnumArg(2, 0., (ccFloat) maxPrintableDigits);
    }   }
    
    stringWindow = getBIFmember(stringWindowPosition);
    if (stringWindow == NULL)  {  setError(void_member_err, pcCodePtr-1);  return;  }
    if (stringWindow->variable_ptr->type != string_type)  {  setError(string_expected_err, pcCodePtr-1);  return;  }
    
    
        // compute the byte size of the final string without printing it yet
    
    dataSize = 0;  sizeofStrings = 0;
    for (counter = stringWindowPosition+1; counter <= numArgs; counter++)  {
        windowView.windowPtr = getBIFmember(counter);
        if (windowView.windowPtr != NULL)  {
            windowView.offset = windowView.windowPtr->offset;
            windowView.width = windowView.windowPtr->width;
            sizeViewString(&windowView, &dataSize, (void *) &sizeofStrings);
    }   }
    
    
        // allocate contiguous memory in the destination string
    
    rtrn = newLinkedList(&tempPrintLL, dataSize+sizeofStrings, sizeof(char), 0, ccFalse);
    if (rtrn == passed)  rtrn = defragmentLinkedList(&tempPrintLL);
    if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr-1);  return;  }
    
    
        // print the string
    
    if (dataSize+sizeofStrings > 0)  {
        stringPositionMarker = (char *) element(&tempPrintLL, 1);
        for (counter = stringWindowPosition+1; counter <= numArgs; counter++)  {
            windowView.windowPtr = getBIFmember(counter);
            if (windowView.windowPtr != NULL)  {
                windowView.offset = windowView.windowPtr->offset;
                windowView.width = windowView.windowPtr->width;
                printViewString(&windowView, (void *) &stringPositionMarker, (void *) &sizeofStrings);
                if (warningCode != passed)  errIndex--;
                if (errCode != passed)  {  deleteLinkedList(&tempPrintLL);  return;  }
    }   }   }
    
    
        // rewire the output string to point to the linked list we just created
    
    charMember = LL_member(stringWindow->variable_ptr, stringWindow->offset+1);
    charWindow = charMember->memberWindow;
    resizeMember(charMember, 1, tempPrintLL.elementNum);
    if (errCode != passed)  return;
    
    copyElements(&tempPrintLL, 1, &(charWindow->variable_ptr->mem.data), charWindow->offset+1, tempPrintLL.elementNum);
    deleteLinkedList(&tempPrintLL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
callq 0x19254
testl %eax, %eax
jle 0x17fa9
movl %eax, %r13d
leaq 0xd80b(%rip), %r14      # 0x25760
movl $0x0, 0x1fc(%r14)
leaq 0x312d(%rip), %rax      # 0x1b094
movl (%rax), %ebp
movl %ebp, 0x1f8(%r14)
movl $0x1, %r15d
movl $0x1, %edi
callq 0x1929e
testq %rax, %rax
je 0x1812a
movq 0x10(%rax), %rax
cmpl $0x3, 0xc0(%rax)
jg 0x1803b
cmpl $0x1, %r13d
jne 0x17fc5
movq 0xb8(%r14), %rsi
jmp 0x17fb7
leaq 0xd7b0(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
jmp 0x1813a
leaq 0x30cc(%rip), %rax      # 0x1b098
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
movl $0x1, %edi
callq 0x1930e
cvttsd2si %xmm0, %eax
movl %eax, 0x1fc(%r14)
movl $0x2, %r15d
movl $0x2, %edi
callq 0x1929e
testq %rax, %rax
je 0x1812a
movq 0x10(%rax), %rax
cmpl $0x3, 0xc0(%rax)
jg 0x1803b
cmpl $0x2, %r13d
jbe 0x17fa0
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
xorpd %xmm0, %xmm0
movl $0x2, %edi
callq 0x1930e
cvttsd2si %xmm0, %eax
movl %eax, 0x1f8(%r14)
movl $0x3, %r15d
movl %r15d, %edi
callq 0x1929e
testq %rax, %rax
je 0x1812a
movq %rax, %r12
movq 0x10(%rax), %rax
cmpl $0x4, 0xc0(%rax)
jne 0x1814d
xorl %esi, %esi
movl %esi, 0x4(%rsp)
movl %esi, (%rsp)
leal 0x1(%r15), %eax
movq %rax, 0x8(%rsp)
cmpl %r13d, %r15d
jae 0x180df
movq %r12, 0x10(%rsp)
movl %r13d, %ebx
negl %ebx
leaq 0x4(%rsp), %rbp
movq %rsp, %r12
movq 0x8(%rsp), %r14
movl %r14d, %edi
callq 0x1929e
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x180b9
movq 0x18(%rax), %rax
movq %rax, 0x28(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xdde4
leal (%rbx,%r14), %eax
incl %eax
movl %r14d, %ecx
incl %ecx
movl %ecx, %r14d
cmpl $0x1, %eax
jne 0x1808e
movl (%rsp), %esi
addl 0x4(%rsp), %esi
leaq 0xd686(%rip), %r14      # 0x25760
movq 0x10(%rsp), %r12
leaq 0x38(%rsp), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x18106
leaq 0x38(%rsp), %rdi
callq 0x8c00
testl %eax, %eax
je 0x1815f
movq 0xb8(%r14), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
callq 0xcfa3
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb8(%r14), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcfa3
movq 0xb8(%r14), %rsi
addq $-0x4, %rsi
movl $0x25, %edi
jmp 0x1813a
movl (%rsp), %eax
addl 0x4(%rsp), %eax
jle 0x181e0
leaq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0x91d8
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
cmpl %r13d, %r15d
jae 0x181e0
negl %r13d
leaq 0x18(%rsp), %rbx
movq %rsp, %rbp
movq %rdi, %r15
callq 0x1929e
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x181ce
movq 0x18(%rax), %rax
movq %rax, 0x28(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xdb5d
cmpl $0x0, 0x20(%r14)
je 0x181c7
decl 0x1c(%r14)
cmpl $0x0, 0x18(%r14)
jne 0x1823b
leal (%r15,%r13), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %edi
cmpl $0x1, %eax
jne 0x18191
movq 0x10(%r12), %rdi
addq $0x10, %rdi
movl 0x18(%r12), %esi
incl %esi
callq 0x91d8
movq (%rax), %rbx
movl 0x38(%rsp), %edx
movq %rax, %rdi
movl $0x1, %esi
callq 0x12023
cmpl $0x0, 0x18(%r14)
jne 0x1811b
movq 0x10(%rbx), %rdx
addq $0x10, %rdx
movl 0x18(%rbx), %ecx
incl %ecx
leaq 0x38(%rsp), %rbx
movl (%rbx), %r8d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8856
movq %rbx, %rdi
jmp 0x18240
leaq 0x38(%rsp), %rdi
callq 0x847e
jmp 0x1811b