// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/textutils.c
// Function: hts_strprint
const char *
hts_strprint(char *buf, size_t buflen, char quote, const char *s, size_t len)
{
    const char *slim = (len < SIZE_MAX)? &s[len] : NULL;
    char *t = buf, *bufend = buf + buflen;

    size_t qlen = quote? 1 : 0;
    if (quote) *t++ = quote;

    for (; slim? (s < slim) : (*s); s++) {
        char c;
        size_t clen;
        switch (*s) {
        case '\n': c = 'n'; clen = 2; break;
        case '\r': c = 'r'; clen = 2; break;
        case '\t': c = 't'; clen = 2; break;
        case '\0': c = '0'; clen = 2; break;
        case '\\': c = '\\'; clen = 2; break;
        default:
            c = *s;
            if (c == quote) clen = 2;
            else clen = isprint_c(c)? 1 : 4;
            break;
        }

        if (t-buf + clen + qlen >= buflen) {
            while (t-buf + 3 + qlen >= buflen) t--;
            if (quote) *t++ = quote;
            strcpy(t, "...");
            return buf;
        }

        if (clen == 4) {
            snprintf(t, bufend - t, "\\x%02X", (unsigned char) c);
            t += clen;
        }
        else {
            if (clen == 2) *t++ = '\\';
            *t++ = c;
        }
    }

    if (quote) *t++ = quote;
    *t = '\0';
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $-0x1, -0x30(%rbp)
jae 0x4c8a2
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x4c8aa
xorl %eax, %eax
movq %rax, -0x68(%rbp)
jmp 0x4c8aa
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movsbl -0x19(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0x50(%rbp)
cmpb $0x0, -0x19(%rbp)
je 0x4c8f7
movb -0x19(%rbp), %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
jmp 0x4c8f9
cmpq $0x0, -0x38(%rbp)
je 0x4c915
movq -0x28(%rbp), %rax
cmpq -0x38(%rbp), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x6c(%rbp)
jmp 0x4c91f
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl $0x0, %eax
je 0x4cada
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x70(%rbp)
testl %eax, %eax
je 0x4c98d
jmp 0x4c93b
movl -0x70(%rbp), %eax
subl $0x9, %eax
je 0x4c97f
jmp 0x4c945
movl -0x70(%rbp), %eax
subl $0xa, %eax
je 0x4c963
jmp 0x4c94f
movl -0x70(%rbp), %eax
subl $0xd, %eax
je 0x4c971
jmp 0x4c959
movl -0x70(%rbp), %eax
subl $0x5c, %eax
je 0x4c99b
jmp 0x4c9a9
movb $0x6e, -0x51(%rbp)
movq $0x2, -0x60(%rbp)
jmp 0x4c9eb
movb $0x72, -0x51(%rbp)
movq $0x2, -0x60(%rbp)
jmp 0x4c9eb
movb $0x74, -0x51(%rbp)
movq $0x2, -0x60(%rbp)
jmp 0x4c9eb
movb $0x30, -0x51(%rbp)
movq $0x2, -0x60(%rbp)
jmp 0x4c9eb
movb $0x5c, -0x51(%rbp)
movq $0x2, -0x60(%rbp)
jmp 0x4c9eb
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x51(%rbp)
movsbl -0x51(%rbp), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4c9c8
movq $0x2, -0x60(%rbp)
jmp 0x4c9e9
movsbl -0x51(%rbp), %edi
callq 0x4cb10
movl %eax, %edx
movl $0x4, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
movq %rax, -0x60(%rbp)
jmp 0x4c9eb
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
addq -0x60(%rbp), %rax
addq -0x50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x4ca64
jmp 0x4ca06
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
addq $0x3, %rax
addq -0x50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x4ca2d
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x4ca06
cmpb $0x0, -0x19(%rbp)
je 0x4ca47
movb -0x19(%rbp), %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
movq -0x40(%rbp), %rdi
leaq 0xa460b(%rip), %rsi     # 0xf105d
callq 0x4450
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4cb03
cmpq $0x4, -0x60(%rbp)
jne 0x4ca9a
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rax
subq %rax, %rsi
movzbl -0x51(%rbp), %ecx
leaq 0xa6978(%rip), %rdx     # 0xf33fd
movb $0x0, %al
callq 0x47e0
movq -0x60(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x4cac7
cmpq $0x2, -0x60(%rbp)
jne 0x4cab3
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb $0x5c, (%rax)
movb -0x51(%rbp), %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
jmp 0x4cac9
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4c8f9
cmpb $0x0, -0x19(%rbp)
je 0x4caf4
movb -0x19(%rbp), %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)