// File: /workspace/github_cpp_makefile_star2_O1/xjrueda[P]fixprime/src/Protocol.cpp
// Function: fprime::Protocol::loadFields()
void Protocol::loadFields() {
        try {
            if (protocolSpec["Fields"].empty()) {
                std::runtime_error("No fields specified for current  protocol ");

            } else {

                // Gets the fields members of the protocol
                std::vector<string> fieldCodes = protocolSpec["Fields"].getMemberNames();

                // process the fields
                for (std::vector<string>::iterator itr = fieldCodes.begin(); itr != fieldCodes.end(); itr++) {
                    try {
                        fprime::Field::FieldPtr field(new fprime::Field(boost::lexical_cast<unsigned int>(*itr)));
                        // completes the field properties
                        field->setName(protocolSpec["Fields"][*itr]["name"].asString());
                        field->setDataType(protocolSpec["Fields"][*itr]["dataType"].asString());

                        //Load valid values
                        try {
                            if (protocolSpec["Fields"][*itr]["validValues"].empty()) {
                                std::vector<string> validValues = protocolSpec["Fields"][*itr]["validValues"].getMemberNames();
                                for (std::vector<string>::iterator itValues = validValues.begin(); itValues != validValues.end(); itValues++) {
                                    field->addValidValue(string(*itValues), protocolSpec["Fields"][*itr]["validValues"][*itValues].asString());
                                }
                            }
                            addField(field);
                        } catch (exception& e) {
                            throw std::runtime_error("error loading valid values: " + string(e.what()));
                        }
                    } catch (exception e) {
                        throw std::runtime_error("Exception loading field " + *itr + ": " + e.what());
                    }
                }

            }
        } catch (exception& e) {
            throw std::runtime_error("at Protocol.loadField:" + string(e.what()));
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x98(%rsp)
leaq 0x28(%rdi), %r15
leaq 0x1aef8(%rip), %rsi     # 0x5c5dc
movq %r15, %rdi
callq 0x2e870
movq %rax, %rdi
callq 0x30b40
testb %al, %al
je 0x4171e
leaq 0x1aee4(%rip), %rsi     # 0x5c5e3
leaq 0x148(%rsp), %rdi
callq 0x2e800
leaq 0x148(%rsp), %rdi
callq 0x31100
jmp 0x41a82
leaq 0x1aeb7(%rip), %rsi     # 0x5c5dc
movq %r15, %rdi
callq 0x2e870
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x2f2c0
movq 0xa0(%rsp), %rbx
cmpq 0xa8(%rsp), %rbx
je 0x41a75
leaq 0xb8(%rsp), %r13
leaq 0x128(%rsp), %r14
movl $0xb0, %edi
callq 0x2f830
movq %rax, %rbp
movl $0x0, 0x4(%rsp)
leaq 0x82(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x84(%rsp), %rax
movq %rax, 0x90(%rsp)
movq (%rbx), %rax
movq %rax, 0x88(%rsp)
movq 0x8(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x90(%rsp)
movq %rax, 0x118(%rsp)
movq %rcx, 0x120(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x30fa0
testb %al, %al
je 0x41a94
movl 0x4(%rsp), %esi
movq %rbp, %rdi
callq 0x2fca0
movq %rbp, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x30960
movq 0x28(%rsp), %r12
movq %r15, %rdi
leaq 0x1add3(%rip), %rsi     # 0x5c5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30de0
movq %rax, %rdi
leaq 0x1bb2b(%rip), %rsi     # 0x5d34e
callq 0x2e870
leaq 0xf8(%rsp), %rdi
movq %rax, %rsi
callq 0x30bf0
movq %r12, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x30310
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x41862
callq 0x2f6c0
movq 0x28(%rsp), %r12
movq %r15, %rdi
leaq 0x1ad6b(%rip), %rsi     # 0x5c5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30de0
movq %rax, %rdi
leaq 0x1ad83(%rip), %rsi     # 0x5c60e
callq 0x2e870
leaq 0xd8(%rsp), %rdi
movq %rax, %rsi
callq 0x30bf0
movq %r12, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x2f550
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x418ca
callq 0x2f6c0
movq %r15, %rdi
leaq 0x1ad08(%rip), %rsi     # 0x5c5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30de0
movq %rax, %rdi
leaq 0x1ad29(%rip), %rsi     # 0x5c617
callq 0x2e870
movq %rax, %rdi
callq 0x30b40
testb %al, %al
je 0x41a05
movq %r15, %rdi
leaq 0x1accf(%rip), %rsi     # 0x5c5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30de0
movq %rax, %rdi
leaq 0x1acf0(%rip), %rsi     # 0x5c617
callq 0x2e870
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x2f2c0
movq 0x8(%rsp), %rbp
cmpq 0x10(%rsp), %rbp
je 0x419fb
movq 0x28(%rsp), %r12
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x2e8a0
movq %r15, %rdi
leaq 0x1ac61(%rip), %rsi     # 0x5c5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30de0
movq %rax, %rdi
leaq 0x1ac82(%rip), %rsi     # 0x5c617
callq 0x2e870
movq %rax, %rdi
movq %rbp, %rsi
callq 0x30de0
movq %r14, %rdi
movq %rax, %rsi
callq 0x30bf0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x304d0
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x419d8
callq 0x2f6c0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x419f2
callq 0x2f6c0
addq $0x20, %rbp
jmp 0x4193e
leaq 0x8(%rsp), %rdi
callq 0x2f170
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x41a33
movq 0x30433(%rip), %rcx     # 0x71e58
cmpb $0x0, (%rcx)
je 0x41a2f
incl 0x8(%rax)
jmp 0x41a33
lock
incl 0x8(%rax)
movq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x2fe80
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x41a54
callq 0x2f370
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x41a63
callq 0x2f370
addq $0x20, %rbx
cmpq 0xa8(%rsp), %rbx
jne 0x41763
leaq 0xa0(%rsp), %rdi
callq 0x2f170
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30365(%rip), %rax     # 0x71e00
addq $0x10, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movq 0x30242(%rip), %rax     # 0x71cf0
movq %rax, 0x8(%rdi)
movq 0x3046f(%rip), %rax     # 0x71f28
movq %rax, 0x10(%rdi)
callq 0x2fd10
jmp 0x41ac4
movq %rdx, %r15
movq %rax, %r14
jmp 0x41e57
movq %rdx, %r15
movq %rax, %r14
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x41bc7
callq 0x2f370
jmp 0x41bc7
movq %rdx, %r15
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x305c0
jmp 0x41b53
movq %rdx, %r15
movq %rax, %r14
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
jmp 0x41b2d
movq %rdx, %r15
movq %rax, %r14
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x41c9e
callq 0x2f6c0
jmp 0x41c9e
jmp 0x41b60
movq %rdx, %r15
movq %rax, %r14
jmp 0x41cad
movq %rdx, %r15
movq %rax, %r14
movq %rbp, %rdi
callq 0x2f6c0
jmp 0x41cad
movq %rdx, %r15
movq %rax, %r14
jmp 0x41bc7
movq %rdx, %r15
movq %rax, %r14
jmp 0x41c9e
movq %rdx, %r15
movq %rax, %r14
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x41ba3
callq 0x2f6c0
jmp 0x41ba3
movq %rdx, %r15
movq %rax, %r14
jmp 0x41bbd
movq %rdx, %r15
movq %rax, %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x41bbd
callq 0x2f6c0
leaq 0x8(%rsp), %rdi
callq 0x2f170
cmpl $0x1, %r15d
jne 0x41c9e
movq %r14, %rdi
callq 0x2e8b0
movq %rax, %r14
movl $0x10, %edi
callq 0x2eae0
movq %rax, %r12
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x50(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movq %rax, %rsi
callq 0x2e880
leaq 0x1aa15(%rip), %rsi     # 0x5c623
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x30840
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x30700
xorl %ebp, %ebp
movq 0x303a2(%rip), %rsi     # 0x71fd8
movq 0x30183(%rip), %rdx     # 0x71dc0
movq %r12, %rdi
callq 0x308f0
jmp 0x41ed2
movq %rdx, %r15
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41c6e
callq 0x2f6c0
jmp 0x41c6e
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bpl
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41c8c
callq 0x2f6c0
jmp 0x41c8c
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x41c99
movq %r12, %rdi
callq 0x2f150
callq 0x30750
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x41cad
callq 0x2f370
cmpl $0x1, %r15d
jne 0x41e4a
movq %r14, %rdi
callq 0x2fdf0
movq 0x30162(%rip), %rax     # 0x71e28
addq $0x10, %rax
movq %rax, 0x48(%rsp)
movq %r14, %rdi
callq 0x2e8b0
movl $0x10, %edi
callq 0x2eae0
movq %rax, %r12
leaq 0x1a955(%rip), %rsi     # 0x5c640
leaq 0x28(%rsp), %rdi
movq %rbx, %rdx
callq 0x2f510
leaq 0x1a82a(%rip), %rsi     # 0x5c529
leaq 0x28(%rsp), %rdi
callq 0x30e60
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x41d2b
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x41d38
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
movq 0x8(%rax), %rdx
leaq 0x50(%rsp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rdi
callq 0x30ff0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30e60
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x41d8a
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x41d97
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r12, %rdi
callq 0x30700
xorl %ebx, %ebx
movq 0x30212(%rip), %rsi     # 0x71fd8
movq 0x2fff3(%rip), %rdx     # 0x71dc0
movq %r12, %rdi
callq 0x308f0
jmp 0x41ed2
movq %rdx, %r15
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x41df9
callq 0x2f6c0
jmp 0x41df9
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bl
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x41e12
callq 0x2f6c0
jmp 0x41e12
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41e2f
callq 0x2f6c0
jmp 0x41e2f
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bl
testb %bl, %bl
je 0x41e3b
movq %r12, %rdi
callq 0x2f150
leaq 0x48(%rsp), %rdi
callq 0x31000
callq 0x30750
leaq 0xa0(%rsp), %rdi
callq 0x2f170
cmpl $0x1, %r15d
jne 0x41f1d
movq %r14, %rdi
callq 0x2e8b0
movq %rax, %r14
movl $0x10, %edi
callq 0x2eae0
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rax, %rsi
callq 0x2e880
leaq 0x1a7be(%rip), %rsi     # 0x5c659
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x30840
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x30700
xorl %ebp, %ebp
movq 0x30115(%rip), %rsi     # 0x71fd8
movq 0x2fef6(%rip), %rdx     # 0x71dc0
movq %rbx, %rdi
callq 0x308f0
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41ef0
callq 0x2f6c0
jmp 0x41ef0
movq %rax, %r14
movb $0x1, %bpl
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41f0b
callq 0x2f6c0
jmp 0x41f0b
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x41f18
movq %rbx, %rdi
callq 0x2f150
callq 0x30750
movq %r14, %rdi
callq 0x30a20
movq %rax, %rdi
callq 0x32108
nop