// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x5d97(%rip), %rdi      # 0xafd0
leaq 0x23e6(%rip), %rsi      # 0x7626
callq 0x21d0
movq 0x5d94(%rip), %rdi      # 0xafe0
leaq 0x14(%rsp), %r14
movq %r14, %rsi
callq 0x2120
cmpl $-0x1, (%r14)
jne 0x5275
leaq 0x1f95(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x6472
callq 0x62a0
xorl %r15d, %r15d
leaq 0x5f79(%rip), %r12      # 0xb1f8
pushq $0x50
popq %r13
movabsq $0x100000000, %rbp      # imm = 0x100000000
xorl %r14d, %r14d
xorl %ebx, %ebx
movq (%r12), %rdi
movq 0x8(%r12), %rax
subq %rdi, %rax
cqto
idivq %r13
cmpq %rbx, %rax
jbe 0x52c2
addq %r15, %rdi
callq 0x39ec
cmpl %eax, 0x14(%rsp)
je 0x52fb
incq %rbx
addq %rbp, %r14
addq $0x50, %r15
jmp 0x5292
leaq 0x1f32(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x5643
movq 0x5cf6(%rip), %rdi      # 0xafd0
leaq 0x2108(%rip), %rsi      # 0x73e9
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
jmp 0x5623
movq 0x5cce(%rip), %rbp      # 0xafd0
movq %rbp, %rdi
callq 0x20f0
movq (%rbp), %rax
movq -0x18(%rax), %rax
pushq $0x15
popq %r13
movq %r13, 0x10(%rbp,%rax)
leaq 0x2322(%rip), %rsi      # 0x7644
movq %rbp, %rdi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rax
pushq $0xa
popq %rbx
movq %rbx, 0x10(%r15,%rax)
sarq $0x20, %r14
imulq $0x50, %r14, %r14
movq (%r12), %rdi
addq %r14, %rdi
callq 0x3a0e
movq %r15, %rdi
movl %eax, %esi
callq 0x2320
movq %rax, %rdi
callq 0x20f0
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %r13, 0x10(%rbp,%rax)
leaq 0x22e1(%rip), %rsi      # 0x7657
movq %rbp, %rdi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rax
movq %rbx, 0x10(%r15,%rax)
movq (%r12), %rdi
addq %r14, %rdi
callq 0x3b86
movq %r15, %rdi
movl %eax, %esi
callq 0x2320
movq %rax, %rdi
callq 0x20f0
movq (%rbp), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x18(%rbp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x18(%rbp,%rcx)
movq -0x18(%rax), %rcx
movq $0x2, 0x8(%rbp,%rcx)
movq -0x18(%rax), %rax
movq %r13, 0x10(%rbp,%rax)
leaq 0x228c(%rip), %rsi      # 0x766c
movq %rbp, %rdi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x9, 0x10(%r15,%rax)
movq (%r12), %rdi
addq %r14, %rdi
callq 0x3b86
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x10(%rsp)
movq (%r12), %rdi
addq %r14, %rdi
callq 0x3a0e
cvtsi2ss %eax, %xmm0
movss 0x10(%rsp), %xmm1
divss %xmm0, %xmm1
mulss 0x2111(%rip), %xmm1     # 0x7544
movaps %xmm1, %xmm0
movq %r15, %rdi
callq 0x2150
leaq 0x22c0(%rip), %rsi      # 0x7705
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq (%r12), %rax
movq 0x38(%rax,%r14), %rcx
movl 0x40(%rax,%r14), %edx
subq 0x28(%rax,%r14), %rcx
leaq (%rdx,%rcx,8), %rbx
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %r13, 0x10(%rbp,%rax)
leaq 0x21f9(%rip), %rsi      # 0x7679
movq %rbp, %rdi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rax
cmpq $0x6, %rbx
ja 0x54ad
movq $0xa, 0x10(%r15,%rax)
leaq 0x21df(%rip), %rsi      # 0x7687
movq %r15, %rdi
jmp 0x54d4
movq $0x9, 0x10(%r15,%rax)
movq (%r12), %rdi
addq %r14, %rdi
callq 0x3a32
movq %r15, %rdi
callq 0x2150
leaq 0x2234(%rip), %rsi      # 0x7705
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq (%r12), %rax
movq 0x38(%rax,%r14), %rcx
movl 0x40(%rax,%r14), %edx
subq 0x28(%rax,%r14), %rcx
leaq (%rdx,%rcx,8), %r15
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq $0x15, 0x10(%rbp,%rax)
leaq 0x217b(%rip), %rsi      # 0x768b
movq %rbp, %rdi
callq 0x21d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
cmpq $0x1d, %r15
ja 0x553d
movq $0xa, 0x10(%rbx,%rax)
leaq 0x214f(%rip), %rsi      # 0x7687
movq %rbx, %rdi
jmp 0x5564
movq $0x9, 0x10(%rbx,%rax)
addq (%r12), %r14
movq %r14, %rdi
callq 0x3adc
movq %rbx, %rdi
callq 0x2150
leaq 0x21a4(%rip), %rsi      # 0x7705
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq 0x5a58(%rip), %rbx      # 0xafd0
leaq 0x1cd3(%rip), %r15      # 0x7252
movq 0x5a5a(%rip), %r12      # 0xafe0
leaq 0xc(%rsp), %r13
leaq 0x1c69(%rip), %rbp      # 0x71fb
movq %rbx, %rdi
leaq 0x20fe(%rip), %rsi      # 0x769a
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2120
movl 0xc(%rsp), %r14d
cmpl $-0x1, %r14d
jne 0x55e9
movq %rbp, %rdi
callq 0x2190
callq 0x6472
callq 0x62a0
movl 0xc(%rsp), %r14d
movq %rbp, %rdi
callq 0x2190
cmpl $0x2, %r14d
je 0x562a
cmpl $0x1, %r14d
je 0x561e
callq 0x5643
movq %rbx, %rdi
leaq 0x1c51(%rip), %rsi      # 0x725d
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
jmp 0x5592
callq 0x5643
callq 0x5224
jmp 0x5634
callq 0x6472
callq 0x62a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq