// File: /workspace/github_c_makefile_star2_O2/ArtifexSoftware[P]mujs/./jsobject.c
// Function: ToPropertyDescriptor
static void ToPropertyDescriptor(js_State *J, js_Object *obj, const char *name, js_Object *desc)
{
	int haswritable = 0;
	int hasvalue = 0;
	int enumerable = 0;
	int configurable = 0;
	int writable = 0;
	int atts = 0;

	js_pushobject(J, obj);
	js_pushobject(J, desc);

	if (js_hasproperty(J, -1, "writable")) {
		haswritable = 1;
		writable = js_toboolean(J, -1);
		js_pop(J, 1);
	}
	if (js_hasproperty(J, -1, "enumerable")) {
		enumerable = js_toboolean(J, -1);
		js_pop(J, 1);
	}
	if (js_hasproperty(J, -1, "configurable")) {
		configurable = js_toboolean(J, -1);
		js_pop(J, 1);
	}
	if (js_hasproperty(J, -1, "value")) {
		hasvalue = 1;
		js_defproperty(J, -3, name, 0);
	}

	if (!writable) atts |= JS_READONLY;
	if (!enumerable) atts |= JS_DONTENUM;
	if (!configurable) atts |= JS_DONTCONF;

	if (js_hasproperty(J, -1, "get")) {
		if (haswritable || hasvalue)
			js_typeerror(J, "value/writable and get/set attributes are exclusive");
	} else {
		js_pushundefined(J);
	}

	if (js_hasproperty(J, -2, "set")) {
		if (haswritable || hasvalue)
			js_typeerror(J, "value/writable and get/set attributes are exclusive");
	} else {
		js_pushundefined(J);
	}

	js_defaccessor(J, -4, name, atts);

	js_pop(J, 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, (%rsp)
movq %rdi, %rbx
callq 0x4274
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4274
leaq 0x106bc(%rip), %rdx     # 0x29b30
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x10c15
movl %eax, %ebp
testl %eax, %eax
je 0x194aa
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xfaca
movl %eax, %r15d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3f3d
xorl %r12d, %r12d
testl %r15d, %r15d
sete %r12b
jmp 0x194ae
pushq $0x1
popq %r12
leaq 0x10688(%rip), %rdx     # 0x29b3d
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x10c15
movb $0x1, %r13b
movb $0x1, %r14b
testl %eax, %eax
je 0x194ea
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xfaca
movl %eax, %r15d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3f3d
testl %r15d, %r15d
sete %r14b
leaq 0x10bae(%rip), %rdx     # 0x2a09f
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x10c15
testl %eax, %eax
je 0x19520
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xfaca
movl %eax, %r15d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3f3d
testl %r15d, %r15d
sete %r13b
leaq 0xf791(%rip), %rdx      # 0x28cb8
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x10c15
movl %eax, %r15d
testl %eax, %eax
je 0x1954a
pushq $-0x3
popq %rsi
movq %rbx, %rdi
movq (%rsp), %rdx
xorl %ecx, %ecx
callq 0x5963
leaq 0x105e8(%rip), %rdx     # 0x29b39
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x10c15
testl %eax, %eax
je 0x19569
movl %r15d, %eax
orl %ebp, %eax
je 0x19571
jmp 0x1958c
movq %rbx, %rdi
callq 0x7336
leaq 0xe9da(%rip), %rdx      # 0x27f52
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x10c15
testl %eax, %eax
je 0x1959d
orl %ebp, %r15d
je 0x195a5
leaq 0x105f8(%rip), %rsi     # 0x29b8b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x99a6
movq %rbx, %rdi
callq 0x7336
leal 0x2(%r12), %eax
testb %r14b, %r14b
cmovel %r12d, %eax
leal 0x4(%rax), %ecx
testb %r13b, %r13b
cmovel %eax, %ecx
pushq $-0x4
popq %rsi
movq %rbx, %rdi
movq (%rsp), %rdx
callq 0x10b78
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f3d