// File: /workspace/github_c_makefile_star2_O2/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 $0x1058, %rsp           # imm = 0x1058
movq %rdi, %rbx
leaq 0x2766(%rip), %rdi      # 0x65d6
callq 0x2030
testq %rax, %rax
je 0x3f22
movq %rax, %r14
xorl %r15d, %r15d
leaq 0x4f35(%rip), %r12      # 0x8dc0
cmpq $0x10, %r15
je 0x3f22
movq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2060
addq $0x8, %r15
testl %eax, %eax
jne 0x3e8b
leaq 0x25ea(%rip), %rdi      # 0x649a
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x5104(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
callq 0x2200
movq 0x50fd(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x50(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
testq %rax, %rax
je 0x4765
leaq 0x50(%rsp), %rdi
callq 0x2110
movq %rax, %rcx
subq $0x1, %rcx
jb 0x4753
movzbl 0x4f(%rsp,%rax), %edx
cmpl $0xd, %edx
je 0x3f18
cmpl $0xa, %edx
jne 0x4753
movb $0x0, 0x4f(%rsp,%rax)
movq %rcx, %rax
jmp 0x3efb
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x46a0
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x4690
cmpb $0x0, 0x72fd(%rip)      # 0xb244
jne 0x3f5c
leaq 0xad5(%rip), %rdi       # 0x4a25
callq 0x5390
movb $0x1, 0x72e8(%rip)      # 0xb244
leaq 0x72e5(%rip), %rsi      # 0xb248
xorl %edi, %edi
callq 0x2250
cmpl $-0x1, %eax
je 0x4690
movups 0x72ce(%rip), %xmm0     # 0xb248
leaq 0x50(%rsp), %rdx
movaps %xmm0, (%rdx)
movups 0x72cf(%rip), %xmm0     # 0xb258
movaps %xmm0, 0x10(%rdx)
movups 0x72e0(%rip), %xmm0     # 0xb274
movups %xmm0, 0x2c(%rdx)
movups 0x72c9(%rip), %xmm0     # 0xb268
movaps %xmm0, 0x20(%rdx)
movaps (%rdx), %xmm0
movaps 0x2583(%rip), %xmm1     # 0x6530
andps %xmm0, %xmm1
orps 0x2589(%rip), %xmm0     # 0x6540
shufps $0x32, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[3,0]
shufps $0x84, %xmm0, %xmm1     # xmm1 = xmm1[0,1],xmm0[0,2]
movaps %xmm1, (%rdx)
movw $0x100, 0x16(%rdx)      # imm = 0x100
pushq $0x2
popq %rsi
xorl %edi, %edi
callq 0x2260
testl %eax, %eax
js 0x4690
movb $0x1, 0x72a3(%rip)      # 0xb284
movq %rbx, %rdi
callq 0x2110
movq %rax, %r15
movq $0x0, 0x38(%rsp)
pushq $0x1
popq %rbp
leaq 0x50(%rsp), %r14
movl $0x5413, %esi           # imm = 0x5413
movl %ebp, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2160
cmpl $-0x1, %eax
movzwl 0x2(%r14), %eax
pushq $0x50
popq %r12
cmovneq %rax, %r12
movb $0x0, (%r14)
leaq 0x24f9(%rip), %rdi      # 0x6522
callq 0x47e7
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x473c
movq %r15, 0x40(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
xorl %edi, %edi
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2190
testl %eax, %eax
jle 0x4718
movb 0xf(%rsp), %bpl
cmpb $0x9, %bpl
sete %cl
movq 0x71b8(%rip), %rax      # 0xb238
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4211
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movb $0x0, 0x1b(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq *%rax
cmpq $0x0, 0x20(%rsp)
je 0x41c8
movb $0x1, %r13b
xorl %ebp, %ebp
xorl %r14d, %r14d
testb $0x1, %r13b
je 0x41d1
cmpq 0x20(%rsp), %r14
jae 0x40ee
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %rbp
movq %rbp, %rdi
callq 0x2110
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %rax, %rcx
jmp 0x40fe
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x4a77
xorl %edi, %edi
leaq 0x1b(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2190
testl %eax, %eax
jle 0x41d7
movzbl 0x1b(%rsp), %ebp
cmpl $0x1b, %ebp
je 0x4167
cmpl $0x9, %ebp
je 0x4195
xorl %r13d, %r13d
cmpq 0x20(%rsp), %r14
jae 0x40be
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %rcx
xorl %r13d, %r13d
movl $0xfff, %esi            # imm = 0xFFF
leaq 0x50(%rsp), %rdi
leaq 0x2347(%rip), %rdx      # 0x649a
xorl %eax, %eax
callq 0x2140
movslq %eax, %r15
movq %r15, 0x10(%rsp)
jmp 0x40be
xorl %r13d, %r13d
cmpq 0x20(%rsp), %r14
jae 0x40be
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x4a77
xorl %r13d, %r13d
jmp 0x40be
incq %r14
movq 0x20(%rsp), %rsi
leaq 0x1(%rsi), %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movb $0x1, %r13b
movq %rdx, %r14
cmpq %rsi, %rdx
jne 0x40be
movq %rsi, %r14
callq 0x4b90
movb $0x1, %r13b
jmp 0x40be
callq 0x4b90
xorl %ebp, %ebp
jmp 0x41dc
movsbl %bpl, %ebp
jmp 0x41dc
pushq $-0x1
popq %rax
movl %eax, %ebp
xorl %r14d, %r14d
movq 0x28(%rsp), %rdi
cmpq 0x20(%rsp), %r14
jae 0x41f9
movq (%rdi,%r14,8), %rdi
callq 0x2040
incq %r14
jmp 0x41df
callq 0x2040
movb %bpl, 0xf(%rsp)
testl %ebp, %ebp
js 0x4718
je 0x4584
movzbl %bpl, %eax
leal -0x1(%rax), %ecx
cmpl $0x1a, %ecx
ja 0x4247
leaq 0x233c(%rip), %rdx      # 0x6560
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x4a77
jmp 0x43bd
cmpl $0x7f, %eax
jne 0x428f
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x4584
testq %r15, %r15
je 0x4584
leaq (%rsp,%r14), %rsi
addq $0x50, %rsi
leaq (%rsp,%r14), %rdi
addq $0x4f, %rdi
movq %r15, %rdx
subq %r14, %rdx
callq 0x2240
decq %r14
movb $0x0, 0x4f(%rsp,%r15)
decq %r15
jmp 0x4569
cmpq $0xffe, %r15            # imm = 0xFFE
ja 0x4584
movq %r15, %rdx
movq 0x10(%rsp), %r13
subq %r13, %rdx
jne 0x458f
movb %bpl, 0x50(%rsp,%r13)
leaq 0x1(%r13), %r14
movb $0x0, 0x51(%rsp,%r13)
movq 0x40(%rsp), %rax
addq %r13, %rax
incq %rax
cmpq %r12, %rax
jae 0x4670
xorl %edi, %edi
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x20f0
movq %r14, 0x10(%rsp)
cmpq $-0x1, %rax
jne 0x4587
jmp 0x473c
movq 0x10(%rsp), %r14
movb $0x0, 0x50(%rsp,%r14)
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r14, %rdx
movq %r14, %rcx
movq %r12, %r8
callq 0x4a77
jmp 0x4587
movb $0x42, %r14b
jmp 0x4469
cmpq $0x2, %r15
jb 0x452b
leaq -0x1(%r15), %r14
movq 0x10(%rsp), %r13
cmpq %r14, %r13
jae 0x4584
leaq (%rsp,%r13), %rdi
addq $0x50, %rdi
leaq (%rsp,%r13), %rsi
addq $0x51, %rsi
movq %r15, %rdx
subq %r13, %rdx
callq 0x2240
movb $0x0, 0x4f(%rsp,%r15)
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r14, %rdx
movq %r13, %rcx
jmp 0x430c
xorl %edi, %edi
leaq 0x1c(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x2190
cmpq $-0x1, %rax
je 0x4584
movb 0x1c(%rsp), %al
movb 0x1d(%rsp), %r14b
movl %eax, %ecx
xorb $0x5b, %cl
movl %r14d, %edx
xorb $0x44, %dl
orb %cl, %dl
jne 0x4552
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x43bd
decq %rcx
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
jmp 0x4459
movq $0x0, 0x10(%rsp)
jmp 0x4584
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq %r15, %rcx
jmp 0x451c
movb $0x0, 0x50(%rsp)
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x4a77
movq $0x0, 0x10(%rsp)
xorl %r14d, %r14d
jmp 0x4587
callq 0x3e44
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
jmp 0x457c
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x4584
cmpq %rdx, %r15
jbe 0x4584
rolw $0x8, 0x4f(%rsp,%rdx)
leaq -0x1(%r15), %rax
xorl %ecx, %ecx
cmpq %rax, %rdx
setne %cl
addq %rcx, %rdx
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %rdx, %rcx
movq %r15, %rdx
movq %rcx, 0x10(%rsp)
jmp 0x457c
movb $0x41, %r14b
movb %r14b, 0x1d(%rsp)
movl 0x6dcc(%rip), %ebp      # 0xb240
cmpl $0x2, %ebp
jl 0x4584
movq 0x6dac(%rip), %rax      # 0xb230
movq 0x38(%rsp), %rcx
movq %r14, 0x48(%rsp)
movq %rcx, %r14
notl %ecx
addl %ebp, %ecx
movslq %ecx, %r13
movq (%rax,%r13,8), %rdi
callq 0x2040
leaq 0x50(%rsp), %rdi
callq 0x22b0
movq 0x6d7e(%rip), %rcx      # 0xb230
movq %rax, (%rcx,%r13,8)
xorl %eax, %eax
cmpb $0x41, 0x48(%rsp)
sete %al
leal -0x1(,%rax,2), %eax
addl %eax, %r14d
js 0x4539
cmpl %ebp, %r14d
jae 0x4544
movq 0x6d58(%rip), %rax      # 0xb230
movq %r14, 0x38(%rsp)
movl %r14d, %ecx
notl %ecx
addl %ecx, %ebp
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rsi
movl $0xfff, %edx            # imm = 0xFFF
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movb $0x0, 0x104f(%rsp)
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %rax, %rcx
movq %r12, %r8
callq 0x4a77
movq %r15, 0x10(%rsp)
jmp 0x4584
pushq $0x1
popq %r14
testq %r15, %r15
jne 0x4587
jmp 0x471a
movq $0x0, 0x38(%rsp)
jmp 0x4584
decl %ebp
movq %r15, %r14
movl %ebp, %eax
movq %rax, 0x38(%rsp)
jmp 0x4587
movl %r14d, %edx
xorb $0x43, %dl
orb %dl, %cl
jne 0x45c7
movq 0x10(%rsp), %r14
cmpq %r14, %r15
je 0x4587
incq %r14
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq %r14, 0x10(%rsp)
movq %r14, %rcx
movq %r12, %r8
callq 0x4a77
movq %r15, %r14
movq %r14, %r15
jmp 0x4056
leaq (%rsp,%r13), %r14
addq $0x50, %r14
leaq 0x1(%r14), %rdi
movq %r14, %rsi
callq 0x2240
movb %bpl, (%r14)
incq %r13
movb $0x0, 0x51(%rsp,%r15)
incq %r15
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
movq %r13, 0x10(%rsp)
movq %r13, %rcx
jmp 0x457c
cmpb $0x5b, %al
sete %cl
leal -0x41(%r14), %edx
cmpb $0x2, %dl
setb %dl
testb %dl, %cl
jne 0x446e
cmpb $0x5b, %al
sete %al
leal -0x31(%r14), %ecx
cmpb $0x6, %cl
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4584
xorl %edi, %edi
leaq 0x1e(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x2190
cmpq $-0x1, %rax
je 0x4584
cmpb $0x33, %r14b
jne 0x4584
cmpb $0x7e, 0x1e(%rsp)
movq 0x10(%rsp), %r14
jne 0x4584
testq %r15, %r15
je 0x4584
cmpq %r14, %r15
jbe 0x4584
leaq (%rsp,%r14), %rdi
addq $0x50, %rdi
leaq (%rsp,%r14), %rsi
addq $0x51, %rsi
movq %r14, %rdx
notq %rdx
addq %r15, %rdx
callq 0x2240
movb $0x0, 0x4f(%rsp,%r15)
decq %r15
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
jmp 0x4579
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
movq %r14, %rdx
movq %r14, %rcx
movq %r12, %r8
callq 0x4a77
movq %r14, 0x10(%rsp)
jmp 0x4587
callq 0x2070
movl $0x19, (%rax)
jmp 0x4762
movq 0x4929(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x50(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
testq %rax, %rax
je 0x4762
leaq 0x50(%rsp), %rdi
callq 0x2110
movq %rax, %r15
testl %r15d, %r15d
je 0x4753
movl %r15d, %eax
decl %eax
cltq
cmpb $0xa, 0x50(%rsp,%rax)
jne 0x474d
movb $0x0, 0x50(%rsp,%rax)
jmp 0x4753
callq 0x2070
movl $0xb, (%rax)
jmp 0x473c
movslq 0x6b43(%rip), %rax      # 0xb240
leaq -0x1(%rax), %rcx
movl %ecx, 0x6b39(%rip)      # 0xb240
movq 0x6b22(%rip), %rcx      # 0xb230
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
jmp 0x4740
movslq 0x6b1f(%rip), %rax      # 0xb240
leaq -0x1(%rax), %rcx
movl %ecx, 0x6b15(%rip)      # 0xb240
movq 0x6afe(%rip), %rcx      # 0xb230
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
pushq $-0x1
popq %r15
callq 0x49f8
pushq $0xa
popq %rdi
callq 0x2050
cmpl $-0x1, %r15d
je 0x4762
leaq 0x50(%rsp), %rdi
callq 0x22b0
movq %rax, %r14
jmp 0x4765
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq