// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %r12
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x20e0
leaq -0x34(%rbp), %rsi
movq %rax, %rdi
callq 0x20e0
leaq -0x3c(%rbp), %rsi
movq %rax, %rdi
callq 0x20e0
leaq -0xa4(%rbp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x20e0
leaq -0xa0(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20e0
leaq -0x9c(%rbp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x20e0
leaq -0x38(%rbp), %rax
movl (%rax), %esi
leaq -0x34(%rbp), %rax
movl (%rax), %edx
leaq -0x3c(%rbp), %rax
movl (%rax), %ecx
movl (%r13), %r8d
movl (%rbx), %r9d
movl (%r15), %eax
movl %eax, (%rsp)
movq %r12, -0x48(%rbp)
movq %r12, %rdi
callq 0x4130
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x20e0
leaq -0x30(%rbp), %r12
xorl %eax, %eax
cmpl -0x58(%rbp), %eax
jge 0x4932
movl %eax, -0x4c(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
andq $0x0, -0x90(%rbp)
xorl %eax, %eax
movb %al, -0x88(%rbp)
leaq -0x68(%rbp), %rcx
movq %rcx, -0x78(%rbp)
andq $0x0, -0x70(%rbp)
movb %al, -0x68(%rbp)
movq %r14, %rdi
leaq -0x54(%rbp), %rsi
callq 0x20e0
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x2200
movq %rax, %rdi
leaq -0x78(%rbp), %rsi
callq 0x2200
movl -0x54(%rbp), %r15d
leaq -0xc8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2240
leaq -0xe8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
callq 0x2240
movq -0x48(%rbp), %rdi
movl %r15d, %esi
leaq -0xc8(%rbp), %r15
movq %r15, %rdx
movq %rbx, %rcx
callq 0x41f2
movq %rax, %r13
movq %rbx, %rdi
callq 0x2358
movq %r15, %rdi
callq 0x2358
xorl %r15d, %r15d
cmpl -0x38(%rbp), %r15d
jge 0x48af
movq %r14, %rdi
movq %r12, %rsi
callq 0x20e0
movl -0x30(%rbp), %edx
movq %r13, %rdi
movl %r15d, %esi
callq 0x4da8
incl %r15d
jmp 0x488b
xorl %r15d, %r15d
cmpl -0x34(%rbp), %r15d
jge 0x48d6
movq %r14, %rdi
movq %r12, %rsi
callq 0x20e0
movl -0x30(%rbp), %edx
movq %r13, %rdi
movl %r15d, %esi
callq 0x4dc8
incl %r15d
jmp 0x48b2
xorl %r15d, %r15d
cmpl -0x3c(%rbp), %r15d
jge 0x48fa
movq %r14, %rdi
movq %r12, %rsi
callq 0x20e0
movl -0x30(%rbp), %esi
movq %r13, %rdi
callq 0x4de2
incl %r15d
jmp 0x48d9
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x2340
movss -0x50(%rbp), %xmm0
movq %r13, %rdi
callq 0x4df8
leaq -0x78(%rbp), %rdi
callq 0x2358
leaq -0x98(%rbp), %rdi
callq 0x2358
movl -0x4c(%rbp), %eax
incl %eax
jmp 0x47d1
xorl %r15d, %r15d
leaq -0x29(%rbp), %rbx
movslq -0x38(%rbp), %rax
cmpq %rax, %r15
jge 0x4965
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2140
cmpb $0x1, -0x29(%rbp)
jne 0x4960
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x1, (%rax,%r15)
incq %r15
jmp 0x4939
xorl %r15d, %r15d
leaq -0x29(%rbp), %rbx
movslq -0x34(%rbp), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2140
movb -0x29(%rbp), %al
cmpq %r12, %r15
jge 0x4999
testb %al, %al
je 0x4994
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, (%rax,%r15)
incq %r15
jmp 0x496c
testb %al, %al
je 0x49a5
movq -0x48(%rbp), %rax
movb $0x1, 0x24(%rax)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x49cb
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x2358
leaq -0xc8(%rbp), %rdi
callq 0x2358
jmp 0x49e4
jmp 0x49e1
jmp 0x49e1
jmp 0x49e1
jmp 0x49e1
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2358
leaq -0x98(%rbp), %rdi
callq 0x2358
movq %rbx, %rdi
callq 0x22d0
nop