// File: /workspace/github_c_makefile_star2_O3/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, %rbx
leaq 0x2604(%rip), %rdi      # 0x6666
callq 0x2030
testq %rax, %rax
je 0x4097
movq %rax, %r14
xorl %r15d, %r15d
leaq 0x4d47(%rip), %r12      # 0x8dc0
movq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2060
testl %eax, %eax
je 0x47aa
addq $0x8, %r15
cmpq $0x10, %r15
jne 0x4079
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x4824
xorl %edi, %edi
callq 0x20c0
testl %eax, %eax
je 0x479a
cmpb $0x0, 0x7188(%rip)      # 0xb244
jne 0x40d1
leaq 0xb01(%rip), %rdi       # 0x4bc6
callq 0x55b0
movb $0x1, 0x7173(%rip)      # 0xb244
leaq 0x7170(%rip), %rsi      # 0xb248
xorl %edi, %edi
callq 0x2250
cmpl $-0x1, %eax
je 0x479a
movups 0x7159(%rip), %xmm0     # 0xb248
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movups 0x715a(%rip), %xmm0     # 0xb258
movaps %xmm0, 0x10(%rdx)
movups 0x716b(%rip), %xmm0     # 0xb274
movups %xmm0, 0x2c(%rdx)
movups 0x7154(%rip), %xmm0     # 0xb268
movaps %xmm0, 0x20(%rdx)
movaps (%rdx), %xmm0
movaps 0x249e(%rip), %xmm1     # 0x65c0
andps %xmm0, %xmm1
orps 0x24a4(%rip), %xmm0     # 0x65d0
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
xorl %edi, %edi
movl $0x2, %esi
callq 0x2260
testl %eax, %eax
js 0x479a
movb $0x1, 0x712c(%rip)      # 0xb284
movq %rbx, %rdi
callq 0x2110
movq %rax, %r12
xorl %ebp, %ebp
leaq 0x40(%rsp), %r14
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2160
cmpl $-0x1, %eax
movzwl 0x2(%r14), %eax
movl $0x50, %r15d
cmovneq %rax, %r15
movb $0x0, (%r14)
leaq 0x240b(%rip), %rdi      # 0x65a6
callq 0x4999
movl $0x1, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x20f0
cmpq $-0x1, %rax
je 0x48c9
leaq 0x4(%rsp), %rsi
movl $0x1, %edx
xorl %edi, %edi
callq 0x2190
testl %eax, %eax
jle 0x48ce
movq %r12, 0x28(%rsp)
movl $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movb 0x4(%rsp), %r13b
cmpb $0x9, %r13b
sete %cl
movq 0x7040(%rip), %rax      # 0xb238
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x43a2
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movb $0x0, 0x5(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x4301
xorl %r13d, %r13d
cmpq %rax, %r13
jae 0x4257
movq 0x18(%rsp), %rax
movq (%rax,%r13,8), %r14
movq %r14, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %rax, %rcx
jmp 0x4265
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x4c40
movl $0x1, %edx
xorl %edi, %edi
leaq 0x5(%rsp), %rsi
callq 0x2190
testl %eax, %eax
jle 0x4322
movzbl 0x5(%rsp), %r14d
cmpl $0x9, %r14d
jne 0x42dc
incq %r13
movq 0x10(%rsp), %r14
leaq 0x1(%r14), %rcx
movq %r13, %rax
xorl %edx, %edx
divq %rcx
movq %r14, %rax
movq %rdx, %r13
cmpq %r14, %rdx
jne 0x4233
movq 0x4d38(%rip), %r13      # 0x8ff0
movq (%r13), %rsi
movl $0x7, %edi
callq 0x2180
movq (%r13), %rdi
callq 0x2200
movq 0x10(%rsp), %rax
movq %r14, %r13
jmp 0x4233
cmpl $0x1b, %r14d
jne 0x432a
cmpq 0x10(%rsp), %r13
jae 0x4358
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x4c40
jmp 0x4358
movq 0x4ce8(%rip), %r14      # 0x8ff0
movq (%r14), %rsi
movl $0x7, %edi
callq 0x2180
movq (%r14), %rdi
callq 0x2200
xorl %r13d, %r13d
jmp 0x435c
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x435c
cmpq 0x10(%rsp), %r13
jae 0x4358
movq 0x18(%rsp), %rax
movq (%rax,%r13,8), %rcx
movl $0xfff, %esi            # imm = 0xFFF
leaq 0x40(%rsp), %rdi
leaq 0x21d3(%rip), %rdx      # 0x651e
xorl %eax, %eax
callq 0x2140
movslq %eax, %r12
movq %r12, %rbp
movsbl %r14b, %r13d
cmpq $0x0, 0x10(%rsp)
je 0x437f
xorl %r14d, %r14d
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %rdi
callq 0x2040
incq %r14
cmpq 0x10(%rsp), %r14
jb 0x4367
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x438e
callq 0x2040
movb %r13b, 0x4(%rsp)
testl %r13d, %r13d
js 0x48ce
je 0x46fe
movzbl %r13b, %eax
leal -0x1(%rax), %ecx
cmpl $0x1a, %ecx
ja 0x43d8
leaq 0x223b(%rip), %rdx      # 0x65f0
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x4c40
jmp 0x44f9
cmpl $0x7f, %eax
jne 0x441a
testq %r12, %r12
je 0x46fe
testq %rbp, %rbp
je 0x46fe
leaq (%rsp,%r12), %rsi
addq $0x40, %rsi
leaq (%rsp,%r12), %rdi
addq $0x3f, %rdi
movq %rbp, %rdx
subq %r12, %rdx
callq 0x2240
decq %r12
movb $0x0, 0x3f(%rsp,%rbp)
decq %rbp
jmp 0x46e8
cmpq $0xffe, %rbp            # imm = 0xFFE
ja 0x46fe
movq %rbp, %rdx
subq %r12, %rdx
jne 0x46c6
movb %r13b, 0x40(%rsp,%r12)
leaq 0x1(%r12), %rbp
movb $0x0, 0x41(%rsp,%r12)
movq 0x28(%rsp), %rax
addq %r12, %rax
incq %rax
cmpq %r15, %rax
jae 0x4476
movl $0x1, %edx
xorl %edi, %edi
leaq 0x4(%rsp), %rsi
callq 0x20f0
movq %rbp, %r12
cmpq $-0x1, %rax
jne 0x46fe
jmp 0x48c9
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x4c40
movq %rbp, %r12
jmp 0x46fe
movb $0x0, 0x40(%rsp,%r12)
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
movq %r12, %rcx
jmp 0x4680
movb $0x42, %r14b
jmp 0x45c1
movl $0x2, %edx
xorl %edi, %edi
leaq 0x6(%rsp), %rsi
callq 0x2190
cmpq $-0x1, %rax
je 0x46fe
movb 0x6(%rsp), %al
movb 0x7(%rsp), %r14b
movl %eax, %ecx
xorb $0x5b, %cl
movl %r14d, %edx
xorb $0x44, %dl
orb %cl, %dl
jne 0x46ad
testq %r12, %r12
je 0x44f9
decq %r12
jmp 0x46e8
xorl %r12d, %r12d
jmp 0x46fe
cmpq $0x2, %rbp
jb 0x468a
leaq -0x1(%rbp), %r13
cmpq %r13, %r12
jae 0x46fe
leaq (%rsp,%r12), %rdi
addq $0x40, %rdi
leaq (%rsp,%r12), %rsi
addq $0x41, %rsi
movq %rbp, %rdx
subq %r12, %rdx
callq 0x2240
movb $0x0, 0x3f(%rsp,%rbp)
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x4c40
movq %r13, %rbp
jmp 0x46fe
movb $0x0, 0x40(%rsp)
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x4c40
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0x46fe
movl $0x7, %edx
xorl %edi, %edi
leaq 0x20d5(%rip), %rsi      # 0x665c
callq 0x20f0
jmp 0x46e8
testq %r12, %r12
je 0x46fe
cmpq %r12, %rbp
jbe 0x46fe
rolw $0x8, 0x3f(%rsp,%r12)
leaq -0x1(%rbp), %rax
xorl %ecx, %ecx
cmpq %rax, %r12
setne %cl
addq %rcx, %r12
jmp 0x46e8
movb $0x41, %r14b
movb %r14b, 0x7(%rsp)
movl 0x6c73(%rip), %r13d     # 0xb240
cmpl $0x2, %r13d
jl 0x46fe
movq 0x6c52(%rip), %rax      # 0xb230
movq %r14, 0x38(%rsp)
movl 0x8(%rsp), %r14d
movl %r14d, %ecx
notl %ecx
addl %r13d, %ecx
movslq %ecx, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax,%rcx,8), %rdi
callq 0x2040
leaq 0x40(%rsp), %rdi
callq 0x22b0
movq 0x6c1e(%rip), %rcx      # 0xb230
movq 0x30(%rsp), %rdx
movq %rax, (%rcx,%rdx,8)
xorl %eax, %eax
cmpb $0x41, 0x38(%rsp)
sete %al
leal -0x1(,%rax,2), %eax
addl %eax, %r14d
js 0x4699
cmpl %r13d, %r14d
jae 0x46a3
movq 0x6bf3(%rip), %rax      # 0xb230
movl %r14d, 0x8(%rsp)
notl %r14d
addl %r14d, %r13d
movslq %r13d, %rcx
movq (%rax,%rcx,8), %rsi
movl $0xfff, %edx            # imm = 0xFFF
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movb $0x0, 0x103f(%rsp)
movq %r14, %rdi
callq 0x2110
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %rax, %rcx
movq %r15, %r8
callq 0x4c40
jmp 0x46bc
testq %rbp, %rbp
movl $0x1, %ebp
jne 0x46fe
jmp 0x48a7
movl $0x0, 0x8(%rsp)
jmp 0x46fe
decl %r13d
movl %r13d, 0x8(%rsp)
jmp 0x46fe
movl %r14d, %edx
xorb $0x43, %dl
orb %dl, %cl
jne 0x471c
cmpq %r12, %rbp
jne 0x46c1
movq %r12, %rbp
jmp 0x46fe
incq %r12
jmp 0x46e8
leaq (%rsp,%r12), %r14
addq $0x40, %r14
leaq 0x1(%r14), %rdi
movq %r14, %rsi
callq 0x2240
movb %r13b, (%r14)
incq %r12
movb $0x0, 0x41(%rsp,%rbp)
incq %rbp
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x4c40
movl $0x1, %edx
xorl %edi, %edi
leaq 0x4(%rsp), %rsi
callq 0x2190
testl %eax, %eax
jg 0x41e5
jmp 0x48ce
cmpb $0x5b, %al
sete %cl
leal -0x41(%r14), %edx
cmpb $0x2, %dl
setb %dl
testb %dl, %cl
jne 0x45c6
cmpb $0x5b, %al
sete %al
leal -0x31(%r14), %ecx
cmpb $0x6, %cl
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x46fe
movl $0x2, %edx
xorl %edi, %edi
leaq 0xe(%rsp), %rsi
callq 0x2190
cmpq $-0x1, %rax
je 0x46fe
cmpb $0x33, %r14b
jne 0x46fe
cmpb $0x7e, 0xe(%rsp)
jne 0x46fe
testq %rbp, %rbp
je 0x46fe
cmpq %r12, %rbp
jbe 0x46fe
leaq (%rsp,%r12), %rdi
addq $0x40, %rdi
leaq (%rsp,%r12), %rsi
addq $0x41, %rsi
movq %r12, %rdx
notq %rdx
addq %rbp, %rdx
callq 0x2240
jmp 0x440d
callq 0x2070
movl $0x19, (%rax)
jmp 0x4914
leaq 0x1d6d(%rip), %rdi      # 0x651e
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x4803(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
callq 0x2200
movq 0x47fc(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x40(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
testq %rax, %rax
je 0x4917
leaq 0x40(%rsp), %rdi
callq 0x2110
testq %rax, %rax
je 0x4905
movzbl 0x3f(%rsp,%rax), %ecx
cmpl $0xd, %ecx
je 0x4815
cmpl $0xa, %ecx
jne 0x4905
movb $0x0, 0x3f(%rsp,%rax)
decq %rax
jne 0x4802
jmp 0x4905
movq 0x47a5(%rip), %rax      # 0x8fd0
movq (%rax), %rdx
leaq 0x40(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
testq %rax, %rax
je 0x4914
leaq 0x40(%rsp), %rdi
callq 0x2110
movq %rax, %rbp
testl %ebp, %ebp
je 0x4905
movl %ebp, %eax
decl %eax
cltq
cmpb $0xa, 0x40(%rsp,%rax)
jne 0x4900
movb $0x0, 0x40(%rsp,%rax)
jmp 0x4905
movslq 0x69c3(%rip), %rax      # 0xb240
leaq -0x1(%rax), %rcx
movl %ecx, 0x69b9(%rip)      # 0xb240
movq 0x69a2(%rip), %rcx      # 0xb230
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
jmp 0x48ce
callq 0x2070
movl $0xb, (%rax)
jmp 0x48c9
movslq 0x6992(%rip), %rax      # 0xb240
leaq -0x1(%rax), %rcx
movl %ecx, 0x6988(%rip)      # 0xb240
movq 0x6971(%rip), %rcx      # 0xb230
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x1, 0x69af(%rip)      # 0xb284
jne 0x48f6
leaq 0x696a(%rip), %rdx      # 0xb248
xorl %edi, %edi
movl $0x2, %esi
callq 0x2260
cmpl $-0x1, %eax
je 0x48f6
movb $0x0, 0x698e(%rip)      # 0xb284
movl $0xa, %edi
callq 0x2050
cmpl $-0x1, %ebp
je 0x4914
leaq 0x40(%rsp), %rdi
callq 0x22b0
movq %rax, %r14
jmp 0x4917
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq