// File: /workspace/github_cpp_makefile_star2_O3/t0mm4rx[P]piscine_cpp/day05/ex00/main.cpp
// Function: main
int main(void)
{
	Bureaucrat john("John", 27);

	std::cout << john << std::endl;
	std::cout << "-- Setting grade to 151 --" << std::endl;
	try
	{
		john.setGrade(151);
	}
	catch(std::exception &e)
	{
		std::cout << "Error when setting grade: " << e.what() << "." << std::endl;
	}
	std::cout << john << std::endl;
	std::cout << "-- Setting grade to 1. --" << std::endl;
	try
	{
		john.setGrade(1);
	}
	catch(std::exception &e)
	{
		std::cout << "Error when setting grade: " << e.what() << "." << std::endl;
	}
	std::cout << john << std::endl;
	std::cout << "-- Setting grade to -1. --" << std::endl;
	try
	{
		john.setGrade(-1);
	}
	catch(std::exception &e)
	{
		std::cout << "Error when setting grade: " << e.what() << "." << std::endl;
	}
	std::cout << john << std::endl;
	std::cout << "-- Incrementing grade --" << std::endl;
	try
	{
		john.incrementGrade();
	}
	catch(std::exception &e)
	{
		std::cout << "Error when incrementing grade: " << e.what() << "." << std::endl;
	}
	std::cout << "-- Creating a Bureaucrat with invalid grade --"<< std::endl;
	try
	{
		Bureaucrat alice("Alice", 500);
	}
	catch(std::exception &e)
	{
		std::cout << "Error when creating Bureaucrat: " << e.what() << "." << std::endl;
	}
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
leaq -0x70(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xa81(%rip), %rsi       # 0x30ac
leaq 0xa7e(%rip), %rdx       # 0x30b0
leaq -0x80(%rbp), %rdi
callq 0x2c38
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x1b, %edx
callq 0x22cc
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x2662
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
movq 0x2967(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x242d
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movq 0x292d(%rip), %rbx      # 0x4fd0
leaq 0xa07(%rip), %rsi       # 0x30b1
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x20f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq 0x28fb(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0x97, %esi
callq 0x232a
movq 0x28d9(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x242d
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movq 0x289f(%rip), %rbx      # 0x4fd0
leaq 0x9af(%rip), %rsi       # 0x30e7
movl $0x19, %edx
movq %rbx, %rdi
callq 0x20f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq 0x286d(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x232a
movq 0x284b(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x242d
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movq 0x2811(%rip), %rbx      # 0x4fd0
leaq 0x93b(%rip), %rsi       # 0x3101
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x20f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq 0x27df(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x232a
movq 0x27bd(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x242d
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2080
movq 0x2783(%rip), %rbx      # 0x4fd0
leaq 0x8c8(%rip), %rsi       # 0x311c
movl $0x18, %edx
movq %rbx, %rdi
callq 0x20f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq 0x2751(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
callq 0x240e
movq 0x2734(%rip), %rbx      # 0x4fd0
leaq 0x8b2(%rip), %rsi       # 0x3155
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x20f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq 0x2702(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x89a(%rip), %rsi       # 0x3184
leaq 0x898(%rip), %rdx       # 0x3189
leaq -0x60(%rbp), %rdi
callq 0x2c38
leaq -0xa8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x22cc
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x2924
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0xa8(%rbp), %rdi
callq 0x23b6
leaq -0x40(%rbp), %rdi
callq 0x23b6
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x296c
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x296c
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x2c18
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x2648(%rip), %rdi      # 0x4fd0
leaq 0x7fb(%rip), %rsi       # 0x318a
movl $0x20, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x2627(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x65d(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x2930
jmp 0x2c15
movq %rax, %rbx
callq 0x2110
jmp 0x2c18
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c18
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x25c6(%rip), %rdi      # 0x4fd0
leaq 0x724(%rip), %rsi       # 0x3135
movl $0x1f, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x25a5(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x5db(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x2895
jmp 0x2c15
movq %rax, %rbx
callq 0x2110
jmp 0x2c18
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c18
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x2544(%rip), %rdi      # 0x4fd0
leaq 0x639(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x2523(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x559(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x280c
jmp 0x2c15
movq %rax, %rbx
callq 0x2110
jmp 0x2c18
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c18
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x24c2(%rip), %rdi      # 0x4fd0
leaq 0x5b7(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x24a1(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x4d7(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x277e
jmp 0x2c15
movq %rax, %rbx
callq 0x2110
jmp 0x2c18
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c18
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x2440(%rip), %rdi      # 0x4fd0
leaq 0x535(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x241f(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x455(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x26f0
jmp 0x2c15
movq %rax, %rbx
callq 0x2110
jmp 0x2c18
movq %rax, %rdi
callq 0x2c29
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c21
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x2c21
movq %rax, %rbx
jmp 0x2c21
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x23b6
movq %rbx, %rdi
callq 0x2140