// File: shirookad[P]propcpp/main.cpp
// Function: main
int main(int argc, char *argv[]) {
	test1 t1;
	auto test1nanos = measure_block([&t1]() {
		for (unsigned long long i = 0; i < 1000000; ++i) {
			t1.count = 5;
		}
	});
	
	test2 t2;
	auto test2nanos = measure_block([&t2]() {
		for (unsigned long long i = 0; i < 1000000; ++i) {
			t2.setCount(5);
		}
	});

	test3 t3;
	auto test3nanos = measure_block([&t3]() {
		for (unsigned long long i = 0; i < 1000000; ++i) {
			t3.count.set(5);
		}
	});

	observerTest t4;
	auto test4nanos = measure_block([&t4]() {
		for (unsigned long long i = 0; i < 1000000; ++i) {
			t4.someOtherVal.set(5);
		}
	});
	
	t4.strVal.set("Hello");
	t4.strVal.set(t4.strVal.get() + ", World");
	
	int a = (int)t4.intVal;
	
	std::cout << "test1: " << test1nanos << std::endl;
	std::cout << "test2: " << test2nanos << std::endl;
	std::cout << "test3: " << test3nanos << std::endl;
	std::cout << "test4: " << test4nanos << std::endl;
	
	return 0;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x14(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x220(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x2750
movq -0x220(%rbp), %rdi
callq 0x3710
movq %rax, -0x218(%rbp)
jmp 0x230a
leaq -0x40(%rbp), %rdi
callq 0x3790
movq -0x218(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x230(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x27e0
movq -0x230(%rbp), %rdi
callq 0x3710
movq %rax, -0x228(%rbp)
jmp 0x2355
leaq -0x80(%rbp), %rdi
callq 0x3790
movq -0x228(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x8c(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x37b0
movq -0x248(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x240(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x2870
movq -0x240(%rbp), %rdi
callq 0x3710
movq %rax, -0x238(%rbp)
jmp 0x23b9
leaq -0xb8(%rbp), %rdi
callq 0x3790
movq -0x238(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x190(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x37d0
movq -0x260(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
movq %rdi, -0x258(%rbp)
leaq -0x1c0(%rbp), %rsi
callq 0x2900
movq -0x258(%rbp), %rdi
callq 0x3710
movq %rax, -0x250(%rbp)
jmp 0x2423
leaq -0x1b8(%rbp), %rdi
callq 0x3790
movq -0x250(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0x128(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x2150
movq -0x268(%rbp), %rdx
leaq 0x3c58(%rip), %rsi      # 0x60c4
leaq -0x1e0(%rbp), %rdi
callq 0x2110
jmp 0x247a
movq -0x270(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x3a30
jmp 0x248f
leaq -0x1e0(%rbp), %rdi
callq 0x20b0
leaq -0x1e1(%rbp), %rdi
callq 0x2100
leaq -0x128(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x3b40
movq %rax, -0x278(%rbp)
jmp 0x24c3
movq -0x278(%rbp), %rsi
leaq 0x3bf9(%rip), %rdx      # 0x60ca
leaq -0x208(%rbp), %rdi
callq 0x3ac0
jmp 0x24df
movq -0x280(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x3a30
jmp 0x24f4
leaq -0x208(%rbp), %rdi
callq 0x20b0
leaq -0xc8(%rbp), %rdi
callq 0x3b50
movl %eax, -0x284(%rbp)
jmp 0x2514
movl -0x284(%rbp), %eax
movl %eax, -0x20c(%rbp)
movq 0x7ab1(%rip), %rdi      # 0x9fd8
leaq 0x3ba4(%rip), %rsi      # 0x60d2
callq 0x20e0
movq %rax, -0x290(%rbp)
jmp 0x253c
movq -0x290(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2160
movq %rax, -0x298(%rbp)
jmp 0x2555
movq -0x298(%rbp), %rdi
movq 0x7a65(%rip), %rsi      # 0x9fc8
callq 0x20f0
jmp 0x256a
movq 0x7a67(%rip), %rdi      # 0x9fd8
leaq 0x3b62(%rip), %rsi      # 0x60da
callq 0x20e0
movq %rax, -0x2a0(%rbp)
jmp 0x2586
movq -0x2a0(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2160
movq %rax, -0x2a8(%rbp)
jmp 0x259f
movq -0x2a8(%rbp), %rdi
movq 0x7a1b(%rip), %rsi      # 0x9fc8
callq 0x20f0
jmp 0x25b4
movq 0x7a1d(%rip), %rdi      # 0x9fd8
leaq 0x3b20(%rip), %rsi      # 0x60e2
callq 0x20e0
movq %rax, -0x2b0(%rbp)
jmp 0x25d0
movq -0x2b0(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x2160
movq %rax, -0x2b8(%rbp)
jmp 0x25ec
movq -0x2b8(%rbp), %rdi
movq 0x79ce(%rip), %rsi      # 0x9fc8
callq 0x20f0
jmp 0x2601
movq 0x79d0(%rip), %rdi      # 0x9fd8
leaq 0x3adb(%rip), %rsi      # 0x60ea
callq 0x20e0
movq %rax, -0x2c0(%rbp)
jmp 0x261d
movq -0x2c0(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0x2160
movq %rax, -0x2c8(%rbp)
jmp 0x2639
movq -0x2c8(%rbp), %rdi
movq 0x7981(%rip), %rsi      # 0x9fc8
callq 0x20f0
jmp 0x264e
movl $0x0, -0x4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x3b60
movl -0x4(%rbp), %eax
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3790
jmp 0x273e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3790
jmp 0x273e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3790
jmp 0x273e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3790
jmp 0x2732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x26fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x20b0
leaq -0x1e1(%rbp), %rdi
callq 0x2100
jmp 0x2732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x20b0
leaq -0x190(%rbp), %rdi
callq 0x3b60
movq -0x50(%rbp), %rdi
callq 0x2140
nopw (%rax,%rax)