// File: /workspace/github_cpp_makefile_star2_O1/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 0x14e5(%rip), %rsi      # 0x4141
leaq 0x14e2(%rip), %rdx      # 0x4145
leaq -0xc0(%rbp), %rdi
callq 0x3180
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movl $0x3, %edx
callq 0x231c
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c9f
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1495(%rip), %rsi      # 0x4146
leaq 0x1492(%rip), %rdx      # 0x414a
leaq -0xa0(%rbp), %rdi
callq 0x3180
leaq -0xf8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0xb, %edx
movl $0x1, %ecx
callq 0x2806
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2cfc
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x20e0
movq 0x32cd(%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 0x3285(%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 0x323d(%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 0x31ec(%rip), %rdi      # 0x5fd0
leaq -0xf8(%rbp), %rsi
callq 0x2989
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 0x2a6c
leaq -0x60(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x247e
leaq -0xf8(%rbp), %rdi
callq 0x279c
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 0x3163
movq %rbx, %rdi
callq 0x2100
movq 0x3150(%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 0x312c(%rip), %rdi      # 0x5fd0
callq 0x20f0
movq %rax, %rbx
leaq 0x12d1(%rip), %rsi      # 0x4184
movl $0xb, %edx
movq %rax, %rdi
callq 0x20f0
leaq -0x80(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x2938
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rbx
leaq 0x12a6(%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 0x2f18
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f31
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x38(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2e2a
jmp 0x3160
jmp 0x2f50
movq %rax, %rbx
jmp 0x2f8a
movq %rax, %rbx
jmp 0x2f71
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f71
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f8a
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x20e0
leaq -0x38(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3163
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3163
movq %rbx, %rdi
callq 0x2100
movq 0x3010(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x3001(%rip), %rdi      # 0x5fd0
leaq 0x118f(%rip), %rsi      # 0x4165
movl $0x1e, %edx
callq 0x20f0
movq 0x2fe9(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2dcf
jmp 0x3160
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3163
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3163
movq %rbx, %rdi
callq 0x2100
movq 0x2f93(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x2f84(%rip), %rdi      # 0x5fd0
leaq 0x10f8(%rip), %rsi      # 0x414b
movl $0x19, %edx
callq 0x20f0
movq 0x2f6c(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d8c
jmp 0x3160
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3163
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3163
movq %rbx, %rdi
callq 0x2100
movq 0x2f16(%rip), %rax      # 0x5fc8
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2050
movq 0x2f07(%rip), %rdi      # 0x5fd0
leaq 0x107b(%rip), %rsi      # 0x414b
movl $0x19, %edx
callq 0x20f0
movq 0x2eef(%rip), %rdi      # 0x5fd0
callq 0x2060
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x2d44
jmp 0x3160
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2170
callq 0x2120
jmp 0x3163
movq %rax, %rdi
callq 0x268d
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x316f
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x316f
movq %rax, %rbx
jmp 0x316f
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x3178
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x20e0
jmp 0x3178
movq %rax, %rbx
jmp 0x3178
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x279c
leaq -0x60(%rbp), %rdi
callq 0x2410
movq %rbx, %rdi
callq 0x2150