// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0xe8, %rsp
leaq 0x77c(%rip), %rsi       # 0x3117
leaq -0xf0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x2d7e
leaq -0x58(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
pushq $0x3
popq %rdx
callq 0x231c
leaq -0xf0(%rbp), %rdi
callq 0x2060
leaq 0x748(%rip), %rsi       # 0x311c
leaq -0xd0(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x2d7e
leaq -0x90(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
pushq $0xb
popq %rdx
pushq $0x1
popq %rcx
callq 0x2668
leaq -0xd0(%rbp), %rdi
callq 0x2060
movq 0x25c0(%rip), %rdi      # 0x4fd0
leaq -0x58(%rbp), %rsi
callq 0x2504
movq %rax, %rdi
callq 0x2070
leaq -0x58(%rbp), %rdi
movl $0x97, %esi
callq 0x2352
movq 0x259a(%rip), %rdi      # 0x4fd0
leaq -0x58(%rbp), %rsi
callq 0x2504
movq %rax, %rdi
callq 0x2070
leaq -0x58(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2352
movq 0x2576(%rip), %rdi      # 0x4fd0
leaq -0x58(%rbp), %rsi
callq 0x2504
movq %rax, %rdi
callq 0x2070
leaq -0x58(%rbp), %rdi
callq 0x2402
leaq -0x58(%rbp), %rdi
pushq $0xa
popq %rsi
callq 0x2352
movq 0x2549(%rip), %rdi      # 0x4fd0
leaq -0x90(%rbp), %rsi
callq 0x2799
movq %rax, %rdi
callq 0x2070
leaq -0x90(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2838
leaq -0x58(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2422
leaq -0x90(%rbp), %rdi
callq 0x2630
leaq -0x58(%rbp), %rdi
callq 0x23e0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2d60
movq %rbx, %rdi
callq 0x20f0
movq 0x24d1(%rip), %rax      # 0x4fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2040
leaq -0x28(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x23ea
movq 0x24b5(%rip), %rdi      # 0x4fd0
leaq -0x28(%rbp), %rsi
callq 0x20c0
leaq 0x62f(%rip), %rsi       # 0x315a
movq %rax, %rdi
callq 0x20d0
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x275a
leaq -0xb0(%rbp), %rsi
movq %rbx, %rdi
callq 0x20c0
leaq 0x607(%rip), %rsi       # 0x3166
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0xb0(%rbp), %rdi
callq 0x2060
leaq -0x28(%rbp), %rdi
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2aab
jmp 0x2d5d
jmp 0x2ba3
movq %rax, %rbx
jmp 0x2bc0
movq %rax, %rbx
jmp 0x2bb7
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2060
leaq -0x28(%rbp), %rdi
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d60
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2d60
movq %rbx, %rdi
callq 0x20f0
movq 0x23da(%rip), %rax      # 0x4fc8
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq %rbx, %rdi
callq 0x2040
movq 0x23cb(%rip), %rdi      # 0x4fd0
leaq 0x52f(%rip), %rsi       # 0x313b
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2a74
jmp 0x2d5d
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d60
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2d60
movq %rbx, %rdi
callq 0x20f0
movq 0x2366(%rip), %rax      # 0x4fc8
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq %rbx, %rdi
callq 0x2040
movq 0x2357(%rip), %rdi      # 0x4fd0
leaq 0x4a1(%rip), %rsi       # 0x3121
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2a53
jmp 0x2d5d
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d60
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2d60
movq %rbx, %rdi
callq 0x20f0
movq 0x22f2(%rip), %rax      # 0x4fc8
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq %rbx, %rdi
callq 0x2040
movq 0x22e3(%rip), %rdi      # 0x4fd0
leaq 0x42d(%rip), %rsi       # 0x3121
callq 0x20d0
movq %rax, %rdi
callq 0x2070
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2a2f
jmp 0x2d5d
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d60
movq %rax, %rdi
callq 0x25bf
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2060
jmp 0x2d6c
movq %rax, %rbx
jmp 0x2d6c
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x2060
jmp 0x2d75
movq %rax, %rbx
jmp 0x2d75
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x2630
leaq -0x58(%rbp), %rdi
callq 0x23e0
movq %rbx, %rdi
callq 0x2150
nop