// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxUtil.c
// Function: SetupAppendBuffer
static void
SetupAppendBuffer(
    Interp *iPtr,	/* Interpreter whose result is being set up. */
    int newSpace		/* Make sure that at least this many bytes
				 * of new information may be added. */)
{
    Hax_Memoryp *memoryp = iPtr->memoryp;
    int totalSpace;

    /*
     * Make the append buffer larger, if that's necessary, then
     * copy the current result into the append buffer and make the
     * append buffer the official Hax result.
     */

    if (iPtr->result != iPtr->appendResult) {
	/*
	 * If an oversized buffer was used recently, then free it up
	 * so we go back to a smaller buffer.  This avoids tying up
	 * memory forever after a large operation.
	 */

	if (iPtr->appendAvl > 500) {
	    ckfree(memoryp, iPtr->appendResult);
	    iPtr->appendResult = NULL;
	    iPtr->appendAvl = 0;
	}
	iPtr->appendUsed = strlen(iPtr->result);
    }
    totalSpace = newSpace + iPtr->appendUsed;
    if (totalSpace >= iPtr->appendAvl) {
	char *newPtr;

	if (totalSpace < 100) {
	    totalSpace = 200;
	} else {
	    totalSpace *= 2;
	}
	newPtr = (char *) ckalloc(memoryp, (unsigned) totalSpace);
	strcpy(newPtr, iPtr->result);
	if (iPtr->appendResult != NULL) {
	    ckfree(memoryp, iPtr->appendResult);
	}
	iPtr->appendResult = newPtr;
	iPtr->appendAvl = totalSpace;
    } else if (iPtr->result != iPtr->appendResult) {
	strcpy(iPtr->appendResult, iPtr->result);
    }
    Hax_FreeResult((Hax_Interp *) iPtr);
    iPtr->result = iPtr->appendResult;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x118(%rcx), %rax
je 0x18d37
movq -0x8(%rbp), %rax
cmpl $0x1f4, 0x120(%rax)     # imm = 0x1F4
jle 0x18d1f
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rsi
leaq 0x6b32(%rip), %rdx      # 0x1f82a
movl $0x493, %ecx            # imm = 0x493
callq 0x4260
movq -0x8(%rbp), %rax
movq $0x0, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x120(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x41b0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x124(%rax)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x124(%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x120(%rcx), %eax
jl 0x18deb
cmpl $0x64, -0x1c(%rbp)
jge 0x18d69
movl $0xc8, -0x1c(%rbp)
jmp 0x18d71
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
leaq 0x6aa9(%rip), %rdx      # 0x1f82a
movl $0x4a2, %ecx            # imm = 0x4A2
callq 0x44c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x118(%rax)
je 0x18dcd
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rsi
leaq 0x6a67(%rip), %rdx      # 0x1f82a
movl $0x4a5, %ecx            # imm = 0x4A5
callq 0x4260
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x118(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x120(%rax)
jmp 0x18e18
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x118(%rcx), %rax
je 0x18e16
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x40d0
jmp 0x18e18
jmp 0x18e1a
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x18e79
movq -0x8(%rbp), %rax
movq 0xa178(%rip), %rcx      # 0x22fa8
cmpq %rcx, 0x8(%rax)
jne 0x18e5c
movq -0x8(%rbp), %rdi
callq 0x4540
movq %rax, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x69da(%rip), %rdx      # 0x1f82a
movl $0x4ac, %ecx            # imm = 0x4AC
callq 0x4260
jmp 0x18e6d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x18e7b
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)