// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq %rdi, -0x68(%rbp)
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movb (%rdi), %al
testb %al, %al
je 0x235f
xorl %ebx, %ebx
movsbl %al, %edi
callq 0x2050
testl %eax, %eax
je 0x235b
movb 0x1(%r14,%rbx), %al
incq %rbx
testb %al, %al
jne 0x2343
movl %ebx, %eax
jmp 0x2363
xorl %eax, %eax
xorl %ebx, %ebx
movl %eax, %ecx
movb (%r14,%rcx), %al
testb %al, %al
je 0x2393
leaq (%rcx,%r14), %r15
incq %r15
xorl %r14d, %r14d
movsbl %al, %edi
callq 0x2050
testl %eax, %eax
jne 0x238e
movb (%r15,%r14), %al
incq %r14
testb %al, %al
jne 0x2377
movl %r14d, %ecx
jmp 0x2395
xorl %ecx, %ecx
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x29(%rbp), %r8
movq %rbx, %rdx
callq 0x294a
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rbx
movq %rbx, %rsi
callq 0x2130
movq (%rbx), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x23d7
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2110
cmpq $0x1, -0x58(%rbp)
jne 0x23fe
movq -0x60(%rbp), %rax
movsbl (%rax), %ebx
movl %ebx, %edi
callq 0x21b0
testl %eax, %eax
sete %al
leal -0x30(%rbx), %ecx
cmpl $0xa, %ecx
setb %cl
orb %al, %cl
je 0x2450
movq -0x60(%rbp), %rbx
callq 0x2040
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
leaq -0x88(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20d0
movapd %xmm0, -0x40(%rbp)
cmpq %rbx, (%r15)
je 0x27c4
movl (%r14), %eax
testl %eax, %eax
je 0x244b
cmpl $0x22, %eax
jne 0x2459
leaq 0xcad(%rip), %rdi       # 0x30f3
callq 0x2140
movl %r13d, (%r14)
jmp 0x2459
cvtsi2sd %ebx, %xmm0
movapd %xmm0, -0x40(%rbp)
movq 0x2b78(%rip), %rdi      # 0x4fd8
leaq 0xc22(%rip), %rsi       # 0x3089
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm1
ucomisd %xmm1, %xmm1
movl $0xa, %edx
leaq 0xbd2(%rip), %rsi       # 0x3058
jp 0x24ef
movsd 0xb78(%rip), %xmm0      # 0x3008
ucomisd %xmm1, %xmm0
ja 0x24ef
ucomisd 0xb72(%rip), %xmm1      # 0x3010
ja 0x24ef
cvttsd2si -0x40(%rbp), %ebx
movl %ebx, %edi
callq 0x21b0
testl %eax, %eax
je 0x24e3
leaq -0x88(%rbp), %rsi
movb %bl, (%rsi)
movq 0x2b18(%rip), %rdi      # 0x4fd8
movl $0x1, %edx
callq 0x2120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
jmp 0x2512
movl $0xf, %edx
leaq 0xba3(%rip), %rsi       # 0x3092
movq 0x2ae2(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x2aac(%rip), %rdi      # 0x4fd8
leaq 0xb6f(%rip), %rsi       # 0x30a2
movl $0x8, %edx
callq 0x2120
movdqa -0x40(%rbp), %xmm2
movq %xmm2, %r14
movsd 0xac9(%rip), %xmm0      # 0x3018
movdqa %xmm2, %xmm1
cmpnlepd %xmm0, %xmm1
movsd 0xac0(%rip), %xmm0      # 0x3020
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 0x25ba
movq 0x2a48(%rip), %rbx      # 0x4fd8
leaq 0xb14(%rip), %rsi       # 0x30ab
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
jmp 0x25e1
cvttsd2si %xmm2, %esi
movq 0x2a13(%rip), %rdi      # 0x4fd8
callq 0x2190
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x29dd(%rip), %rdi      # 0x4fd8
leaq 0xab5(%rip), %rsi       # 0x30b7
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x27ac
cmpq %r15, %r14
jne 0x2666
xorpd %xmm0, %xmm0
xorl %edx, %edx
ucomisd -0x40(%rbp), %xmm0
seta %dl
leaq 0xa8f(%rip), %rax       # 0x30c4
leaq 0xa6e(%rip), %rsi       # 0x30aa
cmovaq %rax, %rsi
movq 0x2991(%rip), %rdi      # 0x4fd8
callq 0x2120
leaq 0xa73(%rip), %rsi       # 0x30c6
movq 0x297e(%rip), %rdi      # 0x4fd8
movl $0x3, %edx
callq 0x2120
jmp 0x267e
xorps %xmm0, %xmm0
cvtsd2ss -0x40(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x295f(%rip), %rdi      # 0x4fd8
callq 0x2170
movq 0x2953(%rip), %rbx      # 0x4fd8
leaq 0xa3c(%rip), %rsi       # 0x30c8
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq 0x2921(%rip), %rdi      # 0x4fd8
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x290d(%rip), %rdi      # 0x4fd8
leaq 0x9f8(%rip), %rsi       # 0x30ca
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x27b8
cmpq %r15, %r14
jne 0x274d
xorpd %xmm0, %xmm0
xorl %edx, %edx
ucomisd -0x40(%rbp), %xmm0
seta %dl
leaq 0x9bf(%rip), %rax       # 0x30c4
leaq 0x99e(%rip), %rsi       # 0x30aa
cmovaq %rax, %rsi
movq 0x28c1(%rip), %rdi      # 0x4fd8
callq 0x2120
leaq 0x9a3(%rip), %rsi       # 0x30c6
movq 0x28ae(%rip), %rbx      # 0x4fd8
movl $0x3, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
jmp 0x2775
movq 0x2884(%rip), %rdi      # 0x4fd8
movapd -0x40(%rbp), %xmm0
callq 0x2170
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x279d
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2110
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x90d(%rip), %rsi       # 0x30c0
jmp 0x2653
leaq 0x901(%rip), %rsi       # 0x30c0
jmp 0x2723
leaq 0x928(%rip), %rdi       # 0x30f3
callq 0x20a0
jmp 0x28c4
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x27e1
movl %r13d, (%r14)
cmpl $0x1, %edx
jne 0x28c7
movq %rbx, %rdi
callq 0x2070
movq 0x27df(%rip), %rdi      # 0x4fd8
leaq 0x828(%rip), %rsi       # 0x3028
movl $0x14, %edx
callq 0x2120
movq 0x27c7(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x27bb(%rip), %rdi      # 0x4fd8
leaq 0x819(%rip), %rsi       # 0x303d
movl $0x12, %edx
callq 0x2120
movq 0x27a3(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x2797(%rip), %rdi      # 0x4fd8
leaq 0x808(%rip), %rsi       # 0x3050
movl $0x12, %edx
callq 0x2120
movq 0x277f(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x2773(%rip), %rdi      # 0x4fd8
leaq 0x7f7(%rip), %rsi       # 0x3063
movl $0x12, %edx
callq 0x2120
movq 0x275b(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x274f(%rip), %rdi      # 0x4fd8
leaq 0x7e6(%rip), %rsi       # 0x3076
movl $0x12, %edx
callq 0x2120
movq 0x2737(%rip), %rdi      # 0x4fd8
callq 0x2090
callq 0x2180
jmp 0x2788
jmp 0x28c4
movq %rax, %rbx
callq 0x2180
jmp 0x28c7
movq %rax, %rdi
callq 0x29b6
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x28dc
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2110
movq %rbx, %rdi
callq 0x21a0