// File: /workspace/github_cpp_makefile_star2_O2/andrakis[P]alisp/contrib/linenoise-ng/src/linenoise.cpp
// Function: DynamicPrompt::DynamicPrompt(PromptBase&, int)
DynamicPrompt(PromptBase& pi, int initialDirection)
      : searchTextLen(0), direction(initialDirection) {
    promptScreenColumns = pi.promptScreenColumns;
    promptCursorRowOffset = 0;
    Utf32String emptyString(1);
    searchText = emptyString;
    const Utf32String* basePrompt =
        (direction > 0) ? &forwardSearchBasePrompt : &reverseSearchBasePrompt;
    size_t promptStartLength = basePrompt->length();
    promptChars =
        static_cast<int>(promptStartLength + endSearchBasePrompt.length());
    promptBytes = promptChars;
    promptLastLinePosition = promptChars;  // TODO fix this, we are asssuming
                                           // that the history prompt won't wrap
                                           // (!)
    promptPreviousLen = promptChars;
    Utf32String tempUnicode(promptChars + 1);
    memcpy(tempUnicode.get(), basePrompt->get(),
           sizeof(char32_t) * promptStartLength);
    memcpy(&tempUnicode[promptStartLength], endSearchBasePrompt.get(),
           sizeof(char32_t) * (endSearchBasePrompt.length() + 1));
    tempUnicode.initFromBuffer();
    promptText = tempUnicode;
    calculateScreenPosition(0, 0, pi.promptScreenColumns, promptChars,
                            promptIndentation, promptExtraLines);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x11d20
leaq 0x40(%rbx), %r14
movq %r14, %rdi
callq 0x118cc
andl $0x0, 0x58(%rbx)
movl %ebp, 0x5c(%rbx)
movl 0x34(%r15), %eax
movl %eax, 0x34(%rbx)
andl $0x0, 0x30(%rbx)
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r14, (%rsp)
callq 0x119cc
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x11d46
movl 0x5c(%rbx), %r13d
testl %r13d, %r13d
leaq 0x19e2f(%rip), %rbp     # 0x2b8e0
leaq 0x19e38(%rip), %r14     # 0x2b8f0
movq %r14, %rax
cmovgq %rbp, %rax
movq (%rax), %r12
movl 0x19e38(%rip), %eax     # 0x2b900
leal (%r12,%rax), %ecx
movl %ecx, 0x18(%rbx)
movl %ecx, 0x1c(%rbx)
movl %ecx, 0x28(%rbx)
movl %ecx, 0x38(%rbx)
leal (%r12,%rax), %esi
incl %esi
leaq 0x8(%rsp), %rdi
callq 0x119cc
testl %r13d, %r13d
leaq 0x8(%rsp), %r13
movq 0x8(%r13), %rdi
cmovgq %rbp, %r14
movq 0x8(%r14), %rsi
shlq $0x2, %r12
movq %r12, %rdx
callq 0x7290
addq 0x8(%r13), %r12
movq 0x19df5(%rip), %rsi     # 0x2b908
movq 0x19de6(%rip), %rax     # 0x2b900
leaq 0x4(,%rax,4), %rdx
movq %r12, %rdi
callq 0x7290
movq %r13, %rdi
callq 0x11d30
movq %rbx, %rdi
movq %r13, %rsi
callq 0x11d46
movl 0x34(%r15), %edx
movl 0x18(%rbx), %ecx
leaq 0x24(%rbx), %r8
addq $0x20, %rbx
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %r9
callq 0xe41f
leaq 0x8(%rsp), %rdi
callq 0x118be
leaq 0x18(%rsp), %rdi
callq 0x118be
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x118be
jmp 0x11b8f
jmp 0x11b8c
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0x118be
jmp 0x11b9e
movq %rax, %r15
movq (%rsp), %rdi
callq 0x118be
jmp 0x11bac
movq %rax, %r15
movq %rbx, %rdi
callq 0x118be
movq %r15, %rdi
callq 0x7600