// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsparse.c
// Function: jsP_foldconst
static int jsP_foldconst(js_Ast *node)
{
	double x, y;
	int a, b;

	if (node->type == AST_LIST) {
		while (node) {
			jsP_foldconst(node->a);
			node = node->b;
		}
		return 0;
	}

	if (node->type == EXP_NUMBER)
		return 1;

	a = node->a ? jsP_foldconst(node->a) : 0;
	b = node->b ? jsP_foldconst(node->b) : 0;
	if (node->c) jsP_foldconst(node->c);
	if (node->d) jsP_foldconst(node->d);

	if (a) {
		x = node->a->number;
		switch (node->type) {
		default: break;
		case EXP_NEG: return jsP_setnumnode(node, -x);
		case EXP_POS: return jsP_setnumnode(node, x);
		case EXP_BITNOT: return jsP_setnumnode(node, ~toint32(x));
		}

		if (b) {
			y = node->b->number;
			switch (node->type) {
			default: break;
			case EXP_MUL: return jsP_setnumnode(node, x * y);
			case EXP_DIV: return jsP_setnumnode(node, x / y);
			case EXP_MOD: return jsP_setnumnode(node, fmod(x, y));
			case EXP_ADD: return jsP_setnumnode(node, x + y);
			case EXP_SUB: return jsP_setnumnode(node, x - y);
			case EXP_SHL: return jsP_setnumnode(node, toint32(x) << (touint32(y) & 0x1F));
			case EXP_SHR: return jsP_setnumnode(node, toint32(x) >> (touint32(y) & 0x1F));
			case EXP_USHR: return jsP_setnumnode(node, touint32(x) >> (touint32(y) & 0x1F));
			case EXP_BITAND: return jsP_setnumnode(node, toint32(x) & toint32(y));
			case EXP_BITXOR: return jsP_setnumnode(node, toint32(x) ^ toint32(y));
			case EXP_BITOR: return jsP_setnumnode(node, toint32(x) | toint32(y));
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x11da8
jmp 0x11d7a
cmpq $0x0, -0x10(%rbp)
je 0x11d9c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11d60
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x11d7a
movl $0x0, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x11dbd
movl $0x1, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x11dda
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11d60
movl %eax, -0x2c(%rbp)
jmp 0x11de1
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x11de1
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x11e04
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x11d60
movl %eax, -0x30(%rbp)
jmp 0x11e0b
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0x11e0b
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x11e29
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x11d60
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x11e41
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x11d60
cmpl $0x0, -0x24(%rbp)
je 0x12158
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x1d, %eax
je 0x11eb0
jmp 0x11e6d
movl -0x34(%rbp), %eax
subl $0x1e, %eax
je 0x11e83
jmp 0x11e77
movl -0x34(%rbp), %eax
subl $0x1f, %eax
je 0x11ec6
jmp 0x11e81
jmp 0x11ef0
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movq -0x40(%rbp), %rdi
xorl $-0x1, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
cmpl $0x0, -0x28(%rbp)
je 0x12156
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x14, %eax
ja 0x11f34
movq -0x48(%rbp), %rax
leaq 0x21895(%rip), %rcx     # 0x337c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x12154
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
mulsd -0x20(%rbp), %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
divsd -0x20(%rbp), %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
callq 0x3190
movq -0x50(%rbp), %rdi
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
addsd -0x20(%rbp), %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movl %eax, -0x54(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cc30
movq -0x60(%rbp), %rdi
movl %eax, %ecx
movl -0x54(%rbp), %eax
andl $0x1f, %ecx
shll %cl, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movl %eax, -0x64(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cc30
movq -0x70(%rbp), %rdi
movl %eax, %ecx
movl -0x64(%rbp), %eax
andl $0x1f, %ecx
sarl %cl, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cc30
movl %eax, -0x74(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cc30
movq -0x80(%rbp), %rdi
movl %eax, %ecx
movl -0x74(%rbp), %eax
shrl %cl, %eax
cvtsi2sd %rax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movl %eax, -0x84(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cb40
movq -0x90(%rbp), %rdi
movl %eax, %ecx
movl -0x84(%rbp), %eax
andl %ecx, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movl %eax, -0x94(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cb40
movq -0xa0(%rbp), %rdi
movl %eax, %ecx
movl -0x94(%rbp), %eax
xorl %ecx, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2cb40
movl %eax, -0xa4(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2cb40
movq -0xb0(%rbp), %rdi
movl %eax, %ecx
movl -0xa4(%rbp), %eax
orl %ecx, %eax
cvtsi2sd %eax, %xmm0
callq 0x2cae0
movl %eax, -0x4(%rbp)
jmp 0x1215f
jmp 0x12156
jmp 0x12158
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)