// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[P]mujs/./jsrun.c
// Function: jsR_setproperty
static void jsR_setproperty(js_State *J, js_Object *obj, const char *name, int transient)
{
	js_Value *value = stackidx(J, -1);
	js_Property *ref;
	int k;
	int own;

	if (obj->type == JS_CARRAY) {
		if (!strcmp(name, "length")) {
			double rawlen = jsV_tonumber(J, value);
			int newlen = jsV_numbertointeger(rawlen);
			if (newlen != rawlen || newlen < 0)
				js_rangeerror(J, "invalid array length");
			if (newlen > JS_ARRAYLIMIT)
				js_rangeerror(J, "array too large");
			if (obj->u.a.simple) {
				obj->u.a.length = newlen;
				if (newlen <= obj->u.a.flat_length)
					obj->u.a.flat_length = newlen;
			} else  {
				jsV_resizearray(J, obj, newlen);
			}
			return;
		}

		if (js_isarrayindex(J, name, &k)) {
			if (obj->u.a.simple) {
				if (k >= 0 && k <= obj->u.a.flat_length) {
					jsR_setarrayindex(J, obj, k, value);
				} else {
					jsR_unflattenarray(J, obj);
					if (obj->u.a.length < k + 1)
						obj->u.a.length = k + 1;
				}
			} else {
				if (obj->u.a.length < k + 1)
					obj->u.a.length = k + 1;
			}
		}
	}

	else if (obj->type == JS_CSTRING) {
		if (!strcmp(name, "length"))
			goto readonly;
		if (js_isarrayindex(J, name, &k))
			if (k >= 0 && k < obj->u.s.length)
				goto readonly;
	}

	else if (obj->type == JS_CREGEXP) {
		if (!strcmp(name, "source")) goto readonly;
		if (!strcmp(name, "global")) goto readonly;
		if (!strcmp(name, "ignoreCase")) goto readonly;
		if (!strcmp(name, "multiline")) goto readonly;
		if (!strcmp(name, "lastIndex")) {
			obj->u.r.last = jsV_tointeger(J, value);
			return;
		}
	}

	else if (obj->type == JS_CUSERDATA) {
		if (obj->u.user.put && obj->u.user.put(J, obj->u.user.data, name))
			return;
	}

	/* First try to find a setter in prototype chain */
	ref = jsV_getpropertyx(J, obj, name, &own);
	if (ref) {
		if (ref->setter) {
			js_pushobject(J, ref->setter);
			js_pushobject(J, obj);
			js_pushvalue(J, *value);
			js_call(J, 1);
			js_pop(J, 1);
			return;
		} else {
			if (J->strict)
				if (ref->getter)
					js_typeerror(J, "setting property '%s' that only has a getter", name);
			if (ref->atts & JS_READONLY)
				goto readonly;
		}
	}

	/* Property not found on this object, so create one */
	if (!ref || !own) {
		if (transient) {
			if (J->strict)
				js_typeerror(J, "cannot create property '%s' on transient object", name);
			return;
		}
		ref = jsV_setproperty(J, obj, name);
	}

	if (ref) {
		if (!(ref->atts & JS_READONLY))
			ref->value = *value;
		else
			goto readonly;
	}

	return;

readonly:
	if (J->strict)
		js_typeerror(J, "'%s' is read-only", name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x140(%rdi), %rax
testq %rax, %rax
jle 0x15953
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %r12
addq $-0x10, %r12
jmp 0x1595a
leaq 0x2aa9e(%rip), %r12     # 0x403f8
movl (%r14), %eax
cmpl $0x8, %eax
jg 0x159c3
cmpl $0x1, %eax
je 0x159fb
cmpl $0x8, %eax
jne 0x15c1c
leaq 0x1de06(%rip), %rsi     # 0x33781
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15cfa
leaq 0x8(%rsp), %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x15659
testl %eax, %eax
setne %cl
movl (%r13), %eax
testl %eax, %eax
setns %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x15c1c
cmpl 0x20(%r14), %eax
jge 0x15c1c
jmp 0x15cfa
cmpl $0x9, %eax
je 0x15a67
cmpl $0xf, %eax
jne 0x15c1c
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x15c1c
movq 0x28(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq *%rax
testl %eax, %eax
jne 0x15d00
jmp 0x15c1c
leaq 0x1dd7f(%rip), %rsi     # 0x33781
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15b17
leaq 0x8(%rsp), %rdx
movq %r15, %rsi
callq 0x15659
testl %eax, %eax
je 0x15c1c
cmpl $0x0, 0x24(%r14)
je 0x15b4f
movl 0x8(%rsp), %r13d
testl %r13d, %r13d
js 0x15a46
cmpl 0x28(%r14), %r13d
jle 0x15c0b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x156ab
cmpl %r13d, 0x20(%r14)
jg 0x15c1c
incl %r13d
movl %r13d, 0x20(%r14)
jmp 0x15c1c
leaq 0x1f0ff(%rip), %rsi     # 0x34b6d
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15cfa
leaq 0x1f0ef(%rip), %rsi     # 0x34b74
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15cfa
leaq 0x1f0df(%rip), %rsi     # 0x34b7b
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15cfa
leaq 0x1f0d3(%rip), %rsi     # 0x34b86
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
je 0x15cfa
leaq 0x1f0c6(%rip), %rsi     # 0x34b90
movq %r15, %rdi
callq 0x32f0
testl %eax, %eax
jne 0x15c1c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14c75
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
je 0x15d0f
ucomisd %xmm0, %xmm1
jbe 0x15d13
xorpd 0x158fb(%rip), %xmm0    # 0x2b400
callq 0x3370
xorpd 0x158ee(%rip), %xmm0    # 0x2b400
jmp 0x15d18
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14c75
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
je 0x15b68
ucomisd %xmm0, %xmm1
movapd %xmm0, 0x10(%rsp)
jbe 0x15b7b
xorpd 0x158c0(%rip), %xmm0    # 0x2b400
callq 0x3370
xorpd 0x158b3(%rip), %xmm0    # 0x2b400
jmp 0x15b80
movl 0x8(%rsp), %eax
cmpl %eax, 0x20(%r14)
jg 0x15c1c
incl %eax
movl %eax, 0x20(%r14)
jmp 0x15c1c
xorl %edx, %edx
ucomisd %xmm1, %xmm0
jne 0x15d4f
jnp 0x15bd4
jmp 0x15d4f
callq 0x3370
movsd 0x158a8(%rip), %xmm1    # 0x2b430
ucomisd %xmm0, %xmm1
ja 0x15d4f
movsd 0x1589e(%rip), %xmm1    # 0x2b438
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
testl %edx, %edx
js 0x15d4f
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
movapd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x15d4f
jp 0x15d4f
cmpl $0x4000001, %edx        # imm = 0x4000001
jae 0x15d61
cmpl $0x0, 0x24(%r14)
je 0x15bf2
movl %edx, 0x20(%r14)
cmpl 0x28(%r14), %edx
jg 0x15d00
movl %edx, 0x28(%r14)
jmp 0x15d00
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12917
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
movq %r12, %rcx
callq 0x26fef
leaq 0xc(%rsp), %rcx
movq %r14, %rsi
movq %r15, %rdx
callq 0x12337
testq %rax, %rax
je 0x15cbf
movq 0x30(%rax), %rsi
testq %rsi, %rsi
je 0x15c9f
movq %rbx, %rdi
callq 0x4487
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4487
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x145a6
movq %rbx, %rdi
movl $0x1, %esi
callq 0x16762
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
leal -0x1(%rcx), %edx
movl %edx, 0x140(%rbx)
cmpl %eax, %ecx
jg 0x15d00
movl %eax, 0x140(%rbx)
leaq 0x1db09(%rip), %rsi     # 0x3379e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc666
cmpl $0x0, 0x34(%rbx)
je 0x15cb0
cmpq $0x0, 0x28(%rax)
jne 0x15d58
movl 0x14(%rax), %ecx
testb $0x1, %cl
jne 0x15cfa
cmpl $0x0, 0xc(%rsp)
jne 0x15ce8
testl %ebp, %ebp
je 0x15cd2
cmpl $0x0, 0x34(%rbx)
je 0x15d00
leaq 0x1f312(%rip), %rsi     # 0x34fe2
jmp 0x15d42
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x123f8
testq %rax, %rax
je 0x15d00
movl 0x14(%rax), %ecx
testb $0x1, %cl
jne 0x15cfa
movupd (%r12), %xmm0
movupd %xmm0, 0x18(%rax)
jmp 0x15d00
cmpl $0x0, 0x34(%rbx)
jne 0x15d3b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x15d34
callq 0x3370
movsd 0x15710(%rip), %xmm1    # 0x2b430
ucomisd %xmm0, %xmm1
ja 0x15d34
ucomisd 0x1570a(%rip), %xmm0    # 0x2b438
ja 0x15d34
cvttsd2si %xmm0, %eax
movw %ax, 0x32(%r14)
jmp 0x15d00
leaq 0x1f2d0(%rip), %rsi     # 0x35012
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xca10
leaq 0x1f23a(%rip), %rsi     # 0x34f90
jmp 0x15d68
leaq 0x1f256(%rip), %rsi     # 0x34fb5
jmp 0x15d42
leaq 0x1f23d(%rip), %rsi     # 0x34fa5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc7e2