// File: /workspace/github_c_makefile_star2_O3/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 0x4487
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4487
movslq 0x140(%rbx), %rax
testq %rax, %rax
jle 0x21aa9
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
jmp 0x21ab0
leaq 0x1e948(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x13096(%rip), %rdx     # 0x34b55
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
movl %eax, %ebp
movl 0x140(%rbx), %r14d
testl %eax, %eax
je 0x21af4
testl %r14d, %r14d
jle 0x21afc
movq 0x148(%rbx), %rax
movq %r14, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21b03
movl $0x1, %r12d
jmp 0x21b2d
leaq 0x1e8f5(%rip), %rsi     # 0x403f8
callq 0x14be9
leal -0x1(%r14), %ecx
movl %ecx, 0x140(%rbx)
movl 0x144(%rbx), %edx
cmpl %edx, %r14d
jle 0x21dc6
xorl %r12d, %r12d
testl %eax, %eax
sete %r12b
movl %ecx, %r14d
testl %r14d, %r14d
jle 0x21b4a
movq 0x148(%rbx), %rax
movl %r14d, %ecx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21b51
leaq 0x1e8a7(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x13002(%rip), %rdx     # 0x34b62
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
movl 0x140(%rbx), %r14d
testl %eax, %eax
je 0x21b93
testl %r14d, %r14d
jle 0x21b98
movq 0x148(%rbx), %rax
movq %r14, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21b9f
movb $0x1, %r13b
jmp 0x21bc6
leaq 0x1e859(%rip), %rsi     # 0x403f8
callq 0x14be9
leal -0x1(%r14), %ecx
movl %ecx, 0x140(%rbx)
movl 0x144(%rbx), %edx
cmpl %edx, %r14d
jle 0x21dc6
testl %eax, %eax
sete %r13b
movl %ecx, %r14d
testl %r14d, %r14d
jle 0x21be3
movq 0x148(%rbx), %rax
movl %r14d, %ecx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21bea
leaq 0x1e80e(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x134cb(%rip), %rdx     # 0x350c4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
movl 0x140(%rbx), %r15d
testl %eax, %eax
je 0x21c2c
testl %r15d, %r15d
jle 0x21c31
movq 0x148(%rbx), %rax
movq %r15, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21c38
movb $0x1, %r14b
jmp 0x21c5f
leaq 0x1e7c0(%rip), %rsi     # 0x403f8
callq 0x14be9
leal -0x1(%r15), %ecx
movl %ecx, 0x140(%rbx)
movl 0x144(%rbx), %edx
cmpl %edx, %r15d
jle 0x21dc6
testl %eax, %eax
sete %r14b
movl %ecx, %r15d
testl %r15d, %r15d
jle 0x21c7c
movq 0x148(%rbx), %rax
movl %r15d, %ecx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
jmp 0x21c83
leaq 0x1e775(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x12056(%rip), %rdx     # 0x33ce8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
movl %eax, %r15d
testl %eax, %eax
je 0x21cb7
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movq (%rsp), %rdx
xorl %ecx, %ecx
callq 0x662a
leal 0x2(%r12), %eax
testb %r13b, %r13b
cmovel %r12d, %eax
leal 0x4(%rax), %r12d
testb %r14b, %r14b
cmovel %eax, %r12d
movslq 0x140(%rbx), %rax
testq %rax, %rax
jle 0x21cef
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
jmp 0x21cf6
leaq 0x1e702(%rip), %rsi     # 0x403f8
movq %rbx, %rdi
callq 0x14fb2
leaq 0x12e59(%rip), %rdx     # 0x34b5e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
testl %eax, %eax
je 0x21d1d
movl %r15d, %eax
orl %ebp, %eax
je 0x21d25
jmp 0x21d71
movq %rbx, %rdi
callq 0x88f1
movslq 0x140(%rbx), %rax
cmpq $0x2, %rax
jge 0x21d3b
leaq 0x1e6bf(%rip), %rsi     # 0x403f8
jmp 0x21d4e
movq 0x148(%rbx), %rcx
shlq $0x4, %rax
leaq (%rcx,%rax), %rsi
addq $-0x20, %rsi
movq %rbx, %rdi
callq 0x14fb2
leaq 0x11225(%rip), %rdx     # 0x32f82
movq %rbx, %rdi
movq %rax, %rsi
callq 0x162b5
testl %eax, %eax
je 0x21d82
orl %ebp, %r15d
je 0x21d8a
leaq 0x12e38(%rip), %rsi     # 0x34bb0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xca10
movq %rbx, %rdi
callq 0x88f1
movq %rbx, %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
movq (%rsp), %rdx
movl %r12d, %ecx
callq 0x161aa
movl 0x140(%rbx), %ecx
movl 0x144(%rbx), %eax
addl $-0x2, %ecx
movl %ecx, 0x140(%rbx)
cmpl %eax, %ecx
jl 0x21dce
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, 0x140(%rbx)
jmp 0x21dd4
movl %eax, 0x140(%rbx)
leaq 0x119c3(%rip), %rsi     # 0x3379e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc666