// File: /workspace/github_cpp_makefile_star2_O2/t0mm4rx[P]piscine_cpp/day06/ex00/main.cpp
// Function: go(char*)
void	go(char* src)
{
	std::string	str;
	double		k;
	int			strStart(0);
	int			strSize(0);

	while (src[strStart] && std::isspace(src[strStart]))
		strStart++;
	while (src[strStart + strSize] && !std::isspace(src[strStart + strSize]))
		strSize++;
	str = std::string(src, strStart, strSize);
	if (str.length() == 1 && std::isprint(str[0]) && !std::isdigit(str[0]))
		k = str[0];
	else
	{
		try
		{
			k = std::stod(str);
		}
		catch (std::exception &e)
		{
			std::cout << "No conversion found!" << std::endl;
			std::cout << "char:   impossible" << std::endl;
			std::cout << "int:    impossible" << std::endl;
			std::cout << "float:  impossible" << std::endl;
			std::cout << "double: impossible" << std::endl;
			return ;
		}
	}
	std::cout << "char:   ";
	if (k < CHAR_MIN || k > CHAR_MAX || isnan(k))
		std::cout << "impossible" << std::endl;
	else if (std::isprint(k))
		std::cout << static_cast<unsigned char>(k) << std::endl;
	else
		std::cout << "non displayable" << std::endl;
	std::cout << "int:    ";
	if (k >= INT_MIN && k <= INT_MAX && !isnan(k) && !isinf(k))
		std::cout << static_cast<int>(k) << std::endl;
	else
		std::cout << "impossible " << std::endl;
	std::cout << "float:  ";
	if (isnan(k))
		std::cout << "nan";
	else if (isinf(k))
		std::cout << (k < 0 ? "-" : "") << "inf";
	else
		std::cout << static_cast<float>(k);
	std::cout << "f" << std::endl;
	std::cout << "double: ";
	if (isnan(k))
		std::cout << "nan" << std::endl;
	else if (isinf(k))
		std::cout << (k < 0 ? "-" : "") << "inf" << std::endl;
	else
		std::cout << k << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %r14
movq %rdi, -0x38(%rbp)
movb $0x0, (%rax)
xorl %ebx, %ebx
movsbl (%r14,%rbx), %edi
testl %edi, %edi
je 0x1329
callq 0x1040
testl %eax, %eax
je 0x1329
incq %rbx
jmp 0x1312
movl %ebx, %eax
addq %rax, %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
testl %edi, %edi
je 0x1348
callq 0x1040
testl %eax, %eax
jne 0x1348
incq %r15
jmp 0x1331
movl %r15d, %ecx
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x19(%rbp), %r8
movq %rbx, %rdx
callq 0x16fa
leaq -0x58(%rbp), %rbx
leaq -0x78(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1110
movq %r14, %rdi
callq 0x1080
cmpq $0x1, 0x8(%rbx)
jne 0x13a1
movq -0x58(%rbp), %rax
movsbl (%rax), %ebx
movl %ebx, %edi
callq 0x1190
testl %eax, %eax
sete %al
leal -0x30(%rbx), %ecx
cmpl $0xa, %ecx
setb %cl
orb %al, %cl
je 0x13b3
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x175d
movapd %xmm0, -0x30(%rbp)
jmp 0x13bc
cvtsi2sd %ebx, %xmm0
movapd %xmm0, -0x30(%rbp)
movq 0x2c15(%rip), %rdi      # 0x3fd8
leaq 0xcbf(%rip), %rsi       # 0x2089
callq 0x10f0
movapd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm1
leaq 0xc79(%rip), %rsi       # 0x2058
jp 0x1421
movsd 0xc1f(%rip), %xmm0      # 0x2008
ucomisd %xmm1, %xmm0
ja 0x1421
ucomisd 0xc19(%rip), %xmm1      # 0x2010
ja 0x1421
cvttsd2si -0x30(%rbp), %ebx
movl %ebx, %edi
callq 0x1190
testl %eax, %eax
je 0x141a
movsbl %bl, %esi
movq 0x2bc5(%rip), %rdi      # 0x3fd8
callq 0x1100
jmp 0x142d
leaq 0xc71(%rip), %rsi       # 0x2092
movq 0x2bb0(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x2b9c(%rip), %rdi      # 0x3fd8
leaq 0xc5f(%rip), %rsi       # 0x20a2
callq 0x10f0
movdqa -0x30(%rbp), %xmm2
movq %xmm2, %r14
movsd 0xbbe(%rip), %xmm0      # 0x2018
movdqa %xmm2, %xmm1
cmpnlepd %xmm0, %xmm1
movsd 0xbb5(%rip), %xmm0      # 0x2020
cmpnlepd %xmm2, %xmm0
orpd %xmm1, %xmm0
movd %xmm0, %eax
btrq $0x3f, %r14
movabsq $0x7ff0000000000000, %r15 # imm = 0x7FF0000000000000
cmpq %r15, %r14
sete %cl
orb %al, %cl
testb $0x1, %cl
je 0x14a9
movq 0x2b3d(%rip), %rdi      # 0x3fd8
leaq 0xc09(%rip), %rsi       # 0x20ab
callq 0x10f0
jmp 0x14b9
cvttsd2si %xmm2, %esi
movq 0x2b24(%rip), %rdi      # 0x3fd8
callq 0x1170
movq %rax, %rdi
callq 0x1090
movq 0x2b10(%rip), %rbx      # 0x3fd8
leaq 0xbe8(%rip), %rsi       # 0x20b7
movq %rbx, %rdi
callq 0x10f0
movapd -0x30(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x15e0
cmpq %r15, %r14
jne 0x1526
xorpd %xmm0, %xmm0
ucomisd -0x30(%rbp), %xmm0
leaq 0xbc9(%rip), %rax       # 0x20c4
leaq 0xba8(%rip), %rsi       # 0x20aa
cmovaq %rax, %rsi
movq 0x2acb(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
leaq 0xbaa(%rip), %rsi       # 0x20c6
movq %rbx, %rdi
callq 0x10f0
jmp 0x1537
cvtsd2ss -0x30(%rbp), %xmm0
movq 0x2aa6(%rip), %rdi      # 0x3fd8
callq 0x10c0
movq 0x2a9a(%rip), %rdi      # 0x3fd8
leaq 0xb83(%rip), %rsi       # 0x20c8
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x2a7f(%rip), %rbx      # 0x3fd8
leaq 0xb6a(%rip), %rsi       # 0x20ca
movq %rbx, %rdi
callq 0x10f0
movapd -0x30(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x15ec
cmpq %r15, %r14
jne 0x15b3
xorpd %xmm0, %xmm0
ucomisd -0x30(%rbp), %xmm0
leaq 0xb3c(%rip), %rax       # 0x20c4
leaq 0xb1b(%rip), %rsi       # 0x20aa
cmovaq %rax, %rsi
movq 0x2a3e(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
leaq 0xb1d(%rip), %rsi       # 0x20c6
movq %rbx, %rdi
callq 0x10f0
jmp 0x15c4
movq 0x2a1e(%rip), %rdi      # 0x3fd8
movapd -0x30(%rbp), %xmm0
callq 0x1150
movq %rax, %rdi
callq 0x1090
leaq -0x58(%rbp), %rdi
callq 0x1080
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xad9(%rip), %rsi       # 0x20c0
jmp 0x151c
leaq 0xacd(%rip), %rsi       # 0x20c0
jmp 0x15a9
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x16b3
movq %rbx, %rdi
callq 0x1060
movq 0x29c8(%rip), %rdi      # 0x3fd8
leaq 0xa11(%rip), %rsi       # 0x2028
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x29ad(%rip), %rdi      # 0x3fd8
leaq 0xa0b(%rip), %rsi       # 0x203d
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x2992(%rip), %rdi      # 0x3fd8
leaq 0xa03(%rip), %rsi       # 0x2050
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x2977(%rip), %rdi      # 0x3fd8
leaq 0x9fb(%rip), %rsi       # 0x2063
callq 0x10f0
movq %rax, %rdi
callq 0x1090
movq 0x295c(%rip), %rdi      # 0x3fd8
leaq 0x9f3(%rip), %rsi       # 0x2076
callq 0x10f0
movq %rax, %rdi
callq 0x1090
callq 0x1160
jmp 0x15cc
jmp 0x16b0
movq %rax, %rbx
callq 0x1160
jmp 0x16b3
movq %rax, %rdi
callq 0x177b
jmp 0x16b0
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1080
movq %rbx, %rdi
callq 0x1180