// File: /workspace/github_cpp_makefile_star2_O1/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 0xa85(%rip), %rsi       # 0x30ac
leaq 0xa82(%rip), %rdx       # 0x30b0
leaq -0x80(%rbp), %rdi
callq 0x2c34
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x1b, %edx
callq 0x22cc
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x265e
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
movq 0x296b(%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 0x2931(%rip), %rbx      # 0x4fd0
leaq 0xa0b(%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 0x28ff(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0x97, %esi
callq 0x232a
movq 0x28dd(%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 0x28a3(%rip), %rbx      # 0x4fd0
leaq 0x9b3(%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 0x2871(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x232a
movq 0x284f(%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 0x2815(%rip), %rbx      # 0x4fd0
leaq 0x93f(%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 0x27e3(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x232a
movq 0x27c1(%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 0x2787(%rip), %rbx      # 0x4fd0
leaq 0x8cc(%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 0x2755(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x40(%rbp), %rdi
callq 0x240e
movq 0x2738(%rip), %rbx      # 0x4fd0
leaq 0x8b6(%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 0x2706(%rip), %rdi      # 0x4fd0
callq 0x2030
movq %rax, %rdi
callq 0x2080
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x89e(%rip), %rsi       # 0x3184
leaq 0x89c(%rip), %rdx       # 0x3189
leaq -0x60(%rbp), %rdi
callq 0x2c34
leaq -0xa8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x22cc
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x2920
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 0x2968
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x2968
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x2c14
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x264c(%rip), %rdi      # 0x4fd0
leaq 0x7ff(%rip), %rsi       # 0x318a
movl $0x20, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x262b(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x661(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x292c
jmp 0x2c11
movq %rax, %rbx
callq 0x2110
jmp 0x2c14
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c14
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x25ca(%rip), %rdi      # 0x4fd0
leaq 0x728(%rip), %rsi       # 0x3135
movl $0x1f, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x25a9(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x5df(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x2891
jmp 0x2c11
movq %rax, %rbx
callq 0x2110
jmp 0x2c14
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c14
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x2548(%rip), %rdi      # 0x4fd0
leaq 0x63d(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x2527(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x55d(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x2808
jmp 0x2c11
movq %rax, %rbx
callq 0x2110
jmp 0x2c14
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c14
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x24c6(%rip), %rdi      # 0x4fd0
leaq 0x5bb(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x24a5(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x4db(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x277a
jmp 0x2c11
movq %rax, %rbx
callq 0x2110
jmp 0x2c14
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2c14
movq %rbx, %rdi
callq 0x2050
movq %rax, %rbx
movq 0x2444(%rip), %rdi      # 0x4fd0
leaq 0x539(%rip), %rsi       # 0x30cc
movl $0x1a, %edx
callq 0x20f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x2423(%rip), %rdi      # 0x4fd0
movq %rax, %rsi
callq 0x20d0
movq %rax, %rbx
leaq 0x459(%rip), %rsi       # 0x3018
movl $0x1, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
callq 0x2110
jmp 0x26ec
jmp 0x2c11
movq %rax, %rbx
callq 0x2110
jmp 0x2c14
movq %rax, %rdi
callq 0x2c25
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c1d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x2c1d
movq %rax, %rbx
jmp 0x2c1d
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x23b6
movq %rbx, %rdi
callq 0x2140