// File: /workspace/github_c_makefile_star2_O0/igaw[P]jitterdebugger/jd_utils.c
// Function: cpuset_parse
ssize_t cpuset_parse(cpu_set_t *set, const char *str)
{
	unsigned int i, first, last;
	ssize_t len_next;
	long int num = 0;
	size_t len = 0;

	if (!strncmp(str, "0x", 2)) {
		num = _cpuset_parse_num(str, 16, &len);
		cpuset_from_bits(set, (unsigned long) num);
		return len;
	}

	num = _cpuset_parse_num(str, 10, &len);

	str += len;
	first = num;

	if (str[0] == '-') {
		num = _cpuset_parse_num(str + 1, 10, &len);
		str += 1 + len;
		last = len ? num + 1 : CPU_SETSIZE; /* "x-" means x-CPU_SIZE */
	} else
		last = first + 1;

	if (CPU_SETSIZE < last) {
		warn_handler("cpu num %d bigger than CPU_SETSIZE(%u), reducing",
			     last, CPU_SETSIZE);
		last = CPU_SETSIZE;
	}

	for (i = first; i < last; i++)
		CPU_SET(i, set);

	if (str[0] == ',') {
		len_next = cpuset_parse(set, str + 1);
		if (len_next < 0)
			return len_next;

		len += len_next;
	}

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1473(%rip), %rsi      # 0x40de
movl $0x2, %edx
callq 0x2050
cmpl $0x0, %eax
jne 0x2caa
movq -0x18(%rbp), %rdi
movl $0x10, %esi
leaq -0x40(%rbp), %rdx
callq 0x2e30
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x2e90
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e23
movq -0x18(%rbp), %rdi
movl $0xa, %esi
leaq -0x40(%rbp), %rdx
callq 0x2e30
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2d32
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movl $0xa, %esi
leaq -0x40(%rbp), %rdx
callq 0x2e30
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x2d1e
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2d29
movl $0x400, %eax            # imm = 0x400
movq %rax, -0x58(%rbp)
jmp 0x2d29
movq -0x58(%rbp), %rax
movl %eax, -0x24(%rbp)
jmp 0x2d3b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl $0x400, %eax            # imm = 0x400
cmpl -0x24(%rbp), %eax
jae 0x2d73
jmp 0x2d47
movl -0x24(%rbp), %ecx
leaq 0x1390(%rip), %rdi      # 0x40e1
leaq 0x13c4(%rip), %rsi      # 0x411c
leaq 0x13c8(%rip), %rdx      # 0x4127
movl $0x400, %r8d            # imm = 0x400
movb $0x0, %al
callq 0x2760
movl $0x400, -0x24(%rbp)     # imm = 0x400
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x2ddd
movl -0x1c(%rbp), %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x3, %rax
cmpq $0x80, %rax
jae 0x2dc2
movq -0x48(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
shrq $0x6, %rdx
orq (%rcx,%rdx,8), %rax
movq %rax, (%rcx,%rdx,8)
movq %rax, -0x60(%rbp)
jmp 0x2dca
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x2dca
movq -0x60(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2d79
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x2e1b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x2c40
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jge 0x2e0f
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2e23
movq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)