// File: /workspace/github_cpp_makefile_star2_O1/tbonelaforge[P]gradebook/Main.cpp
// Function: handleAddFinalExamGrade(Gradebook&, bool)
void handleAddFinalExamGrade(Gradebook &gradebook, bool idMode) {
    int finalExamGrade;
    Student * student;
    if (gradebook.getFinalExamRecorded()) {
        cout << "Final Exam Already Recorded..." << endl;
        return;
    }
    if (!idMode) {
        Node * current = gradebook.getIndex();
        while (current != NULL) {
            student = current->student;
            cout << "Enter Final Exam Grade for "
                 << student->getLastName() << ", " << student->getFirstName() << endl;
            cin >> finalExamGrade;
            student->setFinalExamGrade(finalExamGrade);
            saveGrades(gradebook);
            current = current->next;
        }
    } else {
        student = gradebook.getHead();
        while (student != NULL) {
            cout << "Enter Final Exam Grade for "
                 << student->getLastName() << ", " << student->getFirstName() << endl;
            cin >> finalExamGrade;
            student->setFinalExamGrade(finalExamGrade);
            saveGrades(gradebook);
            student = student->next;
        }
    }
    gradebook.setFinalExamRecorded();
    saveGrades(gradebook);
    handleOutputGrades(gradebook, idMode);
    
    transLog << "Recorded grades for Final" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x5f2a
testb %al, %al
je 0x38e3
movq 0x96f6(%rip), %rbx      # 0xcfc8
leaq 0x5ac3(%rip), %rsi      # 0x939c
movl $0x1e, %edx
jmp 0x3b3a
movl %r14d, -0x74(%rbp)
movq %rbx, %rdi
testb %r14b, %r14b
je 0x3a01
callq 0x5862
testq %rax, %rax
je 0x3b0b
movq %rax, %r15
movq 0x96bd(%rip), %r12      # 0xcfc8
leaq -0x2c(%rbp), %r14
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x5a9d(%rip), %rsi      # 0x93bb
callq 0x2210
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x62d4
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x2210
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x59d5(%rip), %rsi      # 0x9326
callq 0x2210
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x62a6
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x2210
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x39b5
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x39ce
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x960b(%rip), %rdi      # 0xcfe0
movq %r14, %rsi
callq 0x2110
movl -0x2c(%rbp), %esi
movq %r15, %rdi
callq 0x636a
movq %rbx, %rdi
callq 0x256c
movq (%r15), %r15
testq %r15, %r15
jne 0x390f
jmp 0x3b0b
callq 0x586c
testq %rax, %rax
je 0x3b0b
movq %rax, %r15
movq 0x95af(%rip), %r12      # 0xcfc8
movq (%r15), %r13
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x5990(%rip), %rsi      # 0x93bb
callq 0x2210
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x62d4
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x2210
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x58c8(%rip), %rsi      # 0x9326
callq 0x2210
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x62a6
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r14, %rdi
callq 0x2210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3ac2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3adb
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x94fe(%rip), %rdi      # 0xcfe0
leaq -0x2c(%rbp), %rsi
callq 0x2110
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x636a
movq %rbx, %rdi
callq 0x256c
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x3a19
movq %rbx, %rdi
callq 0x5ee2
movq %rbx, %rdi
callq 0x256c
movzbl -0x74(%rbp), %esi
movq %rbx, %rdi
callq 0x2edb
leaq 0x96ba(%rip), %rbx      # 0xd1e8
leaq 0x58a2(%rip), %rsi      # 0x93d7
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2130
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b7e
jmp 0x3b7e
jmp 0x3b7e
movq %rax, %rbx
jmp 0x3ba1
jmp 0x3b85
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3ba1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3bba
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2310