// File: /workspace/github_c_makefile_star2_O0/ccxvii[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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15050
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x16d62
movq -0x18(%rbp), %rdi
leaq 0x251eb(%rip), %rsi     # 0x3bdfc
callq 0x32d0
cmpl $0x0, %eax
jne 0x16cc0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15790
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x12d70
movl %eax, -0x44(%rbp)
cvtsi2sdl -0x44(%rbp), %xmm0
ucomisd -0x40(%rbp), %xmm0
jne 0x16c52
jp 0x16c52
cmpl $0x0, -0x44(%rbp)
jge 0x16c64
movq -0x8(%rbp), %rdi
leaq 0x269bd(%rip), %rsi     # 0x3d61a
movb $0x0, %al
callq 0xbd10
cmpl $0x4000000, -0x44(%rbp) # imm = 0x4000000
jle 0x16c7f
movq -0x8(%rbp), %rdi
leaq 0x269b7(%rip), %rsi     # 0x3d62f
movb $0x0, %al
callq 0xbd10
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x16cab
movl -0x44(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jg 0x16ca9
movl -0x44(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x16cbb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x44(%rbp), %edx
callq 0x12c20
jmp 0x1700c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x167c0
cmpl $0x0, %eax
je 0x16d5d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x16d3b
cmpl $0x0, -0x34(%rbp)
jl 0x16d0c
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jg 0x16d0c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x2db30
jmp 0x16d39
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x168a0
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x16d37
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x16d39
jmp 0x16d5b
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x16d59
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x16d5b
jmp 0x16d5d
jmp 0x16ea6
movq -0x10(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x16db9
movq -0x18(%rbp), %rdi
leaq 0x25086(%rip), %rsi     # 0x3bdfc
callq 0x32d0
cmpl $0x0, %eax
jne 0x16d85
jmp 0x16fec
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x167c0
cmpl $0x0, %eax
je 0x16db4
cmpl $0x0, -0x34(%rbp)
jl 0x16db2
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x16db2
jmp 0x16fec
jmp 0x16db4
jmp 0x16ea4
movq -0x10(%rbp), %rax
cmpl $0x9, (%rax)
jne 0x16e66
movq -0x18(%rbp), %rdi
leaq 0x26422(%rip), %rsi     # 0x3d1f3
callq 0x32d0
cmpl $0x0, %eax
jne 0x16de0
jmp 0x16fec
movq -0x18(%rbp), %rdi
leaq 0x2640f(%rip), %rsi     # 0x3d1fa
callq 0x32d0
cmpl $0x0, %eax
jne 0x16dfa
jmp 0x16fec
movq -0x18(%rbp), %rdi
leaq 0x263fc(%rip), %rsi     # 0x3d201
callq 0x32d0
cmpl $0x0, %eax
jne 0x16e14
jmp 0x16fec
movq -0x18(%rbp), %rdi
leaq 0x263ed(%rip), %rsi     # 0x3d20c
callq 0x32d0
cmpl $0x0, %eax
jne 0x16e2e
jmp 0x16fec
movq -0x18(%rbp), %rdi
leaq 0x263dd(%rip), %rsi     # 0x3d216
callq 0x32d0
cmpl $0x0, %eax
jne 0x16e64
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1b5c0
cvttsd2si %xmm0, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x32(%rax)
jmp 0x1700c
jmp 0x16ea2
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jne 0x16ea0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x16e9e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
movq -0x18(%rbp), %rdx
callq *%rax
cmpl $0x0, %eax
je 0x16e9e
jmp 0x1700c
jmp 0x16ea0
jmp 0x16ea2
jmp 0x16ea4
jmp 0x16ea6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x124f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x16f6d
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x16f28
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x4870
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4870
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0x14d40
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x17ea0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4400
jmp 0x1700c
movq -0x8(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x16f55
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x16f53
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x266f3(%rip), %rsi     # 0x3d63f
movb $0x0, %al
callq 0xbfe0
jmp 0x16f55
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16f69
jmp 0x16fec
jmp 0x16f6b
jmp 0x16f6d
cmpq $0x0, -0x30(%rbp)
je 0x16f7a
cmpl $0x0, -0x38(%rbp)
jne 0x16fb7
cmpl $0x0, -0x1c(%rbp)
je 0x16fa2
movq -0x8(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x16fa0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x266d3(%rip), %rsi     # 0x3d66c
movb $0x0, %al
callq 0xbfe0
jmp 0x1700c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x125d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x16fea
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x16fe6
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x20(%rax)
jmp 0x16fe8
jmp 0x16fec
jmp 0x16fea
jmp 0x1700c
movq -0x8(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x1700c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x26697(%rip), %rsi     # 0x3d69c
movb $0x0, %al
callq 0xbfe0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)