// File: 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
subq $0x1b0, %rsp            # imm = 0x1B0
movl $0x0, -0x4(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x2200
movq -0xe8(%rbp), %rdx
leaq 0x17d2(%rip), %rsi      # 0x4082
leaq -0x50(%rbp), %rdi
callq 0x2fb0
jmp 0x28bb
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x1b, %edx
callq 0x23c0
jmp 0x28cf
leaq -0x50(%rbp), %rdi
callq 0x2090
leaq -0x51(%rbp), %rdi
callq 0x2150
movq 0x36f0(%rip), %rdi      # 0x5fd8
leaq -0x30(%rbp), %rsi
callq 0x2650
movq %rax, -0xf0(%rbp)
jmp 0x28fa
movq -0xf0(%rbp), %rdi
movq 0x36b8(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x290f
movq 0x36c2(%rip), %rdi      # 0x5fd8
leaq 0x176a(%rip), %rsi      # 0x4087
callq 0x2110
movq %rax, -0xf8(%rbp)
jmp 0x292b
movq -0xf8(%rbp), %rdi
movq 0x3687(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2940
leaq -0x30(%rbp), %rdi
movl $0x97, %esi
callq 0x2420
jmp 0x2950
jmp 0x2a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2978
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2090
leaq -0x51(%rbp), %rdi
callq 0x2150
jmp 0x2f91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2f88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2f88
movq -0x60(%rbp), %rdi
callq 0x2050
movq %rax, -0x70(%rbp)
movq 0x3611(%rip), %rdi      # 0x5fd8
leaq 0x16d4(%rip), %rsi      # 0x40a2
callq 0x2110
movq %rax, -0x100(%rbp)
jmp 0x29dc
movq -0x70(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0x2110
movq %rax, -0x108(%rbp)
jmp 0x2a01
movq -0x108(%rbp), %rdi
leaq 0x1609(%rip), %rsi      # 0x4018
callq 0x2110
movq %rax, -0x110(%rbp)
jmp 0x2a1d
movq -0x110(%rbp), %rdi
movq 0x3595(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2a32
callq 0x21c0
jmp 0x2a39
jmp 0x2a3b
movq 0x3596(%rip), %rdi      # 0x5fd8
leaq -0x30(%rbp), %rsi
callq 0x2650
movq %rax, -0x118(%rbp)
jmp 0x2a54
movq -0x118(%rbp), %rdi
movq 0x355e(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2a69
movq 0x3568(%rip), %rdi      # 0x5fd8
leaq 0x1646(%rip), %rsi      # 0x40bd
callq 0x2110
movq %rax, -0x120(%rbp)
jmp 0x2a85
movq -0x120(%rbp), %rdi
movq 0x352d(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2a9a
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x2420
jmp 0x2aaa
jmp 0x2b6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x21c0
jmp 0x2ac2
jmp 0x2f88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2f88
movq -0x60(%rbp), %rdi
callq 0x2050
movq %rax, -0x78(%rbp)
movq 0x34e1(%rip), %rdi      # 0x5fd8
leaq 0x15a4(%rip), %rsi      # 0x40a2
callq 0x2110
movq %rax, -0x128(%rbp)
jmp 0x2b0c
movq -0x78(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x2110
movq %rax, -0x130(%rbp)
jmp 0x2b31
movq -0x130(%rbp), %rdi
leaq 0x14d9(%rip), %rsi      # 0x4018
callq 0x2110
movq %rax, -0x138(%rbp)
jmp 0x2b4d
movq -0x138(%rbp), %rdi
movq 0x3465(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2b62
callq 0x21c0
jmp 0x2b69
jmp 0x2b6b
movq 0x3466(%rip), %rdi      # 0x5fd8
leaq -0x30(%rbp), %rsi
callq 0x2650
movq %rax, -0x140(%rbp)
jmp 0x2b84
movq -0x140(%rbp), %rdi
movq 0x342e(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2b99
movq 0x3438(%rip), %rdi      # 0x5fd8
leaq 0x1530(%rip), %rsi      # 0x40d7
callq 0x2110
movq %rax, -0x148(%rbp)
jmp 0x2bb5
movq -0x148(%rbp), %rdi
movq 0x33fd(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2bca
leaq -0x30(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2420
jmp 0x2bda
jmp 0x2c9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x21c0
jmp 0x2bf2
jmp 0x2f88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2f88
movq -0x60(%rbp), %rdi
callq 0x2050
movq %rax, -0x80(%rbp)
movq 0x33b1(%rip), %rdi      # 0x5fd8
leaq 0x1474(%rip), %rsi      # 0x40a2
callq 0x2110
movq %rax, -0x150(%rbp)
jmp 0x2c3c
movq -0x80(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x2110
movq %rax, -0x158(%rbp)
jmp 0x2c61
movq -0x158(%rbp), %rdi
leaq 0x13a9(%rip), %rsi      # 0x4018
callq 0x2110
movq %rax, -0x160(%rbp)
jmp 0x2c7d
movq -0x160(%rbp), %rdi
movq 0x3335(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2c92
callq 0x21c0
jmp 0x2c99
jmp 0x2c9b
movq 0x3336(%rip), %rdi      # 0x5fd8
leaq -0x30(%rbp), %rsi
callq 0x2650
movq %rax, -0x168(%rbp)
jmp 0x2cb4
movq -0x168(%rbp), %rdi
movq 0x32fe(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2cc9
movq 0x3308(%rip), %rdi      # 0x5fd8
leaq 0x141b(%rip), %rsi      # 0x40f2
callq 0x2110
movq %rax, -0x170(%rbp)
jmp 0x2ce5
movq -0x170(%rbp), %rdi
movq 0x32cd(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2cfa
leaq -0x30(%rbp), %rdi
callq 0x25f0
jmp 0x2d05
jmp 0x2dcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x21c0
jmp 0x2d1d
jmp 0x2f88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2f88
movq -0x60(%rbp), %rdi
callq 0x2050
movq %rax, -0x88(%rbp)
movq 0x3283(%rip), %rdi      # 0x5fd8
leaq 0x13af(%rip), %rsi      # 0x410b
callq 0x2110
movq %rax, -0x178(%rbp)
jmp 0x2d6a
movq -0x88(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x178(%rbp), %rdi
movq %rax, %rsi
callq 0x2110
movq %rax, -0x180(%rbp)
jmp 0x2d92
movq -0x180(%rbp), %rdi
leaq 0x1278(%rip), %rsi      # 0x4018
callq 0x2110
movq %rax, -0x188(%rbp)
jmp 0x2dae
movq -0x188(%rbp), %rdi
movq 0x3204(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2dc3
callq 0x21c0
jmp 0x2dca
jmp 0x2dcc
movq 0x3205(%rip), %rdi      # 0x5fd8
leaq 0x1351(%rip), %rsi      # 0x412b
callq 0x2110
movq %rax, -0x190(%rbp)
jmp 0x2de8
movq -0x190(%rbp), %rdi
movq 0x31ca(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2dfd
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x2200
movq -0x198(%rbp), %rdx
leaq 0x133c(%rip), %rsi      # 0x415a
leaq -0xd0(%rbp), %rdi
callq 0x2fb0
jmp 0x2e2c
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x23c0
jmp 0x2e46
leaq -0xd0(%rbp), %rdi
callq 0x2090
leaq -0xd1(%rbp), %rdi
callq 0x2150
leaq -0xb0(%rbp), %rdi
callq 0x2580
jmp 0x2f57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x21c0
jmp 0x2e82
jmp 0x2f88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2ead
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2090
leaq -0xd1(%rbp), %rdi
callq 0x2150
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2f88
movq -0x60(%rbp), %rdi
callq 0x2050
movq %rax, -0xe0(%rbp)
movq 0x30f8(%rip), %rdi      # 0x5fd8
leaq 0x1279(%rip), %rsi      # 0x4160
callq 0x2110
movq %rax, -0x1a0(%rbp)
jmp 0x2ef5
movq -0xe0(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0x2110
movq %rax, -0x1a8(%rbp)
jmp 0x2f1d
movq -0x1a8(%rbp), %rdi
leaq 0x10ed(%rip), %rsi      # 0x4018
callq 0x2110
movq %rax, -0x1b0(%rbp)
jmp 0x2f39
movq -0x1b0(%rbp), %rdi
movq 0x3079(%rip), %rsi      # 0x5fc0
callq 0x2130
jmp 0x2f4e
callq 0x21c0
jmp 0x2f55
jmp 0x2f57
movl $0x0, -0x4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2580
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x21c0
jmp 0x2f86
jmp 0x2f88
leaq -0x30(%rbp), %rdi
callq 0x2580
movq -0x60(%rbp), %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x3060
nopw %cs:(%rax,%rax)
nopl (%rax)