// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hvm/src/linenoise.c
// Function: linenoise
char *linenoise(const char *prompt) {
    char buf[LINENOISE_MAX_LINE];
    int count;

    if (isUnsupportedTerm()) {
        size_t len;

        printf("%s",prompt);
        fflush(stdout);
        if (fgets(buf,LINENOISE_MAX_LINE,stdin) == NULL) return NULL;
        len = strlen(buf);
        while(len && (buf[len-1] == '\n' || buf[len-1] == '\r')) {
            len--;
            buf[len] = '\0';
        }
        return strdup(buf);
    } else {
        count = linenoiseRaw(buf,LINENOISE_MAX_LINE,prompt);
        if (count == -1) return NULL;
        return strdup(buf);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
movq %rdi, 0x8(%rsp)
leaq 0x250e(%rip), %rdi      # 0x6606
callq 0x2030
testq %rax, %rax
je 0x412c
movq %rax, %r14
xorl %ebx, %ebx
leaq 0x4cb2(%rip), %r15      # 0x8dc0
movq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x2060
testl %eax, %eax
je 0x4956
addq $0x8, %rbx
cmpq $0x10, %rbx
jne 0x410e
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x49c7
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x4946
cmpb $0x0, 0x7103(%rip)      # 0xb254
jne 0x4166
leaq 0xbe1(%rip), %rdi       # 0x4d3b
callq 0x5790
movb $0x1, 0x70ee(%rip)      # 0xb254
leaq 0x70eb(%rip), %rsi      # 0xb258
xorl %edi, %edi
callq 0x2260
cmpl $-0x1, %eax
je 0x4946
movups 0x70d4(%rip), %xmm0     # 0xb258
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movups 0x70d5(%rip), %xmm0     # 0xb268
movaps %xmm0, 0x10(%rdx)
movups 0x70e6(%rip), %xmm0     # 0xb284
movups %xmm0, 0x2c(%rdx)
movups 0x70cf(%rip), %xmm0     # 0xb278
andl $0xfffffacd, (%rdx)     # imm = 0xFFFFFACD
movaps %xmm0, 0x20(%rdx)
andb $-0x2, 0x4(%rdx)
orb $0x30, 0x8(%rdx)
andl $0xffff7ff4, 0xc(%rdx)  # imm = 0xFFFF7FF4
movw $0x100, 0x16(%rdx)      # imm = 0x100
xorl %edi, %edi
movl $0x2, %esi
callq 0x2270
testl %eax, %eax
js 0x4946
movb $0x1, 0x70b1(%rip)      # 0xb294
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2110
movq %rax, %r12
leaq 0x40(%rsp), %r14
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2170
cmpl $-0x1, %eax
movzwl 0x2(%r14), %eax
movl $0x50, %r15d
cmovneq %rax, %r15
movb $0x0, (%r14)
leaq 0x233e(%rip), %rdi      # 0x6567
callq 0x4af2
movl $0x1, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x4a4c
movq %r12, 0x38(%rsp)
leaq 0x5(%rsp), %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movl $0x0, 0x14(%rsp)
movq %rax, 0x18(%rsp)
movl $0x1, %edx
xorl %edi, %edi
movq %r14, %rsi
callq 0x21a0
testl %eax, %eax
jle 0x4562
cmpb $0x9, 0x5(%rsp)
sete %cl
movq 0x6fbe(%rip), %rax      # 0xb248
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x441c
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movb $0x0, 0x6(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq *%rax
cmpq $0x0, 0x20(%rsp)
je 0x43cd
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq 0x20(%rsp), %r14
jae 0x42ed
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %r13
movq %r13, %rdi
callq 0x2110
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rax, %rcx
jmp 0x42fd
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
movl $0x1, %edx
xorl %edi, %edi
leaq 0x6(%rsp), %rsi
callq 0x21a0
testl %eax, %eax
jle 0x43fa
movzbl 0x6(%rsp), %eax
cmpl $0x1b, %eax
je 0x4369
cmpl $0x9, %eax
jne 0x438f
incq %r14
movq 0x20(%rsp), %rcx
leaq 0x1(%rcx), %rsi
movq %r14, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r14
cmpq %rcx, %rdx
jne 0x43c2
movq 0x4ca0(%rip), %r13      # 0x8ff0
movq (%r13), %rsi
movl $0x7, %edi
callq 0x2190
movq (%r13), %rdi
callq 0x2210
jmp 0x43c2
movl $0x1, %ebx
cmpq 0x20(%rsp), %r14
jae 0x43c2
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
jmp 0x43c2
movl $0x1, %ebx
cmpq 0x20(%rsp), %r14
jae 0x43c2
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %rcx
movl $0xfff, %esi            # imm = 0xFFF
leaq 0x40(%rsp), %rdi
leaq 0x2169(%rip), %rdx      # 0x651e
xorl %eax, %eax
callq 0x2140
movslq %eax, %rbp
movq %rbp, %r12
testq %rbx, %rbx
je 0x42c5
jmp 0x43e9
movq 0x4c1c(%rip), %rbx      # 0x8ff0
movq (%rbx), %rsi
movl $0x7, %edi
callq 0x2190
movq (%rbx), %rdi
callq 0x2210
leaq 0x20(%rsp), %rdi
callq 0x4ee7
movsbl 0x6(%rsp), %eax
jmp 0x4409
leaq 0x20(%rsp), %rdi
callq 0x4ee7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movb %al, 0x5(%rsp)
testl %eax, %eax
leaq 0x5(%rsp), %r14
js 0x4562
je 0x4459
movb 0x5(%rsp), %bl
movzbl %bl, %eax
leal -0x1(%rax), %ecx
cmpl $0x1a, %ecx
ja 0x4464
leaq 0x215e(%rip), %rdx      # 0x6590
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x4db3
jmp 0x47aa
movl $0x2, %r13d
jmp 0x4570
cmpl $0x7f, %eax
jne 0x44aa
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x4570
testq %r12, %r12
je 0x4570
leaq (%rsp,%rbp), %rsi
addq $0x40, %rsi
leaq (%rsp,%rbp), %rdi
addq $0x3f, %rdi
movq %r12, %rdx
subq %rbp, %rdx
callq 0x2250
decq %rbp
movb $0x0, 0x3f(%rsp,%r12)
decq %r12
jmp 0x47f7
xorl %r13d, %r13d
cmpq $0xffe, %r12            # imm = 0xFFE
ja 0x4570
movq %r12, %rdx
subq %rbp, %rdx
jne 0x4814
movb %bl, 0x40(%rsp,%rbp)
incq %rbp
leaq 0x1(%r12), %r14
movb $0x0, 0x41(%rsp,%r12)
movq 0x38(%rsp), %rax
addq %r12, %rax
incq %rax
cmpq %r15, %rax
jae 0x4921
movl $0x1, %edx
xorl %edi, %edi
leaq 0x5(%rsp), %rbx
movq %rbx, %rsi
callq 0x20f0
xorl %r13d, %r13d
cmpq $-0x1, %rax
sete %r13b
movq 0x18(%rsp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovel %ecx, %eax
movq %rax, 0x18(%rsp)
movq %r14, %r12
movq %rbx, %r14
jmp 0x4570
xorl %r13d, %r13d
movl $0x7, %edx
xorl %edi, %edi
leaq 0x20c6(%rip), %rsi      # 0x65fc
callq 0x20f0
jmp 0x47f7
movslq 0x6d09(%rip), %rax      # 0xb250
leaq -0x1(%rax), %rcx
movl %ecx, 0x6cff(%rip)      # 0xb250
movq 0x6ce8(%rip), %rcx      # 0xb240
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
movl $0x1, %r13d
movl %r12d, %eax
movq %rax, 0x18(%rsp)
testb $0x1, %r13b
je 0x4264
jmp 0x4a41
callq 0x2070
movl $0xb, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x18(%rsp)
movl $0x1, %r13d
jmp 0x4570
movb $0x0, 0x40(%rsp,%rbp)
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
xorl %r13d, %r13d
jmp 0x4755
cmpq $0x2, %r12
jb 0x47b2
leaq -0x1(%r12), %r14
cmpq %r14, %rbp
jae 0x47b2
leaq (%rsp,%rbp), %rdi
addq $0x40, %rdi
leaq (%rsp,%rbp), %rsi
addq $0x41, %rsi
movq %r12, %rdx
subq %rbp, %rdx
callq 0x2250
movb $0x0, 0x3f(%rsp,%r12)
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
xorl %r13d, %r13d
jmp 0x4939
movb $0x42, %al
jmp 0x468f
xorl %r13d, %r13d
movl $0x2, %edx
xorl %edi, %edi
leaq 0x20(%rsp), %rsi
callq 0x21a0
cmpq $-0x1, %rax
je 0x4570
movb 0x20(%rsp), %al
movb 0x21(%rsp), %bl
movl %eax, %ecx
xorb $0x5b, %cl
movl %ebx, %edx
xorb $0x44, %dl
orb %cl, %dl
jne 0x47db
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x4570
decq %rbp
jmp 0x47f7
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x4db3
xorl %r13d, %r13d
movq %r12, %rbp
jmp 0x4570
movb $0x41, %al
movb %al, 0x21(%rsp)
movl 0x6bb7(%rip), %ebx      # 0xb250
cmpl $0x2, %ebx
jl 0x47aa
movq 0x6b97(%rip), %rax      # 0xb240
movl 0x14(%rsp), %r14d
movl %r14d, %ecx
notl %ecx
addl %ebx, %ecx
movslq %ecx, %r13
movq (%rax,%r13,8), %rdi
callq 0x2040
leaq 0x40(%rsp), %rdi
callq 0x22c0
movq 0x6b6e(%rip), %rcx      # 0xb240
movq %rax, (%rcx,%r13,8)
xorl %eax, %eax
cmpb $0x41, 0x21(%rsp)
sete %al
leal -0x1(,%rax,2), %eax
xorl %r13d, %r13d
addl %eax, %r14d
js 0x47c3
movl %r14d, %ecx
cmpl %ebx, %r14d
leaq 0x5(%rsp), %r14
jge 0x47d0
movq 0x6b35(%rip), %rax      # 0xb240
movl %ecx, 0x14(%rsp)
notl %ecx
addl %ecx, %ebx
movslq %ebx, %rcx
movq (%rax,%rcx,8), %rsi
movl $0xfff, %edx            # imm = 0xFFF
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x2080
movb $0x0, 0x103f(%rsp)
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %rax, %rcx
movq %r15, %r8
callq 0x4db3
movq %rbp, %r12
jmp 0x4570
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x4570
cmpq %rbp, %r12
jbe 0x4570
rolw $0x8, 0x3f(%rsp,%rbp)
leaq -0x1(%r12), %rax
xorl %ecx, %ecx
cmpq %rax, %rbp
setne %cl
addq %rcx, %rbp
jmp 0x47f7
movb $0x0, 0x40(%rsp)
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x4db3
xorl %r12d, %r12d
xorl %r13d, %r13d
jmp 0x4570
testq %r12, %r12
je 0x4854
xorl %r13d, %r13d
jmp 0x493c
movl $0x0, 0x14(%rsp)
jmp 0x493c
decl %ebx
movl %ebx, 0x14(%rsp)
jmp 0x4570
movl %ebx, %edx
xorb $0x43, %dl
orb %dl, %cl
jne 0x488b
xorl %r13d, %r13d
cmpq %rbp, %r12
je 0x4570
incq %rbp
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
jmp 0x4570
leaq (%rsp,%rbp), %r14
addq $0x40, %r14
leaq 0x1(%r14), %rdi
movq %r14, %rsi
callq 0x2250
movb %bl, (%r14)
incq %rbp
movb $0x0, 0x41(%rsp,%r12)
incq %r12
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
jmp 0x493c
movslq 0x69f5(%rip), %rax      # 0xb250
leaq -0x1(%rax), %rcx
movl %ecx, 0x69eb(%rip)      # 0xb250
movq 0x69d4(%rip), %rcx      # 0xb240
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x18(%rsp)
movl $0x1, %r13d
jmp 0x493c
cmpb $0x5b, %al
sete %cl
leal -0x41(%rbx), %edx
cmpb $0x2, %dl
setb %dl
testb %dl, %cl
jne 0x4693
cmpb $0x5b, %al
sete %al
leal -0x31(%rbx), %ecx
cmpb $0x6, %cl
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4570
xorl %r13d, %r13d
movl $0x2, %edx
xorl %edi, %edi
leaq 0x6(%rsp), %rsi
callq 0x21a0
cmpq $-0x1, %rax
je 0x4570
cmpb $0x33, %bl
jne 0x4570
cmpb $0x7e, 0x6(%rsp)
jne 0x4570
testq %r12, %r12
je 0x4570
cmpq %rbp, %r12
jbe 0x4570
leaq (%rsp,%rbp), %rdi
addq $0x40, %rdi
leaq (%rsp,%rbp), %rsi
addq $0x41, %rsi
movq %rbp, %rdx
notq %rdx
addq %r12, %rdx
callq 0x2250
jmp 0x449c
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4db3
movq %r14, %r12
leaq 0x5(%rsp), %r14
jmp 0x4570
callq 0x2070
movl $0x19, (%rax)
jmp 0x4a10
leaq 0x1bc1(%rip), %rdi      # 0x651e
xorl %r14d, %r14d
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x2130
movq 0x4655(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
callq 0x2210
movq 0x464e(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x40(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21b0
testq %rax, %rax
je 0x4a2c
leaq 0x40(%rsp), %rdi
callq 0x2110
testq %rax, %rax
je 0x4a1a
movzbl 0x3f(%rsp,%rax), %ecx
cmpl $0xd, %ecx
je 0x49bb
cmpl $0xa, %ecx
jne 0x4a1a
movb $0x0, 0x3f(%rsp,%rax)
decq %rax
jne 0x49ac
jmp 0x4a1a
movq 0x4602(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x40(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21b0
testq %rax, %rax
je 0x4a10
leaq 0x40(%rsp), %rdi
callq 0x2110
movq %rax, %rbx
testl %ebx, %ebx
je 0x4a48
movl %ebx, %eax
decl %eax
cltq
cmpb $0xa, 0x40(%rsp,%rax)
jne 0x4a15
movslq %ebx, %rbx
movb $0x0, 0x3f(%rsp,%rbx)
decq %rbx
jmp 0x4a15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %ebx
je 0x4a29
leaq 0x40(%rsp), %rdi
callq 0x22c0
movq %rax, %r14
jmp 0x4a2c
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rbx
jmp 0x4a51
xorl %ebx, %ebx
jmp 0x4a15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, 0x683c(%rip)      # 0xb294
jne 0x4a79
leaq 0x67f7(%rip), %rdx      # 0xb258
xorl %edi, %edi
movl $0x2, %esi
callq 0x2270
cmpl $-0x1, %eax
je 0x4a79
movb $0x0, 0x681b(%rip)      # 0xb294
movl $0xa, %edi
callq 0x2050
jmp 0x4a15