// File: Marm0t[P]dji-phantom3-parser/packet.cpp
// Function: Packet::toString[abi:cxx11]()
string Packet::toString()
{
    stringstream ss;
    ss << "MsgID: " << dec << _msgId;
    ss << ", len: " << (int)_packetLen;
    ss << ", type: " << noshowbase << hex << setw(4) << setfill ('0') << _packetType << endl;
    /*
    for ( packetv_t::const_iterator it = _packv.begin(); it != _packv.end(); ++it)
    {
        ss << noshowbase << hex << setw(2) << setfill('0') << (int)(unsigned char)(*it) << " ";
    }
    */
    for (int i = 0; i< _packv.size(); ++i)
    {
        if (i==10 || i==18 || i==26) ss << endl;
        if (i==30 || i==62) ss <<endl << endl; // unknown part of the GPS message begins
        ss << noshowbase << hex << setw(2) << setfill('0') << (int)(unsigned char)(_packv[i]) << " ";
    }
    ss << dec << endl;
    return ss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x1d8(%rbp)
movq %rdi, %rax
movq %rax, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x2110
leaq -0x188(%rbp), %rdi
leaq 0x2799(%rip), %rsi      # 0x7192
callq 0x21b0
movq %rax, -0x1c0(%rbp)
jmp 0x4a07
movq -0x1c0(%rbp), %rdi
leaq -0x1b95(%rip), %rsi     # 0x2e80
callq 0x2080
movq %rax, -0x1e0(%rbp)
jmp 0x4a23
movq -0x1e0(%rbp), %rdi
movq -0x1c8(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x2270
jmp 0x4a3b
leaq -0x188(%rbp), %rdi
leaq 0x2751(%rip), %rsi      # 0x719a
callq 0x21b0
movq %rax, -0x1e8(%rbp)
jmp 0x4a57
movq -0x1e8(%rbp), %rdi
movq -0x1c8(%rbp), %rax
movzbl 0x20(%rax), %esi
callq 0x2300
jmp 0x4a70
leaq -0x188(%rbp), %rdi
leaq 0x2724(%rip), %rsi      # 0x71a2
callq 0x21b0
movq %rax, -0x1f0(%rbp)
jmp 0x4a8c
movq -0x1f0(%rbp), %rdi
leaq 0x1846(%rip), %rsi      # 0x62e0
callq 0x2080
movq %rax, -0x1f8(%rbp)
jmp 0x4aa8
movq -0x1f8(%rbp), %rdi
leaq 0x185a(%rip), %rsi      # 0x6310
callq 0x2080
movq %rax, -0x200(%rbp)
jmp 0x4ac4
movl $0x4, %edi
callq 0x6340
movl %eax, -0x204(%rbp)
jmp 0x4ad6
movq -0x200(%rbp), %rdi
movl -0x204(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movl -0x1a8(%rbp), %esi
callq 0x2230
movq %rax, -0x210(%rbp)
jmp 0x4afd
movl $0x30, %edi
callq 0x6360
movb %al, -0x211(%rbp)
jmp 0x4b0f
movq -0x210(%rbp), %rdi
movb -0x211(%rbp), %al
movb %al, -0x1a9(%rbp)
movzbl -0x1a9(%rbp), %esi
callq 0x22b0
movq %rax, -0x220(%rbp)
jmp 0x4b37
movq -0x220(%rbp), %rdi
movq -0x1c8(%rbp), %rax
movzwl 0x22(%rax), %esi
callq 0x22f0
movq %rax, -0x228(%rbp)
jmp 0x4b57
movq -0x228(%rbp), %rdi
movq 0x645b(%rip), %rsi      # 0xafc0
callq 0x21e0
jmp 0x4b6c
movl $0x0, -0x1b0(%rbp)
movq -0x1c8(%rbp), %rdi
movslq -0x1b0(%rbp), %rax
movq %rax, -0x230(%rbp)
addq $0x8, %rdi
callq 0x3750
movq %rax, %rcx
movq -0x230(%rbp), %rax
cmpq %rcx, %rax
jae 0x4d46
cmpl $0xa, -0x1b0(%rbp)
je 0x4bc2
cmpl $0x12, -0x1b0(%rbp)
je 0x4bc2
cmpl $0x1a, -0x1b0(%rbp)
jne 0x4bfc
leaq -0x188(%rbp), %rdi
movq 0x63f0(%rip), %rsi      # 0xafc0
callq 0x21e0
jmp 0x4bd7
jmp 0x4bfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x2140
jmp 0x4da8
cmpl $0x1e, -0x1b0(%rbp)
je 0x4c0e
cmpl $0x3e, -0x1b0(%rbp)
jne 0x4c41
leaq -0x188(%rbp), %rdi
movq 0x63a4(%rip), %rsi      # 0xafc0
callq 0x21e0
movq %rax, -0x238(%rbp)
jmp 0x4c2a
movq -0x238(%rbp), %rdi
movq 0x6388(%rip), %rsi      # 0xafc0
callq 0x21e0
jmp 0x4c3f
jmp 0x4c41
leaq -0x188(%rbp), %rdi
leaq 0x1691(%rip), %rsi      # 0x62e0
callq 0x2080
movq %rax, -0x240(%rbp)
jmp 0x4c5d
movq -0x240(%rbp), %rdi
leaq 0x16a5(%rip), %rsi      # 0x6310
callq 0x2080
movq %rax, -0x248(%rbp)
jmp 0x4c79
movl $0x2, %edi
callq 0x6340
movl %eax, -0x24c(%rbp)
jmp 0x4c8b
movq -0x248(%rbp), %rdi
movl -0x24c(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %esi
callq 0x2230
movq %rax, -0x258(%rbp)
jmp 0x4cb2
movl $0x30, %edi
callq 0x6360
movb %al, -0x259(%rbp)
jmp 0x4cc4
movq -0x258(%rbp), %rdi
movb -0x259(%rbp), %al
movb %al, -0x1b5(%rbp)
movzbl -0x1b5(%rbp), %esi
callq 0x22b0
movq %rax, -0x268(%rbp)
jmp 0x4cec
movq -0x1c8(%rbp), %rdi
addq $0x8, %rdi
movslq -0x1b0(%rbp), %rsi
callq 0x6290
movq -0x268(%rbp), %rdi
movzbl (%rax), %esi
callq 0x2300
movq %rax, -0x270(%rbp)
jmp 0x4d1b
movq -0x270(%rbp), %rdi
leaq 0x257d(%rip), %rsi      # 0x72a6
callq 0x21b0
jmp 0x4d30
jmp 0x4d32
movl -0x1b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b0(%rbp)
jmp 0x4b76
leaq -0x188(%rbp), %rdi
leaq -0x1ed4(%rip), %rsi     # 0x2e80
callq 0x2080
movq %rax, -0x278(%rbp)
jmp 0x4d62
movq -0x278(%rbp), %rdi
movq 0x6250(%rip), %rsi      # 0xafc0
callq 0x21e0
jmp 0x4d77
movq -0x1d8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x21a0
jmp 0x4d8c
leaq -0x198(%rbp), %rdi
callq 0x2140
movq -0x1d0(%rbp), %rax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x2320
nopw %cs:(%rax,%rax)