// File: /workspace/github_cpp_makefile_star2_O2/aempirei[P]Chat-Art/include/tile.hh
// Function: tile::to_string[abi:cxx11]() const
std::string tile::to_string() const {

	char buf[256];
	char basebuf[16];

	switch(geo.mode) {
		case geometry::BGCOLOR: 
			snprintf(basebuf, sizeof(basebuf), "%d,%d", geo.base, 40 + geo.code );
			break;
		case geometry::FGCOLOR: 
			snprintf(basebuf, sizeof(basebuf), "%d,%d", geo.base, 30 + geo.code );
			break;
		case geometry::SYMBOL:
			snprintf(basebuf, sizeof(basebuf), "(%c)" , geo.base + geo.code);
			break;
		case geometry::NOP:
		default:
			*basebuf = '\0';
	}

	snprintf(buf, sizeof(buf), 
			"mode %02x "
			"code %02x "
			"base %02x "
			"%4s "
			"color #%02x%02x%02x "
			"~ #%02x%02x%02x "
			"ratio %2d:%-2d %3d%% "
			"n %3d "
			"x %3d "
			"y %3d "
			"rgb_mean %3d %3d %3d "
			"rgb_stdev %3d %3d %3d "
			"size %dx%d",
			geo.mode,
			geo.code,
			geo.base,
			basebuf,
			(uint8_t)rgb_mean[0], (uint8_t)rgb_mean[1], (uint8_t)rgb_mean[2],
			geo.color[0],geo.color[1],geo.color[2],
			geo.ratio, geometry::ratio_max-geo.ratio, 100*geo.ratio/geometry::ratio_max,
			(int)n(),
			(int)pos[0], (int)pos[1],
			(int)rgb_mean[0],
			(int)rgb_mean[1],
			(int)rgb_mean[2],
			(int)rgb_stdev[0],
			(int)rgb_stdev[1],
			(int)rgb_stdev[2],
			(int)geo.size[1], (int)geo.size[0]
	);

	return std::string(buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r14
movq %rdi, 0x88(%rsp)
movl 0x20(%rsi), %eax
cmpl $0x3, %eax
je 0x2af4
cmpl $0x2, %eax
je 0x2ad0
cmpl $0x1, %eax
jne 0x2b14
movl 0x24(%r14), %r8d
movl 0x28(%r14), %ecx
addl $0x28, %r8d
jmp 0x2adc
movl 0x24(%r14), %r8d
movl 0x28(%r14), %ecx
addl $0x1e, %r8d
leaq 0x25ea(%rip), %rdx      # 0x50cd
leaq 0x10(%rsp), %rdi
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x2270
jmp 0x2b19
movl 0x24(%r14), %ecx
addl 0x28(%r14), %ecx
leaq 0x25a7(%rip), %rdx      # 0x50aa
leaq 0x10(%rsp), %rdi
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x2270
jmp 0x2b19
movb $0x0, 0x10(%rsp)
movl 0x20(%r14), %ecx
movl 0x24(%r14), %r8d
movl 0x28(%r14), %r9d
movl 0x34(%r14), %eax
movq %rax, 0x58(%rsp)
movl $0xff, %r15d
andl %r15d, %eax
movq %rax, 0x80(%rsp)
movl 0x38(%r14), %eax
movq %rax, 0x50(%rsp)
andl %r15d, %eax
movq %rax, 0x78(%rsp)
movl 0x3c(%r14), %eax
movq %rax, 0x40(%rsp)
andl %eax, %r15d
movl 0x10(%r14), %eax
movq %rax, 0x70(%rsp)
movl 0x14(%r14), %eax
movq %rax, 0x68(%rsp)
movl 0x18(%r14), %eax
movq %rax, 0x60(%rsp)
movl 0x1c(%r14), %r13d
pushq $0x3f
popq %rsi
imull $0x64, %r13d, %eax
xorl %edx, %edx
divl %esi
movq %rax, 0x48(%rsp)
movl %esi, %r10d
subl %r13d, %r10d
movl 0x8(%r14), %ebx
movl 0xc(%r14), %r11d
movl %r11d, %r12d
imull %ebx, %r12d
movl 0x2c(%r14), %eax
movq %rax, 0x38(%rsp)
movl 0x30(%r14), %eax
movq %rax, 0x30(%rsp)
movl 0x4c(%r14), %eax
movq %rax, 0x28(%rsp)
movl 0x50(%r14), %ebp
movl 0x54(%r14), %r14d
subq $0x8, %rsp
leaq 0x2505(%rip), %rdx      # 0x50d3
leaq 0x98(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movl $0x0, %eax
pushq %rbx
pushq %r11
pushq %r14
pushq %rbp
pushq 0x50(%rsp)
pushq 0x70(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq %r12
pushq 0xa8(%rsp)
pushq %r10
pushq %r13
pushq 0xd8(%rsp)
pushq 0xe8(%rsp)
pushq 0xf8(%rsp)
pushq %r15
pushq 0x110(%rsp)
pushq 0x120(%rsp)
leaq 0xb8(%rsp), %r10
pushq %r10
callq 0x2270
addq $0xb0, %rsp
leaq 0xf(%rsp), %rdx
movq 0x88(%rsp), %rbx
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x394a
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq