// File: joncampbell123[P]floppytools/kryocomm.cpp
// Function: kryoflux_parse_stream_nv_pair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char>>>&, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char>>>)
void kryoflux_parse_stream_nv_pair(std::string &name,std::string &value,std::vector<unsigned char>::iterator &mi,const std::vector<unsigned char>::iterator mend) {
    name.clear();
    value.clear();

    /* leading space */
    while (mi != mend && *mi == ' ') mi++;

    /* name */
    while (mi != mend) {
        if (*mi == 0) return; /* end of string, return now */
        if (*mi == '=') {
            mi++; /* skip it and break to next loop */
            break;
        }
        if (*mi == ',') {
            mi++; /* skip it and return */
            return;
        }

        name += *mi;
        mi++;
    }

    /* value */
    while (mi != mend) {
        if (*mi == 0) return; /* end of string, return now */
        if (*mi == ',') {
            mi++; /* skip it and return */
            return;
        }

        value += *mi;
        mi++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rcx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x21e0
movq -0x18(%rbp), %rdi
callq 0x21e0
movq -0x20(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x8550
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x51(%rbp)
jne 0x7a55
jmp 0x7a6a
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x7a73
jmp 0x7a84
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x28(%rbp)
jmp 0x7a3a
jmp 0x7a86
movq -0x20(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x8550
testb $0x1, %al
jne 0x7a9c
jmp 0x7b24
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7ab2
jmp 0x7b96
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x3d, %eax
jne 0x7ad4
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x30(%rbp)
jmp 0x7b24
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x7af9
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x38(%rbp)
jmp 0x7b96
movq -0x20(%rbp), %rdi
callq 0x8590
movb (%rax), %al
movq -0x10(%rbp), %rdi
movsbl %al, %esi
callq 0x2110
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x40(%rbp)
jmp 0x7a86
jmp 0x7b26
movq -0x20(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x8550
testb $0x1, %al
jne 0x7b39
jmp 0x7b96
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7b4c
jmp 0x7b96
movq -0x20(%rbp), %rdi
callq 0x8590
movzbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x7b6e
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x48(%rbp)
jmp 0x7b96
movq -0x20(%rbp), %rdi
callq 0x8590
movb (%rax), %al
movq -0x18(%rbp), %rdi
movsbl %al, %esi
callq 0x2110
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x85b0
movq %rax, -0x50(%rbp)
jmp 0x7b26
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)