// File: 111116[P]console/example_advanced.cpp
// Function: main
int main()
{
	// console.loglevel = 3; // error only
	// console.loglevel = 2; // warning & above
	// console.loglevel = 1; // info & above
	// console.loglevel = 0; // logs, timers, counters & above (default)
	console.log("Here prints a log");
	console.info("Here prints an info.");
	console.warn("Here prints a warning!");
	console.error("Here prints an error!!");
	// debugs are not affected by loglevel
	console.debug("This won't be visible if NDEBUG is defined");
	console.log();

	// it's just a wrapper of std::cerr, so you can use iomanip
	std::cerr << std::fixed << std::setprecision(2);
	console.log("PI approx", acos(-1));
	// custom data structures can be used when operator<< is defined
	console.log("a struct", A());
	console.log("a vector", std::vector<int>({1,2,3}));
	console.log("std::pair", std::pair<int,int>(2,3));

	// timer label can be omitted
	console.time("total");
	usleep(123456);
	// use console.timeLog if you don't want to stop the timer
	console.timeEnd("total");

	// counter label can be omitted
	console.count("test");
	// it returns the corresponding count value
	int t = console.count("test");
	console.countReset("test");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
leaq 0xa966(%rip), %rdi      # 0xe1d8
movq %rdi, -0x150(%rbp)
leaq 0x57d2(%rip), %rsi      # 0x9052
callq 0x3e00
movq -0x150(%rbp), %rdi
leaq 0x57d1(%rip), %rsi      # 0x9064
callq 0x3e70
movq -0x150(%rbp), %rdi
leaq 0x57d3(%rip), %rsi      # 0x9079
callq 0x3f10
movq -0x150(%rbp), %rdi
leaq 0x57d7(%rip), %rsi      # 0x9090
callq 0x3fb0
movq -0x150(%rbp), %rdi
leaq 0x57db(%rip), %rsi      # 0x90a7
callq 0x4050
movq -0x150(%rbp), %rdi
callq 0x40b0
movq 0xa70c(%rip), %rdi      # 0xdff0
leaq 0x825(%rip), %rsi       # 0x4110
callq 0x2070
movq %rax, -0x158(%rbp)
movl $0x2, %edi
callq 0x4140
movq -0x158(%rbp), %rdi
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %esi
callq 0x22b0
movsd 0x5715(%rip), %xmm0     # 0x9030
callq 0x21b0
movq -0x150(%rbp), %rdi
movsd %xmm0, -0x10(%rbp)
leaq 0x579f(%rip), %rsi      # 0x90d2
leaq -0x10(%rbp), %rdx
callq 0x4160
movq $0x0, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x4240
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rdx
leaq 0x5773(%rip), %rsi      # 0x90dc
callq 0x41d0
movl $0x1, -0x4c(%rbp)
movl $0x2, -0x48(%rbp)
movl $0x3, -0x44(%rbp)
leaq -0x4c(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x3, -0x38(%rbp)
leaq -0x4d(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x42d0
movq -0x140(%rbp), %rcx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x42f0
jmp 0x39bd
leaq 0xa814(%rip), %rdi      # 0xe1d8
leaq 0x571a(%rip), %rsi      # 0x90e5
leaq -0x30(%rbp), %rdx
callq 0x4260
jmp 0x39d6
leaq -0x30(%rbp), %rdi
callq 0x4370
leaq -0x4d(%rbp), %rdi
callq 0x43d0
movl $0x2, -0x68(%rbp)
movl $0x3, -0x6c(%rbp)
leaq -0x64(%rbp), %rdi
movq %rdi, -0x168(%rbp)
leaq -0x68(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
callq 0x4460
movq -0x168(%rbp), %rdx
leaq 0xa7bc(%rip), %rdi      # 0xe1d8
leaq 0x56cb(%rip), %rsi      # 0x90ee
callq 0x43f0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x2320
movq -0x160(%rbp), %rdx
leaq 0x56af(%rip), %rsi      # 0x90f8
leaq -0x90(%rbp), %rdi
callq 0x2240
jmp 0x3a57
leaq 0xa77a(%rip), %rdi      # 0xe1d8
leaq -0x90(%rbp), %rsi
callq 0x4490
jmp 0x3a6c
leaq -0x90(%rbp), %rdi
callq 0x2130
leaq -0x91(%rbp), %rdi
callq 0x2200
movl $0x1e240, %edi          # imm = 0x1E240
callq 0x2250
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x2320
movq -0x170(%rbp), %rdx
leaq 0x5649(%rip), %rsi      # 0x90f8
leaq -0xb8(%rbp), %rdi
callq 0x2240
jmp 0x3abd
leaq 0xa714(%rip), %rdi      # 0xe1d8
leaq -0xb8(%rbp), %rsi
callq 0x4590
jmp 0x3ad2
leaq -0xb8(%rbp), %rdi
callq 0x2130
leaq -0xb9(%rbp), %rdi
callq 0x2200
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x2320
movq -0x178(%rbp), %rdx
leaq 0x55f3(%rip), %rsi      # 0x90fe
leaq -0xe0(%rbp), %rdi
callq 0x2240
jmp 0x3b19
leaq 0xa6b8(%rip), %rdi      # 0xe1d8
leaq -0xe0(%rbp), %rsi
callq 0x4820
jmp 0x3b2e
leaq -0xe0(%rbp), %rdi
callq 0x2130
leaq -0xe1(%rbp), %rdi
callq 0x2200
leaq -0x109(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x2320
movq -0x180(%rbp), %rdx
leaq 0x5597(%rip), %rsi      # 0x90fe
leaq -0x108(%rbp), %rdi
callq 0x2240
jmp 0x3b75
leaq 0xa65c(%rip), %rdi      # 0xe1d8
leaq -0x108(%rbp), %rsi
callq 0x4820
movq %rax, -0x188(%rbp)
jmp 0x3b91
movq -0x188(%rbp), %rax
movl %eax, -0x194(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x2130
leaq -0x109(%rbp), %rdi
callq 0x2200
movl -0x194(%rbp), %eax
movl %eax, -0xe8(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x2320
movq -0x190(%rbp), %rdx
leaq 0x551b(%rip), %rsi      # 0x90fe
leaq -0x130(%rbp), %rdi
callq 0x2240
jmp 0x3bf1
leaq 0xa5e0(%rip), %rdi      # 0xe1d8
leaq -0x130(%rbp), %rsi
callq 0x4960
jmp 0x3c06
leaq -0x130(%rbp), %rdi
callq 0x2130
leaq -0x131(%rbp), %rdi
callq 0x2200
xorl %eax, %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3c4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4370
leaq -0x4d(%rbp), %rdi
callq 0x43d0
jmp 0x3d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3c80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x2130
leaq -0x91(%rbp), %rdi
callq 0x2200
jmp 0x3d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x2130
leaq -0xb9(%rbp), %rdi
callq 0x2200
jmp 0x3d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3cee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x2130
leaq -0xe1(%rbp), %rdi
callq 0x2200
jmp 0x3d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3d22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x2130
leaq -0x109(%rbp), %rdi
callq 0x2200
jmp 0x3d62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3d56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x2130
leaq -0x131(%rbp), %rdi
callq 0x2200
movq -0x58(%rbp), %rdi
callq 0x2310
nopl (%rax,%rax)