// File: TasnimAnas[P]Attendance-Management-System/src/pastAttendance.cpp
// Function: pastAttendance()
void pastAttendance()
{
     int roll;
     cout << "Enter roll to check details: ";
     cin >> roll;
     if (roll == -1)
     {
          system("CLS");
          userHomeHeader();
          userHome();
     }
     int position = -1;
     for (int i = 0; i < ::Student.size(); i++)
     {
          int stRoll = ::Student[i].getRoll();
          if (roll == stRoll)
          {
               position = i;
               break;
          }
     }
     if (position != -1)
     {
          cout << endl;
          cout << setw(21) << "Total Class Days: " << setw(10) << Student[position].getTotalDays() << endl;
          cout << setw(21) << "Total Present Days: " << setw(10) << Student[position].getTotalPresentDays() << endl;
          cout << fixed;
          cout << setprecision(2);
          cout << setw(21) << "Parcentage: " << setw(9) << (float(Student[position].getTotalPresentDays()) / (Student[position].getTotalDays())) * 100 << "%" << endl;
          if (Student[position].isPresent.size() < 7)
          {
               cout << setw(21) << "Last 7 Days: " << setw(10) << "N/A" << endl;
          }
          else
          {
               cout << setw(21) << "Last 7 Days: " << setw(9) << Student[position].getLast7() << "%" << endl;
          }
          if (Student[position].isPresent.size() < 30)
          {
               cout << setw(21) << "Last 30 Days: " << setw(10) << "N/A" << endl;
          }
          else
          {
               cout << setw(21) << "Last 30 Days: " << setw(9) << Student[position].getLast30() << "%" << endl;
          }

     input:
          cout << "1. Check another" << endl;
          cout << "2. Go back" << endl;
          int StdRemoveSelection;
          cin >> StdRemoveSelection;
          if (StdRemoveSelection == -1)
          {
               system("CLS");
               userHomeHeader();
               userHome();
          }
          switch (StdRemoveSelection)
          {
          case 1:
               system("CLS");
               pastAttendanceHeader();
               pastAttendance();
               break;
          case 2:
               system("CLS");
               userHomeHeader();
               userHome();
               break;
          default:
               system("CLS");
               pastAttendanceHeader();
               cout << "Invalid selection! Try again: " << endl;
               goto input;
               break;
          }
     }
     else
     {
          system("CLS");
          pastAttendanceHeader();
          cout << "Roll not found! Try again: " << endl
               << endl;
          pastAttendance();
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq 0x8d7e(%rip), %rdi      # 0x13fd0
leaq 0x3405(%rip), %rsi      # 0xe65e
callq 0x3270
movq 0x8d7b(%rip), %rdi      # 0x13fe0
leaq -0x4(%rbp), %rsi
callq 0x3170
cmpl $-0x1, -0x4(%rbp)
jne 0xb28a
leaq 0x2f80(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xd280
callq 0xd020
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x9009(%rip), %rdi      # 0x142b0
callq 0x4860
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0xb2f0
movslq -0xc(%rbp), %rsi
leaq 0x8fed(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7630
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0xb2e3
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0xb2f0
jmp 0xb2e5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xb298
cmpl $-0x1, -0x8(%rbp)
je 0xb856
movq 0x8ccf(%rip), %rdi      # 0x13fd0
movq 0x8cb0(%rip), %rsi      # 0x13fb8
callq 0x32a0
movl $0x15, %edi
callq 0x4890
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movq 0x8cac(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x3349(%rip), %rsi      # 0xe67c
callq 0x3270
movq %rax, -0x90(%rbp)
movl $0xa, %edi
callq 0x4890
movq -0x90(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x32f0
movq %rax, -0x88(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8f43(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x76d0
movq -0x88(%rbp), %rdi
movl %eax, %esi
callq 0x3450
movq %rax, %rdi
movq 0x8c26(%rip), %rsi      # 0x13fb8
callq 0x32a0
movl $0x15, %edi
callq 0x4890
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
movq 0x8c22(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x32d2(%rip), %rsi      # 0xe68f
callq 0x3270
movq %rax, -0x80(%rbp)
movl $0xa, %edi
callq 0x4890
movq -0x80(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0x32f0
movq %rax, -0x78(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8ec2(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7930
movq -0x78(%rbp), %rdi
movl %eax, %esi
callq 0x3450
movq %rax, %rdi
movq 0x8ba8(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq 0x8bb4(%rip), %rdi      # 0x13fd0
leaq -0xcd3(%rip), %rsi      # 0xa750
callq 0x30c0
movl $0x2, %edi
callq 0xa780
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
movq 0x8b91(%rip), %rdi      # 0x13fd0
callq 0x33f0
movl $0x15, %edi
callq 0x4890
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %esi
movq 0x8b75(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x323a(%rip), %rsi      # 0xe6a4
callq 0x3270
movq %rax, -0x70(%rbp)
movl $0x9, %edi
callq 0x4890
movq -0x70(%rbp), %rdi
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %esi
callq 0x32f0
movq %rax, -0x60(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8e15(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7930
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x64(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8df4(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x76d0
movss -0x64(%rbp), %xmm0
movq -0x60(%rbp), %rdi
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movss 0x3062(%rip), %xmm1     # 0xe544
mulss %xmm1, %xmm0
callq 0x31d0
movq %rax, %rdi
leaq 0x3248(%rip), %rsi      # 0xe73d
callq 0x3270
movq %rax, %rdi
movq 0x8ab4(%rip), %rsi      # 0x13fb8
callq 0x32a0
movslq -0x8(%rbp), %rsi
leaq 0x8d9c(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
addq $0x28, %rdi
callq 0x5a50
cmpq $0x7, %rax
jae 0xb59c
movl $0x15, %edi
callq 0x4890
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %esi
movq 0x8a8e(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x3160(%rip), %rsi      # 0xe6b1
callq 0x3270
movq %rax, -0x98(%rbp)
movl $0xa, %edi
callq 0x4890
movq -0x98(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
callq 0x32f0
movq %rax, %rdi
leaq 0x313c(%rip), %rsi      # 0xe6bf
callq 0x3270
movq %rax, %rdi
movq 0x8a26(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0xb633
movl $0x15, %edi
callq 0x4890
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %esi
movq 0x8a1d(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x30ef(%rip), %rsi      # 0xe6b1
callq 0x3270
movq %rax, -0xa8(%rbp)
movl $0x9, %edi
callq 0x4890
movq -0xa8(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
callq 0x32f0
movq %rax, -0xa0(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8cb4(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7730
movq -0xa0(%rbp), %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x311e(%rip), %rsi      # 0xe73d
callq 0x3270
movq %rax, %rdi
movq 0x898a(%rip), %rsi      # 0x13fb8
callq 0x32a0
movslq -0x8(%rbp), %rsi
leaq 0x8c72(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
addq $0x28, %rdi
callq 0x5a50
cmpq $0x1e, %rax
jae 0xb6c6
movl $0x15, %edi
callq 0x4890
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %esi
movq 0x8964(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x3048(%rip), %rsi      # 0xe6c3
callq 0x3270
movq %rax, -0xb0(%rbp)
movl $0xa, %edi
callq 0x4890
movq -0xb0(%rbp), %rdi
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
callq 0x32f0
movq %rax, %rdi
leaq 0x3012(%rip), %rsi      # 0xe6bf
callq 0x3270
movq %rax, %rdi
movq 0x88fc(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0xb75d
movl $0x15, %edi
callq 0x4890
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %esi
movq 0x88f3(%rip), %rdi      # 0x13fd0
callq 0x32f0
movq %rax, %rdi
leaq 0x2fd7(%rip), %rsi      # 0xe6c3
callq 0x3270
movq %rax, -0xc0(%rbp)
movl $0x9, %edi
callq 0x4890
movq -0xc0(%rbp), %rdi
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %esi
callq 0x32f0
movq %rax, -0xb8(%rbp)
movslq -0x8(%rbp), %rsi
leaq 0x8b8a(%rip), %rdi      # 0x142b0
callq 0x48b0
movq %rax, %rdi
callq 0x7830
movq -0xb8(%rbp), %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x2ff4(%rip), %rsi      # 0xe73d
callq 0x3270
movq %rax, %rdi
movq 0x8860(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0xb75f
movq 0x886a(%rip), %rdi      # 0x13fd0
leaq 0x2f65(%rip), %rsi      # 0xe6d2
callq 0x3270
movq %rax, %rdi
movq 0x883c(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq 0x8848(%rip), %rdi      # 0x13fd0
leaq 0x2ac3(%rip), %rsi      # 0xe252
callq 0x3270
movq %rax, %rdi
movq 0x881a(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq 0x8836(%rip), %rdi      # 0x13fe0
leaq -0x50(%rbp), %rsi
callq 0x3170
cmpl $-0x1, -0x50(%rbp)
jne 0xb7cf
leaq 0x2a3b(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xd280
callq 0xd020
movl -0x50(%rbp), %eax
movl %eax, -0xc4(%rbp)
subl $0x1, %eax
je 0xb7ec
jmp 0xb7df
movl -0xc4(%rbp), %eax
subl $0x2, %eax
je 0xb804
jmp 0xb81c
leaq 0x2a08(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xb8b0
callq 0xb240
jmp 0xb854
leaq 0x29f0(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xd280
callq 0xd020
jmp 0xb854
leaq 0x29d8(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xb8b0
movq 0x879c(%rip), %rdi      # 0x13fd0
leaq 0x2a22(%rip), %rsi      # 0xe25d
callq 0x3270
movq %rax, %rdi
movq 0x876e(%rip), %rsi      # 0x13fb8
callq 0x32a0
jmp 0xb75f
jmp 0xb89d
leaq 0x299e(%rip), %rdi      # 0xe1fb
callq 0x3230
callq 0xb8b0
movq 0x8762(%rip), %rdi      # 0x13fd0
leaq 0x2b74(%rip), %rsi      # 0xe3e9
callq 0x3270
movq %rax, %rdi
movq 0x8734(%rip), %rsi      # 0x13fb8
callq 0x32a0
movq %rax, %rdi
movq 0x8725(%rip), %rsi      # 0x13fb8
callq 0x32a0
callq 0xb240
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)