// File: /workspace/github_c_makefile_star2_O1/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 0xdd83(%rip), %rax      # 0x1e170
movq 0xe1cc(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rdi,8), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x695c(%rip), %rdi      # 0x16d5f
callq 0x4341
movq 0xdd61(%rip), %rcx      # 0x1e170
movq (%rcx,%rbx,8), %rsi
testq %rsi, %rsi
js 0x1067e
movq %rax, %r14
movq 0xe1ba(%rip), %rax      # 0x1e5e0
testb $0x19, (%rax,%rsi)
je 0x104a6
testq %rsi, %rsi
js 0x1067e
movq 0xe1a4(%rip), %rax      # 0x1e5e0
testb $0x10, (%rax,%rsi)
je 0x10581
cmpq $-0x24, (%rcx,%rsi,8)
jne 0x10581
movq 0xe168(%rip), %rax      # 0x1e5c0
testl %r14d, %r14d
js 0x106a9
movq (%rax,%rsi,8), %rdx
movq 0xe17c(%rip), %rsi      # 0x1e5e8
movq -0x8(%rsi,%rdx,8), %rdi
addq $0x7, %rdi
shrq $0x3, %rdi
cmpl %edi, %r14d
jge 0x106a9
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 0x10691
movq $-0x1, %rdi
movq $-0x1, %rsi
xorl %edx, %edx
callq 0x36e8
movq %rax, %r15
movq 0xdc63(%rip), %rsi      # 0x1e128
movq %rax, %rdi
xorl %edx, %edx
callq 0x36e8
movq %rax, 0xdc52(%rip)      # 0x1e128
movq 0xdc93(%rip), %rax      # 0x1e170
movq (%rax,%rbx,8), %r12
cmpq $-0x1, %r12
je 0x10539
testl %r14d, %r14d
je 0x10539
decl %r14d
movq %r15, %r13
movq 0xdc77(%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 0xe0a0(%rip), %rax      # 0x1e5c0
movq %r15, (%rax,%r13,8)
movq (%rax,%r12,8), %r12
addl $-0x1, %r14d
setb %al
cmpq $-0x1, %r12
je 0x10539
testb %al, %al
jne 0x104ef
movq 0xdc30(%rip), %rax      # 0x1e170
movq 0xe079(%rip), %rcx      # 0x1e5c0
movq (%rcx,%rbx,8), %rdx
cmpq $-0x1, %r12
je 0x106a3
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 0x3851
testq %rsi, %rsi
js 0x1067e
movq 0xe04f(%rip), %r8       # 0x1e5e0
testb $0x10, (%r8,%rsi)
je 0x1067e
cmpq $-0x21, (%rcx,%rsi,8)
jne 0x1067e
movq 0xe012(%rip), %rdi      # 0x1e5c0
movq (%rdi,%rbx,8), %rdx
movq (%rdi,%rdx,8), %rax
movq (%rcx,%rax,8), %rax
testq %rax, %rax
js 0x106ba
testb $0x1, (%r8,%rax)
je 0x106ba
cmpq $-0x16, (%rcx,%rax,8)
jne 0x106ba
testl %r14d, %r14d
js 0x106c6
movq 0xdfff(%rip), %rax      # 0x1e5e8
movq (%rdi,%rsi,8), %rsi
movq -0x8(%rax,%rsi,8), %rax
leal -0x1(%rax), %esi
cmpl %r14d, %esi
jle 0x106c6
movl %eax, %r12d
leaq 0x72ee(%rip), %rdi      # 0x178f6
callq 0x7d11
movq %rax, %r15
movq 0xdfd1(%rip), %rax      # 0x1e5e8
movq 0xdfa2(%rip), %rcx      # 0x1e5c0
movq (%rcx,%r15,8), %rdx
leaq (%rax,%rdx,8), %rdi
movq 0xdb43(%rip), %rdx      # 0x1e170
movq (%rdx,%rbx,8), %rdx
movq (%rcx,%rdx,8), %rcx
leaq (%rax,%rcx,8), %rsi
movq %r12, %rdx
callq 0x3130
movq 0xdb28(%rip), %rax      # 0x1e170
movq 0xdf71(%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 0xdf77(%rip), %rcx      # 0x1e5e8
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movb %al, (%r14,%rcx)
jmp 0x10691
leaq 0x66f6(%rip), %rdi      # 0x16d7b
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 (%rax,%rdx,8), %rsi
jmp 0x106b1
movq (%rax,%rbx,8), %rax
movq (%rcx,%rax,8), %rsi
leaq 0x66ab(%rip), %rdi      # 0x16d63
jmp 0x10685
leaq 0x66db(%rip), %rdi      # 0x16d9c
movq %rax, %rsi
jmp 0x10685
movq (%rcx,%rdx,8), %rsi
jmp 0x106b1