// File: /workspace/github_c_makefile_star2_O0/ccxvii[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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4870
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4870
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x170bf(%rip), %rdx     # 0x3d1db
callq 0x17710
cmpl $0x0, %eax
je 0x2614c
movl $0x1, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15620
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4400
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x1708c(%rip), %rdx     # 0x3d1e8
callq 0x17710
cmpl $0x0, %eax
je 0x26185
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15620
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4400
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x175c0(%rip), %rdx     # 0x3d755
callq 0x17710
cmpl $0x0, %eax
je 0x261be
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15620
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4400
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x16195(%rip), %rdx     # 0x3c363
callq 0x17710
cmpl $0x0, %eax
je 0x261f3
movl $0x1, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
xorl %ecx, %ecx
callq 0x65c0
cmpl $0x0, -0x34(%rbp)
jne 0x26202
movl -0x38(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x26211
movl -0x38(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x26220
movl -0x38(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x16fb4(%rip), %rdx     # 0x3d1e4
callq 0x17710
cmpl $0x0, %eax
je 0x2625a
cmpl $0x0, -0x24(%rbp)
jne 0x26246
cmpl $0x0, -0x28(%rbp)
je 0x26258
movq -0x8(%rbp), %rdi
leaq 0x16fe5(%rip), %rsi     # 0x3d236
movb $0x0, %al
callq 0xbfe0
jmp 0x26263
movq -0x8(%rbp), %rdi
callq 0x8640
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x15373(%rip), %rdx     # 0x3b5e6
callq 0x17710
cmpl $0x0, %eax
je 0x2629d
cmpl $0x0, -0x24(%rbp)
jne 0x26289
cmpl $0x0, -0x28(%rbp)
je 0x2629b
movq -0x8(%rbp), %rdi
leaq 0x16fa2(%rip), %rsi     # 0x3d236
movb $0x0, %al
callq 0xbfe0
jmp 0x262a6
movq -0x8(%rbp), %rdi
callq 0x8640
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl -0x38(%rbp), %ecx
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x175d0
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x4400
addq $0x40, %rsp
popq %rbp
retq
nop