// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsvalue.c
// Function: js_strtol
double js_strtol(const char *s, char **p, int base)
{
	/* ascii -> digit value. max base is 36. */
	static const unsigned char table[256] = {
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 80, 80, 80, 80, 80,
		80, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
		25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 80, 80, 80, 80, 80,
		80, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
		25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
		80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
	};
	double x;
	unsigned char c;
	if (base == 10)
		for (x = 0, c = *s++; (0 <= c - '0') && (c - '0' < 10); c = *s++)
			x = x * 10 + (c - '0');
	else
		for (x = 0, c = *s++; table[c] < base; c = *s++)
			x = x * base + table[c];
	if (p)
		*p = (char*)s-1;
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jne 0x1b18d
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %edx
subl $0x30, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x22(%rbp)
jg 0x1b147
movzbl -0x21(%rbp), %eax
subl $0x30, %eax
cmpl $0xa, %eax
setl %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x1b150
jmp 0x1b18b
movsd -0x20(%rbp), %xmm0
movzbl -0x21(%rbp), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm1
movsd 0x18380(%rip), %xmm2    # 0x334e8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
jmp 0x1b125
jmp 0x1b203
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x1937a(%rip), %rax     # 0x34530
movzbl (%rax,%rcx), %eax
cmpl -0x14(%rbp), %eax
jge 0x1b201
movsd -0x20(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm2
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x1935a(%rip), %rax     # 0x34530
movzbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
jmp 0x1b1a9
jmp 0x1b203
cmpq $0x0, -0x10(%rbp)
je 0x1b219
movq -0x8(%rbp), %rcx
addq $-0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movsd -0x20(%rbp), %xmm0
popq %rbp
retq