// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rdi, 0x88(%rsp)
leaq 0x28(%rdi), %r15
leaq 0x1a1de(%rip), %rsi     # 0x5b5dc
movq %r15, %rdi
callq 0x2e870
movq %rax, %rdi
callq 0x30b30
testb %al, %al
je 0x41438
leaq 0x1a1ca(%rip), %rsi     # 0x5b5e3
leaq 0x138(%rsp), %rdi
callq 0x2e800
leaq 0x138(%rsp), %rdi
callq 0x310f0
jmp 0x41772
leaq 0x1a19d(%rip), %rsi     # 0x5b5dc
movq %r15, %rdi
callq 0x2e870
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x2f2c0
movq 0x90(%rsp), %rbx
cmpq 0x98(%rsp), %rbx
je 0x41765
leaq 0xb8(%rsp), %r13
leaq 0x118(%rsp), %r14
movl $0xb0, %edi
callq 0x2f830
movq %rax, %rbp
movl $0x0, 0xc(%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
addq %rax, %rcx
movq %rax, 0xa8(%rsp)
movq %rcx, 0xb0(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x30f90
testb %al, %al
je 0x41784
movl 0xc(%rsp), %esi
movq %rbp, %rdi
callq 0x2fc90
movq %rbp, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x30950
movq 0x30(%rsp), %r12
movq %r15, %rdi
leaq 0x1a0e9(%rip), %rsi     # 0x5b5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30dd0
movq %rax, %rdi
leaq 0x1ae41(%rip), %rsi     # 0x5c34e
callq 0x2e870
leaq 0xf8(%rsp), %rdi
movq %rax, %rsi
callq 0x30be0
movq %r12, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x30300
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x4154c
callq 0x2f6c0
movq 0x30(%rsp), %r12
movq %r15, %rdi
leaq 0x1a081(%rip), %rsi     # 0x5b5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30dd0
movq %rax, %rdi
leaq 0x1a099(%rip), %rsi     # 0x5b60e
callq 0x2e870
leaq 0xd8(%rsp), %rdi
movq %rax, %rsi
callq 0x30be0
movq %r12, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x2f550
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x415b4
callq 0x2f6c0
movq %r15, %rdi
leaq 0x1a01e(%rip), %rsi     # 0x5b5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30dd0
movq %rax, %rdi
leaq 0x1a03f(%rip), %rsi     # 0x5b617
callq 0x2e870
movq %rax, %rdi
callq 0x30b30
testb %al, %al
je 0x416ef
movq %r15, %rdi
leaq 0x19fe5(%rip), %rsi     # 0x5b5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30dd0
movq %rax, %rdi
leaq 0x1a006(%rip), %rsi     # 0x5b617
callq 0x2e870
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x2f2c0
movq 0x10(%rsp), %rbp
cmpq 0x18(%rsp), %rbp
je 0x416e5
movq 0x30(%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 0x19f77(%rip), %rsi     # 0x5b5dc
callq 0x2e870
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30dd0
movq %rax, %rdi
leaq 0x19f98(%rip), %rsi     # 0x5b617
callq 0x2e870
movq %rax, %rdi
movq %rbp, %rsi
callq 0x30dd0
movq %r14, %rdi
movq %rax, %rsi
callq 0x30be0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x304c0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x416c2
callq 0x2f6c0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x416dc
callq 0x2f6c0
addq $0x20, %rbp
jmp 0x41628
leaq 0x10(%rsp), %rdi
callq 0x2f170
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x41720
movq 0x2f746(%rip), %rcx     # 0x70e58
cmpb $0x0, (%rcx)
je 0x4171c
incl 0x8(%rax)
jmp 0x41720
lock
incl 0x8(%rax)
movq 0x88(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2fe70
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x41744
callq 0x2f370
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x41753
callq 0x2f370
addq $0x20, %rbx
cmpq 0x98(%rsp), %rbx
jne 0x4147d
leaq 0x90(%rsp), %rdi
callq 0x2f170
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2f675(%rip), %rax     # 0x70e00
addq $0x10, %rax
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq 0x2f552(%rip), %rax     # 0x70cf0
movq %rax, 0x8(%rdi)
movq 0x2f77f(%rip), %rax     # 0x70f28
movq %rax, 0x10(%rdi)
callq 0x2fd00
jmp 0x417b4
movq %rdx, %r15
movq %rax, %r14
jmp 0x41b66
movq %rdx, %r15
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x418ba
callq 0x2f370
jmp 0x418ba
movq %rdx, %r15
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x305b0
jmp 0x41846
movq %rdx, %r15
movq %rax, %r14
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
jmp 0x41820
movq %rdx, %r15
movq %rax, %r14
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x4199e
callq 0x2f6c0
jmp 0x4199e
jmp 0x41853
movq %rdx, %r15
movq %rax, %r14
jmp 0x419ad
movq %rdx, %r15
movq %rax, %r14
movq %rbp, %rdi
callq 0x2f6c0
jmp 0x419ad
movq %rdx, %r15
movq %rax, %r14
jmp 0x418ba
movq %rdx, %r15
movq %rax, %r14
jmp 0x4199e
movq %rdx, %r15
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x41896
callq 0x2f6c0
jmp 0x41896
movq %rdx, %r15
movq %rax, %r14
jmp 0x418b0
movq %rdx, %r15
movq %rax, %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x418b0
callq 0x2f6c0
leaq 0x10(%rsp), %rdi
callq 0x2f170
cmpl $0x1, %r15d
jne 0x4199e
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 0xa8(%rsp), %rdx
movq %rax, %rsi
callq 0x2e880
leaq 0x19d22(%rip), %rsi     # 0x5b623
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x30830
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x306f0
xorl %ebp, %ebp
movq 0x2f6af(%rip), %rsi     # 0x70fd8
movq 0x2f490(%rip), %rdx     # 0x70dc0
movq %r12, %rdi
callq 0x308e0
jmp 0x41be1
movq %rdx, %r15
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41956
callq 0x2f6c0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41969
callq 0x2f6c0
testb %bpl, %bpl
jne 0x41991
jmp 0x41999
movq %rdx, %r15
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41991
callq 0x2f6c0
jmp 0x41991
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x2f150
callq 0x30740
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x419ad
callq 0x2f370
cmpl $0x1, %r15d
jne 0x41b59
movq %r14, %rdi
callq 0x2fde0
movq 0x2f462(%rip), %rax     # 0x70e28
addq $0x10, %rax
movq %rax, 0x70(%rsp)
movq %r14, %rdi
callq 0x2e8b0
movl $0x10, %edi
callq 0x2eae0
movq %rax, %r12
leaq 0x19c55(%rip), %rsi     # 0x5b640
leaq 0x30(%rsp), %rdi
movq %rbx, %rdx
callq 0x2f510
leaq 0x19b2a(%rip), %rsi     # 0x5b529
leaq 0x30(%rsp), %rdi
callq 0x30e50
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x41a2b
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x41a38
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 0x70(%rsp), %rdi
callq 0x30fe0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30e50
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x41a8a
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x41a97
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r12, %rdi
callq 0x306f0
xorl %ebx, %ebx
movq 0x2f512(%rip), %rsi     # 0x70fd8
movq 0x2f2f3(%rip), %rdx     # 0x70dc0
movq %r12, %rdi
callq 0x308e0
jmp 0x41be1
movq %rdx, %r15
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x41af9
callq 0x2f6c0
jmp 0x41af9
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bl
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x41b08
callq 0x2f6c0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41b1b
callq 0x2f6c0
testb %bl, %bl
jne 0x41b42
jmp 0x41b4a
movq %rdx, %r15
movq %rax, %r14
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41b42
callq 0x2f6c0
jmp 0x41b42
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x2f150
leaq 0x70(%rsp), %rdi
callq 0x30ff0
callq 0x30740
leaq 0x90(%rsp), %rdi
callq 0x2f170
cmpl $0x1, %r15d
jne 0x41c39
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 0x30(%rsp), %rdx
movq %rax, %rsi
callq 0x2e880
leaq 0x19aaf(%rip), %rsi     # 0x5b659
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x30830
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x306f0
xorl %ebp, %ebp
movq 0x2f406(%rip), %rsi     # 0x70fd8
movq 0x2f1e7(%rip), %rdx     # 0x70dc0
movq %rbx, %rdi
callq 0x308e0
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41bf7
callq 0x2f6c0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41c0a
callq 0x2f6c0
testb %bpl, %bpl
jne 0x41c2c
jmp 0x41c34
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41c2c
callq 0x2f6c0
jmp 0x41c2c
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f150
callq 0x30740
movq %r14, %rdi
callq 0x30a10
movq %rax, %rdi
callq 0x320e8
nop