// File: /workspace/github_cpp_makefile_star2_O3/t0mm4rx[P]piscine_cpp/day05/ex01/main.cpp
// Function: main
int main(void)
{
	Bureaucrat john("John", 3);
	Form deal("Deal", 11, 1);

	std::cout << john << std::endl;
	try
	{
		john.setGrade(151);
	}
	catch(std::exception)
	{
		std::cout << "Error when setting grade." << std::endl;
	}
	std::cout << john << std::endl;
	try
	{
		john.setGrade(1);
	}
	catch(std::exception)
	{
		std::cout << "Error when setting grade." << std::endl;
	}
	std::cout << john << std::endl;
	try
	{
		john.incrementGrade();
	}
	catch(std::exception)
	{
		std::cout << "Error when incrementing grade." << std::endl;
	}
	john.setGrade(10);
	std::cout << deal << std::endl;
	try
	{
		deal.beSigned(john);
	}
	catch(std::exception)
	{
		std::cout << john.getName() << " cant sign " << deal.getName() << " because its grade is too low." << std::endl;
	}
	john.signForm(deal);
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xf0, %rsp
leaq -0xb0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x14e1(%rip), %rsi      # 0x4141
leaq 0x14de(%rip), %rdx      # 0x4145
leaq -0xc0(%rbp), %rdi
callq 0x3184
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movl $0x3, %edx
callq 0x231c
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2ca3
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1491(%rip), %rsi      # 0x4146
leaq 0x148e(%rip), %rdx      # 0x414a
leaq -0xa0(%rbp), %rdi
callq 0x3184
leaq -0xf8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0xb, %edx
movl $0x1, %ecx
callq 0x280a
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d00
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x20e0
movq 0x32c9(%rip), %rdi      # 0x5fd0
leaq -0x60(%rbp), %rsi
callq 0x2592
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
leaq -0x60(%rbp), %rdi
movl $0x97, %esi
callq 0x237a
movq 0x3281(%rip), %rdi      # 0x5fd0
leaq -0x60(%rbp), %rsi
callq 0x2592
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
leaq -0x60(%rbp), %rdi
movl $0x1, %esi
callq 0x237a
movq 0x3239(%rip), %rdi      # 0x5fd0
leaq -0x60(%rbp), %rsi
callq 0x2592
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
leaq -0x60(%rbp), %rdi
callq 0x245e
leaq -0x60(%rbp), %rdi
movl $0xa, %esi
callq 0x237a
movq 0x31e8(%rip), %rdi      # 0x5fd0
leaq -0xf8(%rbp), %rsi
callq 0x298d
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
leaq -0xf8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2a70
leaq -0x60(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x247e
leaq -0xf8(%rbp), %rdi
callq 0x27a0
leaq -0x60(%rbp), %rdi
callq 0x2410
xorl %eax, %eax
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3167
movq %rbx, %rdi
callq 0x2100
movq 0x314c(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
callq 0x2050
leaq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2432
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x3128(%rip), %rdi      # 0x5fd0
callq 0x20f0
movq %rax, %rbx
leaq 0x12cd(%rip), %rsi      # 0x4184
movl $0xb, %edx
movq %rax, %rdi
callq 0x20f0
leaq -0x80(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x293c
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rbx
leaq 0x12a2(%rip), %rsi      # 0x4190
movl $0x1e, %edx
movq %rax, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2060
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f1c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f35
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x38(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2e2e
jmp 0x3164
jmp 0x2f54
movq %rax, %rbx
jmp 0x2f8e
movq %rax, %rbx
jmp 0x2f75
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f75
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f8e
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x38(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3167
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3167
movq %rbx, %rdi
callq 0x2100
movq 0x300c(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x2ffd(%rip), %rdi      # 0x5fd0
leaq 0x118b(%rip), %rsi      # 0x4165
movl $0x1e, %edx
callq 0x20f0
movq 0x2fe5(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2dd3
jmp 0x3164
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3167
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3167
movq %rbx, %rdi
callq 0x2100
movq 0x2f8f(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x2f80(%rip), %rdi      # 0x5fd0
leaq 0x10f4(%rip), %rsi      # 0x414b
movl $0x19, %edx
callq 0x20f0
movq 0x2f68(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d90
jmp 0x3164
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3167
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3167
movq %rbx, %rdi
callq 0x2100
movq 0x2f12(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x2f03(%rip), %rdi      # 0x5fd0
leaq 0x1077(%rip), %rsi      # 0x414b
movl $0x19, %edx
callq 0x20f0
movq 0x2eeb(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d48
jmp 0x3164
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3167
movq %rax, %rdi
callq 0x268d
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3173
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x3173
movq %rax, %rbx
jmp 0x3173
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x317c
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x317c
movq %rax, %rbx
jmp 0x317c
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x27a0
leaq -0x60(%rbp), %rdi
callq 0x2410
movq %rbx, %rdi
callq 0x2150