// File: /workspace/github_cpp_makefile_star2_O1/ruankotovich[P]B-Tree/src/iohandler.cpp
// Function: IOHandler::getBiggestId()
int IOHandler::getBiggestId(){

  int idBuffer;
  int bigger = 0;
  unsigned long backupPosition = ftell(this->file);
  fseek(this->file, 0, SEEK_SET);
  while (fscanf(this->file, "\"%d\";", &idBuffer) == 1) {
    // READ TITLE
    readNIgnoreColumn(this->file, ';');
    // READ YEAR
    fscanf(this->file, "\"%*d\";");

    // READ AUTHOR
    readNIgnoreColumn(this->file,  ';');

    // READ CITATION
    fscanf(this->file, "\"%*d\";");

    // READ DATE
    readNIgnoreColumn(this->file, ';');

    // READ SNIPPET
    readNIgnoreColumn(this->file, ';');

    if(idBuffer > bigger){
      bigger = idBuffer;
    }
  }

  fseek(this->file, backupPosition, SEEK_SET);

  return bigger;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1030
movq %rax, 0x10(%rsp)
movq (%rbx), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
xorl %edx, %edx
callq 0x10d0
movq (%rbx), %rdi
leaq 0x2ca1(%rip), %rsi      # 0x4004
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1170
cmpl $0x1, %eax
jne 0x15d5
leaq 0x2c9d(%rip), %rbp      # 0x401c
leaq 0x2c84(%rip), %r14      # 0x400a
xorl %r15d, %r15d
movq (%rbx), %r12
movq %r12, %rdi
callq 0x1130
movq %r12, %rdi
cmpb $0x4e, %al
jne 0x13c9
leaq 0x2c6f(%rip), %rsi      # 0x4011
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
leaq 0x2c63(%rip), %rsi      # 0x4016
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1170
jmp 0x140b
callq 0x1130
movl %eax, %r13d
movq %r12, %rdi
callq 0x1130
cmpb $0xd, %r13b
je 0x13f9
movzbl %r13b, %ecx
movl %eax, %r13d
cmpl $0x22, %ecx
jne 0x13d1
cmpb $0xa, %al
je 0x140b
movzbl %al, %ecx
cmpl $0x3b, %ecx
jne 0x1400
jmp 0x140b
cmpb $0xa, %al
je 0x140b
movzbl %al, %ecx
movl %eax, %r13d
cmpl $0xff, %ecx
jne 0x13d1
movq (%rbx), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1170
movq (%rbx), %r12
movq %r12, %rdi
callq 0x1130
movq %r12, %rdi
cmpb $0x4e, %al
jne 0x1458
leaq 0x2be0(%rip), %rsi      # 0x4011
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
leaq 0x2bd4(%rip), %rsi      # 0x4016
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1170
jmp 0x149a
callq 0x1130
movl %eax, %r13d
movq %r12, %rdi
callq 0x1130
cmpb $0xd, %r13b
je 0x1488
movzbl %r13b, %ecx
movl %eax, %r13d
cmpl $0x22, %ecx
jne 0x1460
cmpb $0xa, %al
je 0x149a
movzbl %al, %ecx
cmpl $0x3b, %ecx
jne 0x148f
jmp 0x149a
cmpb $0xa, %al
je 0x149a
movzbl %al, %ecx
movl %eax, %r13d
cmpl $0xff, %ecx
jne 0x1460
movq (%rbx), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1170
movq (%rbx), %r12
movq %r12, %rdi
callq 0x1130
movq %r12, %rdi
cmpb $0x4e, %al
jne 0x14e7
leaq 0x2b51(%rip), %rsi      # 0x4011
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
leaq 0x2b45(%rip), %rsi      # 0x4016
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1170
jmp 0x1529
callq 0x1130
movl %eax, %r13d
movq %r12, %rdi
callq 0x1130
cmpb $0xd, %r13b
je 0x1517
movzbl %r13b, %ecx
movl %eax, %r13d
cmpl $0x22, %ecx
jne 0x14ef
cmpb $0xa, %al
je 0x1529
movzbl %al, %ecx
cmpl $0x3b, %ecx
jne 0x151e
jmp 0x1529
cmpb $0xa, %al
je 0x1529
movzbl %al, %ecx
movl %eax, %r13d
cmpl $0xff, %ecx
jne 0x14ef
movq (%rbx), %r12
movq %r12, %rdi
callq 0x1130
movq %r12, %rdi
cmpb $0x4e, %al
jne 0x1569
leaq 0x2acf(%rip), %rsi      # 0x4011
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
leaq 0x2ac3(%rip), %rsi      # 0x4016
xorl %eax, %eax
callq 0x1170
movq %r12, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1170
jmp 0x15ab
callq 0x1130
movl %eax, %r13d
movq %r12, %rdi
callq 0x1130
cmpb $0xd, %r13b
je 0x1599
movzbl %r13b, %ecx
movl %eax, %r13d
cmpl $0x22, %ecx
jne 0x1571
cmpb $0xa, %al
je 0x15ab
movzbl %al, %ecx
cmpl $0x3b, %ecx
jne 0x15a0
jmp 0x15ab
cmpb $0xa, %al
je 0x15ab
movzbl %al, %ecx
movl %eax, %r13d
cmpl $0xff, %ecx
jne 0x1571
movl 0xc(%rsp), %eax
cmpl %r15d, %eax
cmovgl %eax, %r15d
movq (%rbx), %rdi
leaq 0x2a44(%rip), %rsi      # 0x4004
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x1170
cmpl $0x1, %eax
je 0x1389
movq (%rbx), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x10d0
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq