// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/util.c
// Function: je_malloc_strtoumax
uintmax_t
malloc_strtoumax(const char *restrict nptr, char **restrict endptr, int base)
{
	uintmax_t ret, digit;
	unsigned b;
	bool neg;
	const char *p, *ns;

	p = nptr;
	if (base < 0 || base == 1 || base > 36) {
		ns = p;
		set_errno(EINVAL);
		ret = UINTMAX_MAX;
		goto label_return;
	}
	b = base;

	/* Swallow leading whitespace and get sign, if any. */
	neg = false;
	while (true) {
		switch (*p) {
		case '\t': case '\n': case '\v': case '\f': case '\r': case ' ':
			p++;
			break;
		case '-':
			neg = true;
			/* Fall through. */
		case '+':
			p++;
			/* Fall through. */
		default:
			goto label_prefix;
		}
	}

	/* Get prefix, if any. */
	label_prefix:
	/*
	 * Note where the first non-whitespace/sign character is so that it is
	 * possible to tell whether any digits are consumed (e.g., "  0" vs.
	 * "  -x").
	 */
	ns = p;
	if (*p == '0') {
		switch (p[1]) {
		case '0': case '1': case '2': case '3': case '4': case '5':
		case '6': case '7':
			if (b == 0)
				b = 8;
			if (b == 8)
				p++;
			break;
		case 'X': case 'x':
			switch (p[2]) {
			case '0': case '1': case '2': case '3': case '4':
			case '5': case '6': case '7': case '8': case '9':
			case 'A': case 'B': case 'C': case 'D': case 'E':
			case 'F':
			case 'a': case 'b': case 'c': case 'd': case 'e':
			case 'f':
				if (b == 0)
					b = 16;
				if (b == 16)
					p += 2;
				break;
			default:
				break;
			}
			break;
		default:
			p++;
			ret = 0;
			goto label_return;
		}
	}
	if (b == 0)
		b = 10;

	/* Convert. */
	ret = 0;
	while ((*p >= '0' && *p <= '9' && (digit = *p - '0') < b)
	    || (*p >= 'A' && *p <= 'Z' && (digit = 10 + *p - 'A') < b)
	    || (*p >= 'a' && *p <= 'z' && (digit = 10 + *p - 'a') < b)) {
		uintmax_t pret = ret;
		ret *= b;
		ret += digit;
		if (ret < pret) {
			/* Overflow. */
			set_errno(ERANGE);
			ret = UINTMAX_MAX;
			goto label_return;
		}
		p++;
	}
	if (neg)
		ret = -ret;

	if (p == ns) {
		/* No conversion performed. */
		set_errno(EINVAL);
		ret = UINTMAX_MAX;
		goto label_return;
	}

label_return:
	if (endptr != NULL) {
		if (p == ns) {
			/* No characters were converted. */
			*endptr = (char *)nptr;
		} else
			*endptr = (char *)p;
	}
	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x7c1fd
cmpl $0x1, -0x14(%rbp)
je 0x7c1fd
cmpl $0x24, -0x14(%rbp)
jle 0x7c21c
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x16, %edi
callq 0x7c4e0
movq $-0x1, -0x20(%rbp)
jmp 0x7c49d
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movb $0x0, -0x2d(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x24, %eax
ja 0x7c26d
movq -0x50(%rbp), %rax
leaq 0x14516(%rip), %rcx     # 0x9075c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c26f
movb $0x1, -0x2d(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c271
jmp 0x7c226
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x7c342
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x54(%rbp)
addl $-0x30, %eax
subl $0x8, %eax
jb 0x7c2b2
jmp 0x7c29e
movl -0x54(%rbp), %eax
subl $0x58, %eax
je 0x7c2d3
jmp 0x7c2a8
movl -0x54(%rbp), %eax
subl $0x78, %eax
je 0x7c2d3
jmp 0x7c327
cmpl $0x0, -0x2c(%rbp)
jne 0x7c2bf
movl $0x8, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jne 0x7c2d1
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c340
movq -0x38(%rbp), %rax
movsbl 0x2(%rax), %eax
movl %eax, -0x58(%rbp)
addl $-0x30, %eax
subl $0xa, %eax
jb 0x7c302
jmp 0x7c2e8
movl -0x58(%rbp), %eax
addl $-0x41, %eax
subl $0x6, %eax
jb 0x7c302
jmp 0x7c2f5
movl -0x58(%rbp), %eax
addl $-0x61, %eax
subl $0x5, %eax
ja 0x7c323
jmp 0x7c302
cmpl $0x0, -0x2c(%rbp)
jne 0x7c30f
movl $0x10, -0x2c(%rbp)
cmpl $0x10, -0x2c(%rbp)
jne 0x7c321
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c325
jmp 0x7c325
jmp 0x7c340
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x20(%rbp)
jmp 0x7c49d
jmp 0x7c342
cmpl $0x0, -0x2c(%rbp)
jne 0x7c34f
movl $0xa, -0x2c(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x7c393
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x7c393
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movslq %eax, %rcx
movq %rcx, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %edx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x59(%rbp)
jb 0x7c415
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x7c3ce
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5a, %eax
jg 0x7c3ce
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
addl $0xa, %eax
subl $0x41, %eax
movslq %eax, %rcx
movq %rcx, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %edx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x59(%rbp)
jb 0x7c415
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x61, %ecx
movb %al, -0x5a(%rbp)
jl 0x7c40f
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x7a, %ecx
movb %al, -0x5a(%rbp)
jg 0x7c40f
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
addl $0xa, %eax
subl $0x61, %eax
cltq
movq %rax, -0x28(%rbp)
movl -0x2c(%rbp), %ecx
cmpq %rcx, %rax
setb %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x7c41e
jmp 0x7c46d
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x2c(%rbp), %eax
imulq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x7c45c
movl $0x22, %edi
callq 0x7c4e0
movq $-0x1, -0x20(%rbp)
jmp 0x7c49d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7c357
testb $0x1, -0x2d(%rbp)
je 0x7c47d
xorl %eax, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x7c49b
movl $0x16, %edi
callq 0x7c4e0
movq $-0x1, -0x20(%rbp)
jmp 0x7c49d
jmp 0x7c49d
cmpq $0x0, -0x10(%rbp)
je 0x7c4c8
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x7c4bb
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x7c4c6
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x7c4c8
movq -0x20(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)