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

    if (!isatty(STDIN_FILENO)) {
        /* Not a tty: read from file / pipe. In this mode we don't want any
         * limit to the line size, so we call a function to handle that. */
        return linenoiseNoTTY();
    } else 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 $0x10a8, %rsp           # imm = 0x10A8
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2110
testl %eax, %eax
je 0x72a0
leaq 0x3790(%rip), %rdi      # 0xa8e7
callq 0x2030
testq %rax, %rax
je 0x718c
movq %rax, %r14
xorl %r15d, %r15d
leaq 0x6c42(%rip), %r12      # 0xddb0
movq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2060
testl %eax, %eax
je 0x7356
addq $0x8, %r15
cmpq $0x18, %r15
jne 0x716e
callq 0x706e
cmpl $-0x1, %eax
je 0x795b
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x1000, 0x20(%rsp)     # imm = 0x1000
movq %rbx, 0x28(%rsp)
movq %rbx, %rdi
callq 0x2190
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
leaq 0x68(%rsp), %r14
movl $0x5413, %esi           # imm = 0x5413
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2250
cmpl $-0x1, %eax
sete %cl
movzwl 0x2(%r14), %eax
testw %ax, %ax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x73dc
callq 0x7cd4
movl $0x50, %r15d
cmpl $-0x1, %eax
je 0x73e0
movl %eax, %r14d
leaq 0x36c9(%rip), %rsi      # 0xa8fe
movl $0x6, %edx
movl $0x1, %edi
callq 0x2140
cmpq $0x6, %rax
jne 0x73e0
callq 0x7cd4
cmpl $-0x1, %eax
je 0x73e0
movl %eax, %ebp
movl %eax, %ecx
subl %r14d, %ecx
jle 0x7298
leaq 0x3699(%rip), %rdx      # 0xa905
leaq 0x70(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
callq 0x2190
movl $0x1, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2140
movl %ebp, %r15d
jmp 0x73e0
xorl %r13d, %r13d
movq 0x6d1e(%rip), %r12      # 0xdfc8
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq %rbx, %r13
jne 0x72f9
movq %r12, %rbp
testq %rbx, %rbx
leaq (%rbx,%rbx), %rbx
movl $0x20, %eax
cmoveq %rax, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x23a0
movq %rax, %r12
testq %rax, %rax
jne 0x72ea
testq %r15, %r15
je 0x72e7
movq %r15, %rdi
callq 0x2040
xorl %r14d, %r14d
movq %r12, %r15
testq %r12, %r12
movq %rbp, %r12
je 0x7970
movq (%r12), %rdi
callq 0x2270
movl %eax, %ebp
cmpl $0xa, %eax
je 0x730e
cmpl $-0x1, %ebp
jne 0x7338
cmpl $-0x1, %ebp
setne %al
testq %r13, %r13
setne %cl
orb %al, %cl
jne 0x732e
movq %r15, %rdi
callq 0x2040
xorl %r13d, %r13d
xorl %r14d, %r14d
jmp 0x733f
movb $0x0, (%r15,%r13)
movq %r15, %r14
jmp 0x733f
movb %bpl, (%r15,%r13)
incq %r13
cmpl $-0x1, %ebp
je 0x7970
cmpl $0xa, %ebp
jne 0x72af
jmp 0x7970
leaq 0x1d09(%rip), %rdi      # 0x9066
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x21f0
movq 0x6c4f(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
callq 0x2380
movq 0x6c48(%rip), %rax      # 0xdfc8
movq (%rax), %rdx
leaq 0xa0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x22e0
testq %rax, %rax
je 0x7970
leaq 0xa0(%rsp), %rdi
callq 0x2190
testq %rax, %rax
je 0x7960
movzbl 0x9f(%rsp,%rax), %ecx
cmpl $0xd, %ecx
je 0x73ca
cmpl $0xa, %ecx
jne 0x7960
movb $0x0, 0x9f(%rsp,%rax)
decq %rax
jne 0x73b4
jmp 0x7960
movzwl %ax, %r15d
movslq %r15d, %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
movq 0x18(%rsp), %rax
movb $0x0, (%rax)
decq 0x20(%rsp)
leaq 0x1ffc(%rip), %rdi      # 0x9409
callq 0x798a
movl 0x14(%rsp), %edi
movq 0x30(%rsp), %rdx
movq %rbx, %rsi
callq 0x2140
cmpq $-0x1, %rax
je 0x7923
leaq 0xa(%rsp), %r14
leaq 0x70(%rsp), %r15
leaq 0xb(%rsp), %r12
movl 0x10(%rsp), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x22c0
testl %eax, %eax
jle 0x770b
cmpb $0x9, 0xa(%rsp)
sete %cl
movq 0x71fc(%rip), %rax      # 0xe660
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x761d
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movb $0x0, 0xb(%rsp)
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq *%rax
cmpq $0x0, 0x70(%rsp)
je 0x75c8
xorl %r15d, %r15d
xorl %ebx, %ebx
cmpq 0x70(%rsp), %rbx
jae 0x74fe
movq %r15, 0x98(%rsp)
movq 0x18(%rsp), %r15
movq 0x38(%rsp), %rbp
movq 0x48(%rsp), %r13
movq 0x78(%rsp), %rax
movq (%rax,%rbx,8), %r14
movq %r14, %rdi
callq 0x2190
movq %rax, 0x38(%rsp)
movq %rax, 0x48(%rsp)
movq %r14, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x66ae
movq %r13, 0x48(%rsp)
movq %rbp, 0x38(%rsp)
movq %r15, 0x18(%rsp)
movq 0x98(%rsp), %r15
jmp 0x7508
leaq 0x10(%rsp), %rdi
callq 0x66ae
movl 0x10(%rsp), %edi
movl $0x1, %edx
movq %r12, %rsi
callq 0x22c0
testl %eax, %eax
jle 0x75f8
movzbl 0xb(%rsp), %eax
cmpl $0x1b, %eax
je 0x756a
cmpl $0x9, %eax
jne 0x7583
incq %rbx
movq 0x70(%rsp), %rcx
leaq 0x1(%rcx), %rsi
movq %rbx, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %rbx
cmpq %rcx, %rdx
jne 0x75bd
movq 0x6a9d(%rip), %r14      # 0xdff0
movq (%r14), %rsi
movl $0x7, %edi
callq 0x22b0
movq (%r14), %rdi
callq 0x2380
jmp 0x75bd
movl $0x1, %r15d
cmpq 0x70(%rsp), %rbx
jae 0x75bd
leaq 0x10(%rsp), %rdi
callq 0x66ae
jmp 0x75bd
movl $0x1, %r15d
cmpq 0x70(%rsp), %rbx
jae 0x75bd
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x78(%rsp), %rax
movq (%rax,%rbx,8), %rcx
leaq 0x1abc(%rip), %rdx      # 0x9066
xorl %eax, %eax
callq 0x2210
cltq
movq %rax, 0x38(%rsp)
movq %rax, 0x48(%rsp)
testq %r15, %r15
je 0x749d
jmp 0x75e4
movq 0x6a21(%rip), %rbx      # 0xdff0
movq (%rbx), %rsi
movl $0x7, %edi
callq 0x22b0
movq (%rbx), %rdi
callq 0x2380
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x7d79
movsbl 0xb(%rsp), %eax
jmp 0x760a
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x7d79
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movb %al, 0xa(%rsp)
testl %eax, %eax
leaq 0xa(%rsp), %r14
js 0x770b
je 0x7656
movb 0xa(%rsp), %al
movzbl %al, %ecx
leal -0x1(%rcx), %edx
cmpl $0x1a, %edx
ja 0x7660
leaq 0x31cd(%rip), %rsi      # 0xa800
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
cmpq $0x0, 0x38(%rsp)
je 0x790f
movq $0x0, 0x38(%rsp)
jmp 0x7905
movl $0x2, %eax
jmp 0x7911
cmpl $0x7f, %ecx
jne 0x7674
leaq 0x10(%rsp), %rdi
callq 0x6eb3
jmp 0x790f
movsbl %al, %esi
leaq 0x10(%rsp), %rdi
callq 0x65e8
testl %eax, %eax
jne 0x7880
jmp 0x790f
leaq 0x10(%rsp), %rdi
callq 0x6f03
jmp 0x790f
movslq 0x6fd4(%rip), %rax      # 0xe678
leaq -0x1(%rax), %rcx
movl %ecx, 0x6fca(%rip)      # 0xe678
movq 0x6fcb(%rip), %rcx      # 0xe680
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
cmpl $0x0, 0x6f92(%rip)      # 0xe658
je 0x76e3
movq 0x48(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x76e3
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x66ae
movq 0x6f7e(%rip), %rbx      # 0xe668
testq %rbx, %rbx
je 0x770b
movq $0x0, 0x6f6e(%rip) # 0xe668
leaq 0x10(%rsp), %rdi
callq 0x66ae
movq %rbx, 0x6f5d(%rip)      # 0xe668
movl 0x48(%rsp), %eax
movl %eax, 0xc(%rsp)
movl $0x1, %eax
jmp 0x7911
cmpq $0x0, 0x48(%rsp)
je 0x785e
leaq 0x10(%rsp), %rdi
callq 0x6e64
jmp 0x790f
callq 0x2070
movl $0xb, (%rax)
jmp 0x7880
movq 0x38(%rsp), %rax
movb $0x0, 0xa0(%rsp,%rax)
movq %rax, 0x48(%rsp)
jmp 0x7905
movb $0x0, 0xa0(%rsp)
xorl %eax, %eax
movq %rax, 0x48(%rsp)
jmp 0x7900
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
testq %rax, %rax
setne %dl
cmpq %rcx, %rax
setb %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x790f
rolw $0x8, 0x9f(%rsp,%rax)
decq %rcx
cmpq %rcx, %rax
jne 0x78fd
jmp 0x7905
movl $0x7, %edx
movl $0x1, %edi
leaq 0x30ca(%rip), %rsi      # 0xa88c
callq 0x2140
jmp 0x7905
movl 0x10(%rsp), %edi
movl $0x1, %edx
leaq 0x68(%rsp), %rsi
callq 0x22c0
cmpq $-0x1, %rax
je 0x790f
movl 0x10(%rsp), %edi
movl $0x1, %edx
leaq 0x69(%rsp), %rsi
callq 0x22c0
cmpq $-0x1, %rax
je 0x790f
movzbl 0x68(%rsp), %eax
cmpl $0x4f, %eax
je 0x788d
cmpl $0x5b, %eax
jne 0x790f
movzbl 0x69(%rsp), %eax
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x78a2
movl 0x10(%rsp), %edi
movl $0x1, %edx
leaq 0x6a(%rsp), %rsi
callq 0x22c0
cmpq $-0x1, %rax
je 0x790f
cmpb $0x7e, 0x6a(%rsp)
jne 0x790f
cmpb $0x33, 0x69(%rsp)
je 0x7729
jmp 0x790f
movslq 0x6e13(%rip), %rax      # 0xe678
leaq -0x1(%rax), %rcx
movl %ecx, 0x6e09(%rip)      # 0xe678
movq 0x6e0a(%rip), %rcx      # 0xe680
movq -0x8(%rcx,%rax,8), %rdi
callq 0x2040
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x7713
movzbl 0x69(%rsp), %eax
cmpl $0x46, %eax
je 0x78c6
cmpl $0x48, %eax
je 0x763c
jmp 0x790f
addl $-0x41, %eax
cmpl $0x7, %eax
ja 0x790f
leaq 0x2fbb(%rip), %rcx      # 0xa86c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
jmp 0x78ea
movq 0x48(%rsp), %rax
cmpq %rax, 0x38(%rsp)
jne 0x7900
jmp 0x790f
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x790f
decq %rax
jmp 0x7900
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x6d94
jmp 0x790f
movq 0x38(%rsp), %rax
cmpq 0x48(%rsp), %rax
je 0x790f
incq %rax
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x66ae
xorl %eax, %eax
testb $0x1, %al
je 0x743c
cmpl $-0x1, 0xc(%rsp)
sete %bl
jmp 0x7925
movb $0x1, %bl
cmpb $0x1, 0x6d9c(%rip)      # 0xe6c8
jne 0x794d
leaq 0x6d57(%rip), %rdx      # 0xe68c
xorl %edi, %edi
movl $0x2, %esi
callq 0x2400
cmpl $-0x1, %eax
je 0x794d
movb $0x0, 0x6d7b(%rip)      # 0xe6c8
movl $0xa, %edi
callq 0x2050
testb %bl, %bl
je 0x7960
xorl %r14d, %r14d
jmp 0x7970
leaq 0xa0(%rsp), %rdi
callq 0x24c0
movq %rax, %r14
movq %r14, %rax
addq $0x10a8, %rsp           # imm = 0x10A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq