// File: /workspace/github_cpp_makefile_star2_O2/Reputeless[P]PerlinNoise/example.cpp
// Function: Test()
void Test()
{
	siv::PerlinNoise perlinA{ std::random_device{} };
	siv::PerlinNoise perlinB;

	perlinB.deserialize(perlinA.serialize());

	assert(perlinA.octave3D(0.1, 0.2, 0.3, 4)
		== perlinB.octave3D(0.1, 0.2, 0.3, 4));

	perlinA.reseed(12345u);
	perlinB.reseed(12345u);

	assert(perlinA.octave3D(0.1, 0.2, 0.3, 4)
		== perlinB.octave3D(0.1, 0.2, 0.3, 4));

	perlinA.reseed(std::mt19937{ 67890u });
	perlinB.reseed(std::mt19937{ 67890u });

	assert(perlinA.octave3D(0.1, 0.2, 0.3, 4)
		== perlinB.octave3D(0.1, 0.2, 0.3, 4));

	for (std::int32_t y = 0; y < 20; ++y)
	{
		for (std::int32_t x = 0; x < 20; ++x)
		{
			const double noise = perlinA.octave2D_01(x * 0.1, y * 0.1, 6);
			std::cout << static_cast<int>(std::floor(noise * 10) - 0.5);
		}
		std::cout << '\n';
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x15a8, %rsp           # imm = 0x15A8
leaq -0x15c8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2ac6
leaq -0x140(%rbp), %rdi
movq %rbx, %rsi
callq 0x322c
leaq -0x15c8(%rbp), %rdi
callq 0x2b1c
leaq -0x240(%rbp), %rbx
leaq -0x140(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movsd 0x1be8(%rip), %xmm0     # 0x4008
movsd 0x1be8(%rip), %xmm1     # 0x4010
movsd 0x1be8(%rip), %xmm2     # 0x4018
pushq $0x4
popq %r15
movsd 0x1be4(%rip), %xmm3     # 0x4020
movq %r14, %rdi
movl %r15d, %esi
callq 0x32c6
movsd %xmm0, -0x30(%rbp)
movq %rbx, %rdi
movsd 0x1bb1(%rip), %xmm0     # 0x4008
movsd 0x1bb1(%rip), %xmm1     # 0x4010
movsd 0x1bb1(%rip), %xmm2     # 0x4018
movl %r15d, %esi
movsd 0x1bae(%rip), %xmm3     # 0x4020
callq 0x32c6
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x26a9
jp 0x26a9
leaq -0x140(%rbp), %rbx
movl $0x3039, %esi           # imm = 0x3039
movq %rbx, %rdi
callq 0x2b30
leaq -0x240(%rbp), %r14
movl $0x3039, %esi           # imm = 0x3039
movq %r14, %rdi
callq 0x2b30
movsd 0x1b4c(%rip), %xmm0     # 0x4008
movsd 0x1b4c(%rip), %xmm1     # 0x4010
movsd 0x1b4c(%rip), %xmm2     # 0x4018
movsd 0x1b4c(%rip), %xmm3     # 0x4020
movq %rbx, %rdi
movl %r15d, %esi
callq 0x32c6
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
movsd 0x1b19(%rip), %xmm0     # 0x4008
movsd 0x1b19(%rip), %xmm1     # 0x4010
movsd 0x1b19(%rip), %xmm2     # 0x4018
movl %r15d, %esi
movsd 0x1b16(%rip), %xmm3     # 0x4020
callq 0x32c6
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x26c8
jp 0x26c8
leaq -0x15c8(%rbp), %rbx
movl $0x10932, %esi          # imm = 0x10932
movq %rbx, %rdi
callq 0x36d8
leaq -0x140(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b68
movl $0x10932, %esi          # imm = 0x10932
movq %rbx, %rdi
callq 0x36d8
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2b68
movsd 0x1a97(%rip), %xmm0     # 0x4008
movsd 0x1a97(%rip), %xmm1     # 0x4010
movsd 0x1a97(%rip), %xmm2     # 0x4018
pushq $0x4
popq %rbx
movsd 0x1a94(%rip), %xmm3     # 0x4020
movq %r14, %rdi
movl %ebx, %esi
callq 0x32c6
movsd %xmm0, -0x30(%rbp)
movq %r15, %rdi
movsd 0x1a62(%rip), %xmm0     # 0x4008
movsd 0x1a62(%rip), %xmm1     # 0x4010
movsd 0x1a62(%rip), %xmm2     # 0x4018
movl %ebx, %esi
movsd 0x1a60(%rip), %xmm3     # 0x4020
callq 0x32c6
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x26e7
jp 0x26e7
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
movq 0x39e8(%rip), %rbx      # 0x5fd0
leaq -0x140(%rbp), %r15
pushq $0x6
popq %r12
cmpl $0x14, %r13d
je 0x2697
movsd %xmm0, -0x38(%rbp)
mulsd 0x19fe(%rip), %xmm0     # 0x4008
movsd %xmm0, -0x40(%rbp)
xorpd %xmm0, %xmm0
pushq $0x14
popq %r14
subl $0x1, %r14d
jb 0x2677
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd 0x19d9(%rip), %xmm0     # 0x4008
movq %r15, %rdi
movsd -0x40(%rbp), %xmm1
movl %r12d, %esi
movsd 0x19de(%rip), %xmm2     # 0x4020
callq 0x2b8e
mulsd 0x19d9(%rip), %xmm0     # 0x4028
callq 0x2210
addsd 0x19d4(%rip), %xmm0     # 0x4030
cvttsd2si %xmm0, %esi
movq %rbx, %rdi
callq 0x2230
movsd -0x30(%rbp), %xmm0
addsd 0x19c3(%rip), %xmm0     # 0x4038
jmp 0x2617
movq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x2190
movsd -0x38(%rbp), %xmm0
addsd 0x19a9(%rip), %xmm0     # 0x4038
incl %r13d
jmp 0x25f3
addq $0x15a8, %rsp           # imm = 0x15A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19d0(%rip), %rdi      # 0x4080
leaq 0x1a12(%rip), %rsi      # 0x40c9
leaq 0x1a17(%rip), %rcx      # 0x40d5
movl $0x86, %edx
callq 0x20b0
leaq 0x19b1(%rip), %rdi      # 0x4080
leaq 0x19f3(%rip), %rsi      # 0x40c9
leaq 0x19f8(%rip), %rcx      # 0x40d5
movl $0x8c, %edx
callq 0x20b0
leaq 0x1992(%rip), %rdi      # 0x4080
leaq 0x19d4(%rip), %rsi      # 0x40c9
leaq 0x19d9(%rip), %rcx      # 0x40d5
movl $0x92, %edx
callq 0x20b0
movq %rax, %rbx
leaq -0x15c8(%rbp), %rdi
callq 0x2b1c
movq %rbx, %rdi
callq 0x2250