// File: /workspace/github_cpp_makefile_star2_O3/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, -0x68(%rbp)
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movb (%rdi), %al
testb %al, %al
je 0x238b
movq %rdi, %r14
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, %ecx
movb (%r14,%rcx), %al
testb %al, %al
je 0x238d
leaq (%rcx,%r14), %r15
incq %r15
xorl %r14d, %r14d
movsbl %al, %edi
callq 0x2050
testl %eax, %eax
jne 0x2386
movb (%r15,%r14), %al
incq %r14
testb %al, %al
jne 0x236f
movl %r14d, %ecx
jmp 0x238f
xorl %ebx, %ebx
xorl %ecx, %ecx
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x29(%rbp), %r8
movq %rbx, %rdx
callq 0x2944
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rbx
movq %rbx, %rsi
callq 0x2130
movq (%rbx), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x23d1
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2110
movq -0x60(%rbp), %rbx
cmpq $0x1, -0x58(%rbp)
jne 0x23fb
movsbl (%rbx), %r14d
movl %r14d, %edi
callq 0x21b0
testl %eax, %eax
sete %al
leal -0x30(%r14), %ecx
cmpl $0xa, %ecx
setb %cl
orb %al, %cl
je 0x2449
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 0x27be
movl (%r14), %eax
testl %eax, %eax
je 0x2444
cmpl $0x22, %eax
jne 0x2453
leaq 0xcb4(%rip), %rdi       # 0x30f3
callq 0x2140
movl %r13d, (%r14)
jmp 0x2453
cvtsi2sd %r14d, %xmm0
movapd %xmm0, -0x40(%rbp)
movq 0x2b7e(%rip), %rdi      # 0x4fd8
leaq 0xc28(%rip), %rsi       # 0x3089
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm1
ucomisd %xmm1, %xmm1
movl $0xa, %edx
leaq 0xbd8(%rip), %rsi       # 0x3058
jp 0x24e9
movsd 0xb7e(%rip), %xmm0      # 0x3008
ucomisd %xmm1, %xmm0
ja 0x24e9
ucomisd 0xb78(%rip), %xmm1      # 0x3010
ja 0x24e9
cvttsd2si -0x40(%rbp), %ebx
movl %ebx, %edi
callq 0x21b0
testl %eax, %eax
je 0x24dd
leaq -0x88(%rbp), %rsi
movb %bl, (%rsi)
movq 0x2b1e(%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 0x250c
movl $0xf, %edx
leaq 0xba9(%rip), %rsi       # 0x3092
movq 0x2ae8(%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 0x2ab2(%rip), %rdi      # 0x4fd8
leaq 0xb75(%rip), %rsi       # 0x30a2
movl $0x8, %edx
callq 0x2120
movdqa -0x40(%rbp), %xmm2
movq %xmm2, %r14
movsd 0xacf(%rip), %xmm0      # 0x3018
movdqa %xmm2, %xmm1
cmpnlepd %xmm0, %xmm1
movsd 0xac6(%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 0x25b4
movq 0x2a4e(%rip), %rbx      # 0x4fd8
leaq 0xb1a(%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 0x25db
cvttsd2si %xmm2, %esi
movq 0x2a19(%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 0x29e3(%rip), %rdi      # 0x4fd8
leaq 0xabb(%rip), %rsi       # 0x30b7
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x27a6
cmpq %r15, %r14
jne 0x2660
xorpd %xmm0, %xmm0
xorl %edx, %edx
ucomisd -0x40(%rbp), %xmm0
seta %dl
leaq 0xa95(%rip), %rax       # 0x30c4
leaq 0xa74(%rip), %rsi       # 0x30aa
cmovaq %rax, %rsi
movq 0x2997(%rip), %rdi      # 0x4fd8
callq 0x2120
leaq 0xa79(%rip), %rsi       # 0x30c6
movq 0x2984(%rip), %rdi      # 0x4fd8
movl $0x3, %edx
callq 0x2120
jmp 0x2678
xorps %xmm0, %xmm0
cvtsd2ss -0x40(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x2965(%rip), %rdi      # 0x4fd8
callq 0x2170
movq 0x2959(%rip), %rbx      # 0x4fd8
leaq 0xa42(%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 0x2927(%rip), %rdi      # 0x4fd8
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x2913(%rip), %rdi      # 0x4fd8
leaq 0x9fe(%rip), %rsi       # 0x30ca
movl $0x8, %edx
callq 0x2120
movapd -0x40(%rbp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x27b2
cmpq %r15, %r14
jne 0x2747
xorpd %xmm0, %xmm0
xorl %edx, %edx
ucomisd -0x40(%rbp), %xmm0
seta %dl
leaq 0x9c5(%rip), %rax       # 0x30c4
leaq 0x9a4(%rip), %rsi       # 0x30aa
cmovaq %rax, %rsi
movq 0x28c7(%rip), %rdi      # 0x4fd8
callq 0x2120
leaq 0x9a9(%rip), %rsi       # 0x30c6
movq 0x28b4(%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 0x276f
movq 0x288a(%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 0x2797
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 0x913(%rip), %rsi       # 0x30c0
jmp 0x264d
leaq 0x907(%rip), %rsi       # 0x30c0
jmp 0x271d
leaq 0x92e(%rip), %rdi       # 0x30f3
callq 0x20a0
jmp 0x28be
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x27db
movl %r13d, (%r14)
cmpl $0x1, %edx
jne 0x28c1
movq %rbx, %rdi
callq 0x2070
movq 0x27e5(%rip), %rdi      # 0x4fd8
leaq 0x82e(%rip), %rsi       # 0x3028
movl $0x14, %edx
callq 0x2120
movq 0x27cd(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x27c1(%rip), %rdi      # 0x4fd8
leaq 0x81f(%rip), %rsi       # 0x303d
movl $0x12, %edx
callq 0x2120
movq 0x27a9(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x279d(%rip), %rdi      # 0x4fd8
leaq 0x80e(%rip), %rsi       # 0x3050
movl $0x12, %edx
callq 0x2120
movq 0x2785(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x2779(%rip), %rdi      # 0x4fd8
leaq 0x7fd(%rip), %rsi       # 0x3063
movl $0x12, %edx
callq 0x2120
movq 0x2761(%rip), %rdi      # 0x4fd8
callq 0x2090
movq 0x2755(%rip), %rdi      # 0x4fd8
leaq 0x7ec(%rip), %rsi       # 0x3076
movl $0x12, %edx
callq 0x2120
movq 0x273d(%rip), %rdi      # 0x4fd8
callq 0x2090
callq 0x2180
jmp 0x2782
jmp 0x28be
movq %rax, %rbx
callq 0x2180
jmp 0x28c1
movq %rax, %rdi
callq 0x29b0
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x28d6
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2110
movq %rbx, %rdi
callq 0x21a0