// File: /workspace/github_cpp_makefile_star2_O3/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 0x5f68
testb %al, %al
je 0x38f9
movq 0x9718(%rip), %rbx      # 0xcfc8
leaq 0x5ae5(%rip), %rsi      # 0x939c
movl $0x1e, %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
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2130
movl %r14d, -0x74(%rbp)
movq %rbx, %rdi
testb %r14b, %r14b
je 0x3a17
callq 0x58a0
testq %rax, %rax
je 0x3b21
movq %rax, %r15
movq 0x96a7(%rip), %r12      # 0xcfc8
leaq -0x2c(%rbp), %r14
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x5a87(%rip), %rsi      # 0x93bb
callq 0x2210
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x62ee
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x2210
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x59bf(%rip), %rsi      # 0x9326
callq 0x2210
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x62c0
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 0x39cb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x39e4
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x95f5(%rip), %rdi      # 0xcfe0
movq %r14, %rsi
callq 0x2110
movl -0x2c(%rbp), %esi
movq %r15, %rdi
callq 0x6384
movq %rbx, %rdi
callq 0x256c
movq (%r15), %r15
testq %r15, %r15
jne 0x3925
jmp 0x3b21
callq 0x58aa
testq %rax, %rax
je 0x3b21
movq %rax, %r15
movq 0x9599(%rip), %r12      # 0xcfc8
movq (%r15), %r13
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x597a(%rip), %rsi      # 0x93bb
callq 0x2210
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x62ee
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x2210
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x58b2(%rip), %rsi      # 0x9326
callq 0x2210
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x62c0
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 0x3ad8
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3af1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x94e8(%rip), %rdi      # 0xcfe0
leaq -0x2c(%rbp), %rsi
callq 0x2110
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x6384
movq %rbx, %rdi
callq 0x256c
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x3a2f
movq %rbx, %rdi
callq 0x5f20
movq %rbx, %rdi
callq 0x256c
movzbl -0x74(%rbp), %esi
movq %rbx, %rdi
callq 0x2eb9
leaq 0x96a4(%rip), %rbx      # 0xd1e8
leaq 0x588c(%rip), %rsi      # 0x93d7
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2210
movq 0x9689(%rip), %rax      # 0xd1e8
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 0x3b98
jmp 0x3b98
jmp 0x3b98
movq %rax, %rbx
jmp 0x3bbb
jmp 0x3b9f
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3bbb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3bd4
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2310