// File: tbonelaforge[P]gradebook/Gradebook.cpp
// Function: Gradebook::deserialize(std::istream&)
void Gradebook::deserialize(istream& in) {
    int numPrograms, numTests, numFinals;
    int programsWeight, testsWeight, finalExamWeight;
    int numStudents;
    bool recorded;
    in >> numPrograms >> numTests >> numFinals;
    in >> programsWeight >> testsWeight >> finalExamWeight;
    initialize(
               numPrograms,
               numTests,
               numFinals,
               programsWeight,
               testsWeight,
               finalExamWeight
               );
    in >> numStudents;
    for (int n = 0; n < numStudents; n++) {
        int i, j, k, grade, id;
        string firstName, lastName;
        float finalAverage;
        in >> id >> firstName >> lastName;
        Student * student = addStudent(id, firstName, lastName);
        for (int i = 0; i < numPrograms; i++) {
            in >> grade;
            student->setProgramGrade(i, grade);
        }
        for (int i = 0; i < numTests; i++) {
            in >> grade;
            student->setTestGrade(i, grade);
        }
        for (int i = 0; i < numFinals; i++) {
            in >> grade;
            student->setFinalExamGrade(grade);
        }
        in >> finalAverage;
        student->setFinalAverage(finalAverage);
    }
    for (int i = 0; i < numPrograms; i++) {
        in >> recorded;
        if (recorded) {
            setProgramRecorded(i);
        }
    }
    for (int i = 0; i < numTests; i++) {
        in >> recorded;
        if (recorded) {
            setTestRecorded(i);
        }
    }
    in >> recorded;
    if (recorded) {
        setFinalExamRecorded();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x3150
movq %rax, %rdi
leaq -0x18(%rbp), %rsi
callq 0x3150
movq %rax, %rdi
leaq -0x1c(%rbp), %rsi
callq 0x3150
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3150
movq %rax, %rdi
leaq -0x24(%rbp), %rsi
callq 0x3150
movq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x3150
movq -0x108(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x6000
movq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3150
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x6cda
leaq -0x68(%rbp), %rdi
callq 0x3350
leaq -0x88(%rbp), %rdi
callq 0x3350
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3150
movq %rax, -0x110(%rbp)
jmp 0x6a86
movq -0x110(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3310
movq %rax, -0x118(%rbp)
jmp 0x6a9f
movq -0x118(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3310
jmp 0x6ab4
movl -0x48(%rbp), %eax
movl %eax, -0x11c(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x30f0
jmp 0x6acf
leaq -0xe8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x30f0
jmp 0x6ae4
movl -0x11c(%rbp), %esi
movq -0x108(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
leaq -0xe8(%rbp), %rcx
callq 0x6150
movq %rax, -0x128(%rbp)
jmp 0x6b0d
leaq -0xe8(%rbp), %rdi
callq 0x3498
leaq -0xc8(%rbp), %rdi
callq 0x3498
movq -0x128(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0xec(%rbp)
movl -0xec(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x6bdf
movq -0x10(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x3150
jmp 0x6b5b
movq -0xa8(%rbp), %rdi
movl -0xec(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x7640
jmp 0x6b72
jmp 0x6b74
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x6b3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x6cc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x6bce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3498
leaq -0xc8(%rbp), %rdi
callq 0x3498
jmp 0x6cc0
movl $0x0, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x6c2d
movq -0x10(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x3150
jmp 0x6c03
movq -0xa8(%rbp), %rdi
movl -0xf0(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x7690
jmp 0x6c1a
jmp 0x6c1c
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0x6be9
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6c75
movq -0x10(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x3150
jmp 0x6c51
movq -0xa8(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x76e0
jmp 0x6c62
jmp 0x6c64
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x6c37
movq -0x10(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
callq 0x3090
jmp 0x6c87
movq -0xa8(%rbp), %rdi
movss -0x8c(%rbp), %xmm0
callq 0x7720
jmp 0x6c9d
leaq -0x88(%rbp), %rdi
callq 0x3498
leaq -0x68(%rbp), %rdi
callq 0x3498
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6a4f
leaq -0x88(%rbp), %rdi
callq 0x3498
leaq -0x68(%rbp), %rdi
callq 0x3498
jmp 0x6d9c
movl $0x0, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x6d27
movq -0x10(%rbp), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x31e0
testb $0x1, -0x2d(%rbp)
je 0x6d14
movq -0x108(%rbp), %rdi
movl -0xf8(%rbp), %esi
callq 0x6db0
jmp 0x6d16
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x6ce4
movl $0x0, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x6d74
movq -0x10(%rbp), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x31e0
testb $0x1, -0x2d(%rbp)
je 0x6d61
movq -0x108(%rbp), %rdi
movl -0xfc(%rbp), %esi
callq 0x6dd0
jmp 0x6d63
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x6d31
movq -0x10(%rbp), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x31e0
testb $0x1, -0x2d(%rbp)
je 0x6d93
movq -0x108(%rbp), %rdi
callq 0x6df0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x33f0
nopl (%rax,%rax)