// File: /workspace/github_c_makefile_star2_O1/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 0x1926a
testl %eax, %eax
jle 0x17fc7
movl %eax, %r13d
leaq 0xd7eb(%rip), %rbx      # 0x25760
movl $0x0, 0x1fc(%rbx)
leaq 0x3132(%rip), %rax      # 0x1b0b8
movl (%rax), %ebp
movl %ebp, 0x1f8(%rbx)
movl $0x1, %r15d
movl $0x1, %edi
callq 0x192b4
testq %rax, %rax
je 0x18143
movq 0x10(%rax), %rax
cmpl $0x3, 0xc0(%rax)
jg 0x18057
cmpl $0x1, %r13d
jne 0x17fe3
movq 0xb8(%rbx), %rsi
jmp 0x17fd5
leaq 0xd792(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
jmp 0x18153
leaq 0x30d2(%rip), %rax      # 0x1b0bc
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
movl $0x1, %edi
callq 0x19324
cvttsd2si %xmm0, %eax
movl %eax, 0x1fc(%rbx)
movl $0x2, %r15d
movl $0x2, %edi
callq 0x192b4
testq %rax, %rax
je 0x18143
movq 0x10(%rax), %rax
cmpl $0x3, 0xc0(%rax)
jg 0x18057
cmpl $0x2, %r13d
jle 0x17fbe
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
xorpd %xmm0, %xmm0
movl $0x2, %edi
callq 0x19324
cvttsd2si %xmm0, %eax
movl %eax, 0x1f8(%rbx)
movl $0x3, %r15d
movl %r15d, %edi
callq 0x192b4
testq %rax, %rax
je 0x18143
movq 0x10(%rax), %rcx
cmpl $0x4, 0xc0(%rcx)
jne 0x18166
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movl %eax, (%rsp)
leal 0x1(%r15), %eax
movq %rax, 0x8(%rsp)
cmpl %r13d, %r15d
jge 0x180ea
movl %r13d, %ebx
negl %ebx
leaq 0x4(%rsp), %rbp
movq %rsp, %r12
movq 0x8(%rsp), %r14
movl %r14d, %edi
callq 0x192b4
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x180d7
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rsp)
movl 0x1c(%rax), %eax
movl %eax, 0x1c(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xdfe8
leal (%rbx,%r14), %eax
incl %eax
movl %r14d, %ecx
incl %ecx
movl %ecx, %r14d
cmpl $0x1, %eax
jne 0x180a7
movl (%rsp), %esi
addl 0x4(%rsp), %esi
leaq 0x38(%rsp), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x18118
leaq 0x38(%rsp), %rdi
callq 0x8bb7
testl %eax, %eax
je 0x18178
leaq 0xd641(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
callq 0xd1a9
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb8(%rbx), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd1a9
movq 0xb8(%rbx), %rsi
addq $-0x4, %rsi
movl $0x25, %edi
jmp 0x18153
movl (%rsp), %eax
addl 0x4(%rsp), %eax
leaq 0xd5da(%rip), %r14      # 0x25760
movq 0x8(%rsp), %r12
jle 0x18209
leaq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0x911c
movq %rax, 0x30(%rsp)
cmpl %r13d, %r15d
jge 0x18209
negl %r13d
leaq 0x10(%rsp), %r15
leaq 0x30(%rsp), %rbx
movq %rsp, %rbp
movl %r12d, %edi
callq 0x192b4
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x181f6
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rsp)
movl 0x1c(%rax), %eax
movl %eax, 0x1c(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xdd6b
cmpl $0x0, 0x20(%r14)
je 0x181ef
decl 0x1c(%r14)
cmpl $0x0, 0x18(%r14)
jne 0x18266
leal (%r12,%r13), %eax
incl %eax
movl %r12d, %ecx
incl %ecx
movl %ecx, %r12d
cmpl $0x1, %eax
jne 0x181b6
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x18(%rax), %esi
incl %esi
callq 0x911c
movq (%rax), %rbx
movl 0x38(%rsp), %edx
movq %rax, %rdi
movl $0x1, %esi
callq 0x121b3
cmpl $0x0, 0x18(%r14)
jne 0x18134
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 0x8821
movq %rbx, %rdi
jmp 0x1826b
leaq 0x38(%rsp), %rdi
callq 0x847e
jmp 0x18134