// File: /workspace/github_c_makefile_star2_O1/azhai[P]mlite/mlite.c
// Function: pp_sub
cell pp_sub(cell x) {
	int	k;
	int	p0 = integer_value("sub", cadr(x));
	int	pn = integer_value("sub", caddr(x));
	char	*src, *dst;
	cell	n;

	if (!string_p(car(x)) && !list_p(car(x)))
		return error("sub: expected list/str, got", car(x));
	k = list_p(car(x)) || tuple_p(car(x))? length(car(x)):
						string_len(car(x))-1;
	if (p0 < 0 || p0 > k || pn < 0 || pn > k || pn < p0) {
		n = node(caddr(x), NIL);
		return error("sub: invalid range", node(cadr(x), n));
	}
	if (list_p(car(x)))
		return sublis(x, p0, pn, LIST_TAG);
	n = make_string("", pn-p0);
	dst = string(n);
	src = string(car(x));
	if (pn-p0 != 0)
		memcpy(dst, &src[p0], pn-p0);
	dst[pn-p0] = 0;
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xe188(%rip), %rax      # 0x1e170
movq 0xe5d1(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rdi,8), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x6cec(%rip), %r15      # 0x16cea
movq %r15, %rdi
callq 0x4341
movq %rax, %r14
movq 0xe160(%rip), %rax      # 0x1e170
movq 0xe5a9(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rsi
movq %r15, %rdi
callq 0x4341
movq %rax, %r15
movq 0xe13b(%rip), %rax      # 0x1e170
movq (%rax,%rbx,8), %rsi
testq %rsi, %rsi
js 0x10082
movq 0xe59b(%rip), %rcx      # 0x1e5e0
testb $0x10, (%rcx,%rsi)
je 0x10052
cmpq $-0x21, (%rax,%rsi,8)
je 0x10069
testq %rsi, %rsi
js 0x10082
movq 0xe582(%rip), %rcx      # 0x1e5e0
movb (%rcx,%rsi), %cl
andb $0x19, %cl
cmpb $0x8, %cl
jne 0x10088
testq %rsi, %rsi
js 0x10094
movq 0xe56b(%rip), %rcx      # 0x1e5e0
movb (%rcx,%rsi), %cl
andb $0x19, %cl
cmpb $0x8, %cl
jne 0x1009a
jmp 0x100c6
cmpq $-0x1, %rsi
je 0x10069
leaq 0x6c5f(%rip), %rdi      # 0x16cee
jmp 0x1018d
cmpq $-0x1, %rsi
je 0x100e6
testq %rsi, %rsi
js 0x100ac
movq 0xe53a(%rip), %rcx      # 0x1e5e0
testb $0x19, (%rcx,%rsi)
je 0x100c6
movq 0xe535(%rip), %rcx      # 0x1e5e8
movq 0xe506(%rip), %rdx      # 0x1e5c0
movq (%rdx,%rsi,8), %rdx
movl -0x8(%rcx,%rdx,8), %ecx
decl %ecx
jmp 0x100e8
cmpq $-0x1, %rsi
je 0x100e6
xorl %ecx, %ecx
movq 0xe4eb(%rip), %rdx      # 0x1e5c0
movq %rsi, %rdi
incl %ecx
movq (%rdx,%rdi,8), %rdi
cmpq $-0x1, %rdi
jne 0x100d8
jmp 0x100e8
xorl %ecx, %ecx
testl %r14d, %r14d
js 0x10142
cmpl %r14d, %ecx
jl 0x10142
testl %r15d, %r15d
js 0x10142
cmpl %r15d, %ecx
jl 0x10142
movl %r15d, %ecx
subl %r14d, %ecx
jl 0x10142
testq %rsi, %rsi
js 0x101ab
movq 0xe4cc(%rip), %rax      # 0x1e5e0
movb (%rax,%rsi), %al
andb $0x19, %al
cmpb $0x8, %al
jne 0x101b5
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
movl $0x8, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfee8
movq 0xe477(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq 0xe006(%rip), %rcx      # 0x1e170
movq 0xe44f(%rip), %rdx      # 0x1e5c0
movq (%rdx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x36e8
leaq 0x6b80(%rip), %rdi      # 0x16d0a
movq %rax, %rsi
callq 0x33eb
movq $-0x5, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $-0x1, %rsi
je 0x10121
leal 0x1(%rcx), %r13d
movq $-0x21, %rdi
movl %r13d, %esi
callq 0x417e
movq %rax, %r12
movq 0xe3ee(%rip), %rax      # 0x1e5c0
movq (%rax,%r12,8), %rdi
shlq $0x3, %rdi
addq 0xe407(%rip), %rdi      # 0x1e5e8
movslq %r13d, %rdx
xorl %esi, %esi
callq 0x30d0
movq 0xe3f6(%rip), %rax      # 0x1e5e8
movq 0xe3c7(%rip), %rcx      # 0x1e5c0
movq (%rcx,%r12,8), %rdx
leaq (%rax,%rdx,8), %r13
subl %r14d, %r15d
movslq %r15d, %r15
je 0x10234
movq 0xdf60(%rip), %rdx      # 0x1e170
movq (%rdx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rcx
leaq (%rax,%rcx,8), %rax
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
addq %rax, %r14
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3130
movb $0x0, (%r13,%r15)
jmp 0x10199