// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0xa0, %rsp
leaq 0xba1(%rip), %rsi       # 0x3082
leaq -0x80(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x28f8
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
pushq $0x1b
popq %rdx
callq 0x22cc
leaq -0x80(%rbp), %rdi
callq 0x2060
movq 0x2abf(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x23d1
movq %rax, %rdi
callq 0x2070
movq 0x2aa7(%rip), %rdi      # 0x4fd0
leaq 0xb57(%rip), %rsi       # 0x3087
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x40(%rbp), %rdi
movl $0x97, %esi
callq 0x2302
movq 0x2a7e(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x23d1
movq %rax, %rdi
callq 0x2070
movq 0x2a66(%rip), %rdi      # 0x4fd0
leaq 0xb4c(%rip), %rsi       # 0x30bd
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x40(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2302
movq 0x2a3f(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x23d1
movq %rax, %rdi
callq 0x2070
movq 0x2a27(%rip), %rdi      # 0x4fd0
leaq 0xb27(%rip), %rsi       # 0x30d7
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x40(%rbp), %rdi
pushq $-0x1
popq %rsi
callq 0x2302
movq 0x2a00(%rip), %rdi      # 0x4fd0
leaq -0x40(%rbp), %rsi
callq 0x23d1
movq %rax, %rdi
callq 0x2070
movq 0x29e8(%rip), %rdi      # 0x4fd0
leaq 0xb03(%rip), %rsi       # 0x30f2
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x40(%rbp), %rdi
callq 0x23b2
movq 0x29c4(%rip), %rdi      # 0x4fd0
leaq 0xb18(%rip), %rsi       # 0x312b
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq 0xb33(%rip), %rsi       # 0x315a
leaq -0x60(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x28f8
leaq -0xa8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x22cc
leaq -0x60(%rbp), %rdi
callq 0x2060
leaq -0xa8(%rbp), %rdi
callq 0x2386
leaq -0x40(%rbp), %rdi
callq 0x2386
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rdx, %r14
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2060
jmp 0x268c
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x28e6
movq %rbx, %rdi
callq 0x2040
movq %rax, %rbx
movq 0x2928(%rip), %rdi      # 0x4fd0
leaq 0xab1(%rip), %rsi       # 0x3160
callq 0x20d0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x20d0
leaq 0x946(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
callq 0x2110
jmp 0x265e
jmp 0x28e3
movq %rax, %rbx
callq 0x2110
jmp 0x28e6
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x28e6
movq %rbx, %rdi
callq 0x2040
movq %rax, %rbx
movq 0x28b4(%rip), %rdi      # 0x4fd0
leaq 0x9e8(%rip), %rsi       # 0x310b
callq 0x20d0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x20d0
leaq 0x8d2(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
callq 0x2110
jmp 0x2605
jmp 0x28e3
movq %rax, %rbx
callq 0x2110
jmp 0x28e6
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x28e6
movq %rbx, %rdi
callq 0x2040
movq %rax, %rbx
movq 0x2840(%rip), %rdi      # 0x4fd0
leaq 0x90b(%rip), %rsi       # 0x30a2
callq 0x20d0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x20d0
leaq 0x85e(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
callq 0x2110
jmp 0x25c9
jmp 0x28e3
movq %rax, %rbx
callq 0x2110
jmp 0x28e6
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x28e6
movq %rbx, %rdi
callq 0x2040
movq %rax, %rbx
movq 0x27cc(%rip), %rdi      # 0x4fd0
leaq 0x897(%rip), %rsi       # 0x30a2
callq 0x20d0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x20d0
leaq 0x7ea(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
callq 0x2110
jmp 0x258a
jmp 0x28e3
movq %rax, %rbx
callq 0x2110
jmp 0x28e6
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x28e6
movq %rbx, %rdi
callq 0x2040
movq %rax, %rbx
movq 0x2758(%rip), %rdi      # 0x4fd0
leaq 0x823(%rip), %rsi       # 0x30a2
callq 0x20d0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x20d0
leaq 0x776(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
callq 0x2110
jmp 0x254b
jmp 0x28e3
movq %rax, %rbx
callq 0x2110
jmp 0x28e6
movq %rax, %rdi
callq 0x2933
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x2060
jmp 0x28ef
movq %rax, %rbx
jmp 0x28ef
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x2386
movq %rbx, %rdi
callq 0x2140
nop