// File: /workspace/github_c_makefile_star2_O3/azhai[P]mlite/mlite.c
// Function: pp_set
cell pp_set(cell x) {
	int	p, k;
	cell	n, a, new;

	p = integer_value("set", cadr(x));
	if (tuple_p(car(x))) {
		a = node(NIL, NIL);
		save(a);
		for (n = car(x); n != NIL && p; n = cdr(n), p--) {
			car(a) = car(n);
			set(cdr(a), node(NIL, NIL));
			a = cdr(a);
		}
		if (n == NIL)
			return error("set: index out of range", cadr(x));
		car(a) = caddr(x);
		cdr(a) = cdr(n);
		return unsave(1);
	}
	if (vector_p(car(x))) {
		k = vector_len(car(x));
		if (p < 0 || p >= k)
			return error("set: index out of range", cadr(x));
		vector(car(x))[p] = caddr(x);
		return car(x);
	}
	if (!string_p(car(x)))
		return error("ref: expected str/tuple/vec, got", car(x));
	if (!char_p(caddr(x)))
		return error("ref: expected char, got", caddr(x));
	k = string_len(car(x))-1;
	if (p < 0 || p >= k)
		return error("set: index out of range", cadr(x));
	n = make_string("", k);
	memcpy(string(n), string(car(x)), k+1);
	string(n)[p] = char_value(caddr(x));
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xe02f(%rip), %rax      # 0x1e170
movq 0xe478(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rdi,8), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x6bed(%rip), %rdi      # 0x16d44
callq 0x432f
movq 0xe00d(%rip), %rcx      # 0x1e170
movq (%rcx,%rbx,8), %rsi
testq %rsi, %rsi
js 0x10185
movq %rax, %r14
movq 0xe46a(%rip), %rdi      # 0x1e5e0
movb (%rdi,%rsi), %al
testb $0x19, %al
je 0x10191
testb $0x10, %al
jne 0x1026c
leaq 0x6bd4(%rip), %rdi      # 0x16d60
jmp 0x103ca
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %r15
movq 0xdf78(%rip), %rsi      # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xdf67(%rip)      # 0x1e128
movq 0xdfa8(%rip), %rax      # 0x1e170
movq (%rax,%rbx,8), %r12
cmpq $-0x1, %r12
je 0x10224
testl %r14d, %r14d
je 0x10224
decl %r14d
movq %r15, %r13
movq 0xdf8c(%rip), %rax      # 0x1e170
movq (%rax,%r12,8), %rcx
movq %rcx, (%rax,%r15,8)
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %r15
movq 0xe3b5(%rip), %rax      # 0x1e5c0
movq %r15, (%rax,%r13,8)
movq (%rax,%r12,8), %r12
addl $-0x1, %r14d
setb %al
cmpq $-0x1, %r12
je 0x10224
testb %al, %al
jne 0x101da
movq 0xdf45(%rip), %rax      # 0x1e170
movq 0xe38e(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
cmpq $-0x1, %r12
je 0x103a9
movq (%rcx,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq %rdx, (%rax,%r15,8)
movq (%rcx,%r12,8), %rax
movq %rax, (%rcx,%r15,8)
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x384f
cmpq $-0x24, (%rcx,%rsi,8)
jne 0x102c8
movq 0xe346(%rip), %rax      # 0x1e5c0
testl %r14d, %r14d
js 0x103af
movq (%rax,%rsi,8), %rdx
movq 0xe35a(%rip), %rsi      # 0x1e5e8
movq -0x8(%rsi,%rdx,8), %rdi
addq $0x7, %rdi
shrq $0x3, %rdi
cmpl %edi, %r14d
jge 0x103af
leaq (%rsi,%rdx,8), %rdx
movq (%rax,%rbx,8), %rsi
movq (%rax,%rsi,8), %rax
movq (%rcx,%rax,8), %rax
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq %rax, (%rdx,%r14,8)
movq (%rcx,%rbx,8), %r15
jmp 0x103d6
cmpq $-0x21, (%rcx,%rsi,8)
jne 0x10185
movq 0xe2e6(%rip), %r8       # 0x1e5c0
movq (%r8,%rbx,8), %rdx
movq (%r8,%rdx,8), %rax
movq (%rcx,%rax,8), %rax
testq %rax, %rax
js 0x103c0
testb $0x1, (%rdi,%rax)
je 0x103c0
cmpq $-0x16, (%rcx,%rax,8)
jne 0x103c0
testl %r14d, %r14d
js 0x103e8
movq 0xe2d4(%rip), %rax      # 0x1e5e8
movq (%r8,%rsi,8), %rsi
movq -0x8(%rax,%rsi,8), %rax
leal -0x1(%rax), %esi
cmpl %r14d, %esi
jle 0x103e8
movl %eax, %r12d
leaq 0x75a5(%rip), %rdi      # 0x178d8
callq 0x7c7d
movq %rax, %r15
movq 0xe2a6(%rip), %rax      # 0x1e5e8
movq 0xe277(%rip), %rcx      # 0x1e5c0
movq (%rcx,%r15,8), %rdx
leaq (%rax,%rdx,8), %rdi
movq 0xde18(%rip), %rdx      # 0x1e170
movq (%rdx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rcx
leaq (%rax,%rcx,8), %rsi
movq %r12, %rdx
callq 0x3130
movq 0xddfd(%rip), %rax      # 0x1e170
movq 0xe246(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rdx
movq (%rax,%rdx,8), %rdx
movq (%rcx,%rdx,8), %rdx
movb (%rax,%rdx,8), %al
movq (%rcx,%r15,8), %rcx
shlq $0x3, %rcx
addq 0xe24c(%rip), %rcx      # 0x1e5e8
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movb %al, (%r14,%rcx)
jmp 0x103d6
movq (%rax,%rdx,8), %rsi
jmp 0x103b7
movq (%rax,%rbx,8), %rax
movq (%rcx,%rax,8), %rsi
leaq 0x698a(%rip), %rdi      # 0x16d48
jmp 0x103ca
leaq 0x69ba(%rip), %rdi      # 0x16d81
movq %rax, %rsi
callq 0x33eb
movq $-0x5, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rcx,%rdx,8), %rsi
jmp 0x103b7