// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]cproc/qbe.c
// Function: funcexpr
struct value *
funcexpr(struct func *f, struct expr *e)
{
	enum instkind op = INONE;
	struct decl *d;
	struct value *l, *r, *v, **argvals;
	struct lvalue lval;
	struct expr *arg;
	struct block *b[3];
	struct type *t, *functype;
	size_t i;

	calcvla(f, e->type);
	switch (e->kind) {
	case EXPRIDENT:
		d = e->u.ident.decl;
		switch (d->kind) {
		case DECLOBJECT: return funcload(f, e->type, (struct lvalue){d->value});
		case DECLCONST:  return d->value;
		default:
			fatal("unimplemented declaration kind %d", d->kind);
		}
		break;
	case EXPRCONST:
		t = e->type;
		if (t->prop & PROPINT || t->kind == TYPEPOINTER)
			return mkintconst(e->u.constant.u);
		assert(t->prop & PROPFLOAT);
		return mkfltconst(t->size == 4 ? VALUE_FLTCONST : VALUE_DBLCONST, e->u.constant.f);
	case EXPRBITFIELD:
	case EXPRCOMPOUND:
		lval = funclval(f, e);
		return funcload(f, e->type, lval);
	case EXPRINCDEC:
		lval = funclval(f, e->base);
		l = funcload(f, e->base->type, lval);
		t = e->type;
		if (t->kind == TYPEPOINTER) {
			r = mkintconst(t->base->size);
		} else if (t->prop & PROPINT) {
			r = mkintconst(1);
		} else if (t->prop & PROPFLOAT) {
			r = mkfltconst(t->size == 4 ? VALUE_FLTCONST : VALUE_DBLCONST, 1);
		} else {
			fatal("not a scalar");
			return NULL;  /* unreachable */
		}
		v = funcinst(f, e->op == TINC ? IADD : ISUB, qbetype(t).base, l, r);
		v = funcstore(f, e->type, e->qual, lval, v);
		return e->u.incdec.post ? l : v;
	case EXPRCALL:
		argvals = xreallocarray(NULL, e->u.call.nargs, sizeof(argvals[0]));
		for (arg = e->u.call.args, i = 0; arg; arg = arg->next, ++i) {
			emittype(arg->type);
			argvals[i] = funcexpr(f, arg);
		}
		t = e->type;
		emittype(t);
		v = funcinst(f, ICALL, qbetype(t).base, funcexpr(f, e->base), t->value);
		functype = e->base->type->base;
		for (arg = e->u.call.args, i = 0; arg; arg = arg->next, ++i) {
			if (functype->u.func.isvararg && i == functype->u.func.nparam)
				funcinst(f, IVARARG, 0, NULL, NULL);
			t = arg->type;
			funcinst(f, IARG, qbetype(t).base, argvals[i], t->value);
		}
		e = e->base;
		if (e->kind == EXPRUNARY && e->op == TBAND) {
			e = e->base;
			if (e->kind == EXPRIDENT && e->u.ident.decl->u.func.isnoreturn)
				funchlt(f);
		}
		return v;
	case EXPRUNARY:
		switch (e->op) {
		case TBAND:
			lval = funclval(f, e->base);
			return lval.addr;
		case TMUL:
			r = funcexpr(f, e->base);
			return funcload(f, e->type, (struct lvalue){r});
		case TSUB:
			r = funcexpr(f, e->base);
			return funcinst(f, INEG, qbetype(e->type).base, r, NULL);
		}
		fatal("internal error; unknown unary expression");
		break;
	case EXPRCAST:
		if (e->toeval)
			funcexpr(f, e->toeval);
		l = funcexpr(f, e->base);
		return convert(f, e->type, e->base->type, l);
	case EXPRBINARY:
		l = funcexpr(f, e->u.binary.l);
		if (e->op == TLOR || e->op == TLAND) {
			b[0] = mkblock("logic_right");
			b[1] = mkblock("logic_join");
			t = e->u.binary.l->type;
			if (e->op == TLOR) {
				funcjnz(f, l, t, b[1], b[0]);
				b[1]->phi.val[0] = mkintconst(1);
			} else {
				funcjnz(f, l, t, b[0], b[1]);
				b[1]->phi.val[0] = mkintconst(0);
			}
			b[1]->phi.blk[0] = f->end;
			funclabel(f, b[0]);
			r = funcexpr(f, e->u.binary.r);
			b[1]->phi.val[1] = convert(f, &typebool, e->u.binary.r->type, r);
			b[1]->phi.blk[1] = f->end;
			funclabel(f, b[1]);
			functemp(f, &b[1]->phi.res);
			b[1]->phi.class = 'w';
			return &b[1]->phi.res;
		}
		r = funcexpr(f, e->u.binary.r);
		t = e->u.binary.l->type;
		if (t->kind == TYPEPOINTER)
			t = &typeulong;
		switch (e->op) {
		case TMUL:
			op = IMUL;
			break;
		case TDIV:
			op = !(t->prop & PROPINT) || t->u.basic.issigned ? IDIV : IUDIV;
			break;
		case TMOD:
			op = t->u.basic.issigned ? IREM : IUREM;
			break;
		case TADD:
			op = IADD;
			break;
		case TSUB:
			op = ISUB;
			break;
		case TSHL:
			op = ISHL;
			break;
		case TSHR:
			op = t->u.basic.issigned ? ISAR : ISHR;
			break;
		case TBOR:
			op = IOR;
			break;
		case TBAND:
			op = IAND;
			break;
		case TXOR:
			op = IXOR;
			break;
		case TLESS:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICLTS : t->u.basic.issigned ? ICSLTW : ICULTW;
			else
				op = t->prop & PROPFLOAT ? ICLTD : t->u.basic.issigned ? ICSLTL : ICULTL;
			break;
		case TGREATER:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICGTS : t->u.basic.issigned ? ICSGTW : ICUGTW;
			else
				op = t->prop & PROPFLOAT ? ICGTD : t->u.basic.issigned ? ICSGTL : ICUGTL;
			break;
		case TLEQ:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICLES : t->u.basic.issigned ? ICSLEW : ICULEW;
			else
				op = t->prop & PROPFLOAT ? ICLED : t->u.basic.issigned ? ICSLEL : ICULEL;
			break;
		case TGEQ:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICGES : t->u.basic.issigned ? ICSGEW : ICUGEW;
			else
				op = t->prop & PROPFLOAT ? ICGED : t->u.basic.issigned ? ICSGEL : ICUGEL;
			break;
		case TEQL:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICEQS : ICEQW;
			else
				op = t->prop & PROPFLOAT ? ICEQD : ICEQL;
			break;
		case TNEQ:
			if (t->size <= 4)
				op = t->prop & PROPFLOAT ? ICNES : ICNEW;
			else
				op = t->prop & PROPFLOAT ? ICNED : ICNEL;
			break;
		}
		if (op == INONE)
			fatal("internal error; unimplemented binary expression");
		return funcinst(f, op, qbetype(e->type).base, l, r);
	case EXPRCOND:
		b[0] = mkblock("cond_true");
		b[1] = mkblock("cond_false");
		b[2] = mkblock("cond_join");

		v = funcexpr(f, e->base);
		funcjnz(f, v, e->base->type, b[0], b[1]);

		funclabel(f, b[0]);
		b[2]->phi.val[0] = funcexpr(f, e->u.cond.t);
		b[2]->phi.blk[0] = f->end;
		funcjmp(f, b[2]);

		funclabel(f, b[1]);
		b[2]->phi.val[1] = funcexpr(f, e->u.cond.f);
		b[2]->phi.blk[1] = f->end;

		funclabel(f, b[2]);
		if (e->type == &typevoid)
			return NULL;
		functemp(f, &b[2]->phi.res);
		b[2]->phi.class = qbetype(e->type).base;
		return &b[2]->phi.res;
	case EXPRASSIGN:
		r = funcexpr(f, e->u.assign.r);
		if (e->u.assign.l->kind == EXPRTEMP) {
			e->u.assign.l->u.temp = r;
		} else {
			lval = funclval(f, e->u.assign.l);
			r = funcstore(f, e->u.assign.l->type, e->u.assign.l->qual, lval, r);
		}
		return r;
	case EXPRCOMMA:
		for (e = e->base; e->next; e = e->next)
			funcexpr(f, e);
		return funcexpr(f, e);
	case EXPRBUILTIN:
		switch (e->u.builtin.kind) {
		case BUILTINVASTART:
			l = funcexpr(f, e->base);
			funcinst(f, IVASTART, 0, l, NULL);
			break;
		case BUILTINVAARG:
			if (e->toeval)
				funcexpr(f, e->toeval);
			/* https://todo.sr.ht/~mcf/cproc/52 */
			if (!(e->type->prop & PROPSCALAR))
				error(&tok.loc, "va_arg with non-scalar type is not yet supported");
			l = funcexpr(f, e->base);
			return funcinst(f, IVAARG, qbetype(e->type).base, l, NULL);
		case BUILTINALLOCA:
			l = funcexpr(f, e->base);
			return funcinst(f, IALLOC16, ptrclass, l, NULL);
		case BUILTINUNREACHABLE:
			return NULL;
		default:
			fatal("internal error: unimplemented builtin");
		}
		return NULL;
	case EXPRTEMP:
		assert(e->u.temp);
		return e->u.temp;
	case EXPRSIZEOF:
		t = e->u.szof.type;
		assert(t->kind == TYPEARRAY);
		calcvla(f, t);
		/* if the sizeof operand has VLA type, we must evaluate it */
		if (e->base)
			funcexpr(f, e->base);
		return t->u.array.size;
	}
	fatal("unimplemented expression %d", e->kind);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xfef3
movl (%r14), %eax
cmpl $0xc, %eax
jne 0xf284
movq 0x18(%r14), %r14
cmpq $0x0, 0x20(%r14)
je 0xf254
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf240
movq 0x20(%r14), %r14
jmp 0xf26c
cmpl $0xf, %eax
ja 0xfa55
movl %eax, %eax
leaq 0x647a(%rip), %rcx      # 0x15710
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
callq 0x100a6
movq %rdx, %rcx
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
jmp 0xfa0c
movq 0x38(%r14), %rsi
movl $0x8, %edx
xorl %edi, %edi
callq 0xe10a
movq %rax, 0x8(%rsp)
movq 0x30(%r14), %r15
testq %r15, %r15
je 0xf304
movq 0x8(%rsp), %r12
movq 0x8(%r15), %rdi
callq 0xe59f
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf240
movq %rax, (%r12)
movq 0x20(%r15), %r15
addq $0x8, %r12
testq %r15, %r15
jne 0xf2df
movq 0x8(%r14), %r15
movq %r15, %rdi
callq 0xe59f
movq %r15, %rdi
callq 0x102ec
movsbl %al, %ebp
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq 0x18(%r15), %r8
movq %rbx, %rdi
movl $0x56, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x101fd
movq %rax, 0x10(%rsp)
movq 0x30(%r14), %rbp
testq %rbp, %rbp
je 0xf3b0
movq 0x18(%r14), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %r15
xorl %r12d, %r12d
cmpb $0x1, 0x40(%r15)
jne 0xf37b
cmpq 0x50(%r15), %r12
jne 0xf37b
movq %rbx, %rdi
movl $0x5a, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x101fd
movq 0x8(%rbp), %r13
movq %r13, %rdi
callq 0x102ec
movsbl %al, %edx
movq 0x8(%rsp), %rax
movq (%rax,%r12,8), %rcx
movq 0x18(%r13), %r8
movq %rbx, %rdi
movl $0x59, %esi
callq 0x101fd
incq %r12
movq 0x20(%rbp), %rbp
testq %rbp, %rbp
jne 0xf35a
movq 0x18(%r14), %rax
cmpl $0x7, (%rax)
jne 0xf8b1
cmpl $0x4a, 0x14(%rax)
movq 0x10(%rsp), %rbp
jne 0xfc79
movq 0x18(%rax), %rax
cmpl $0x0, (%rax)
jne 0xfc79
movq 0x30(%rax), %rax
cmpb $0x1, 0x41(%rax)
jne 0xfc79
movq 0x30(%rbx), %rax
cmpl $0x0, 0x60(%rax)
jne 0xfc79
movl $0x4, 0x60(%rax)
jmp 0xfc79
movq 0x8(%r14), %rax
movl 0x4(%rax), %ecx
testb $0x2, %cl
jne 0xf416
cmpl $0xc, (%rax)
jne 0xf9b3
movq 0x30(%r14), %rbx
movl $0x10, %edi
callq 0xe13e
movq %rax, %rbp
movl $0x2, (%rax)
movq %rbx, 0x8(%rax)
jmp 0xfc79
movq 0x30(%r14), %rax
movl 0x8(%rax), %esi
cmpl $0x3, %esi
je 0xf997
cmpl $0x1, %esi
jne 0xf9a0
movq 0x8(%r14), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
jmp 0xfa0a
movl 0x14(%r14), %eax
cmpl $0x4d, %eax
je 0xfa1f
cmpl $0x4b, %eax
je 0xf9f4
cmpl $0x4a, %eax
jne 0xfa47
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x100a6
movq %rax, %rbp
jmp 0xfc79
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x100a6
movq %rax, %r15
movq %rdx, %r12
movq 0x18(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq 0x10037
movq 0x8(%r14), %rbp
cmpl $0xc, (%rbp)
jne 0xf8bb
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq 0x20(%rbp), %rax
movq 0x10(%rax), %r15
movl $0x10, %edi
callq 0xe13e
movq %rax, %r13
movl $0x2, (%rax)
movq %r15, 0x8(%rax)
jmp 0xfc22
movl 0x30(%r14), %eax
cmpl $0x7, %eax
jg 0xf8dc
testl %eax, %eax
je 0xfb6a
cmpl $0x7, %eax
je 0xf8aa
jmp 0xfb55
movl $0x88, %edi
callq 0xe13e
movq %rax, %r15
movl $0x7, %eax
movl %eax, (%r15)
movl $0x7, %r12d
leaq 0x6439(%rip), %rax      # 0x15974
movq %rax, 0x8(%r15)
movl 0xcbfb(%rip), %eax      # 0x1c140
incl %eax
movl %eax, 0xcbf3(%rip)      # 0x1c140
movl %eax, 0x4(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
xorl %ebp, %ebp
movq %rbp, 0x20(%r15)
movl %ebp, 0x60(%r15)
movl %ebp, 0x50(%r15)
movq %rbp, 0x80(%r15)
movl $0x88, %edi
callq 0xe13e
movq %rax, %r13
movl %r12d, (%rax)
leaq 0x63f9(%rip), %rax      # 0x1597e
movq %rax, 0x8(%r13)
movl 0xcbb1(%rip), %eax      # 0x1c140
incl %eax
movl %eax, 0xcba9(%rip)      # 0x1c140
movl %eax, 0x4(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movq %rbp, 0x20(%r13)
movl %ebp, 0x60(%r13)
movl %ebp, 0x50(%r13)
movq %rbp, 0x80(%r13)
movl $0x88, %edi
callq 0xe13e
movq %rax, %r12
movl $0x7, %eax
movl %eax, (%r12)
leaq 0x63b6(%rip), %rax      # 0x15989
movq %rax, 0x8(%r12)
movl 0xcb62(%rip), %eax      # 0x1c140
incl %eax
movl %eax, 0xcb5a(%rip)      # 0x1c140
movl %eax, 0x4(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq %rbp, 0x20(%r12)
movl %ebp, 0x60(%r12)
movl %ebp, 0x50(%r12)
movq %rbp, 0x80(%r12)
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq 0x18(%r14), %rcx
movq 0x8(%rcx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rcx
movq %r13, %r8
callq 0xedeb
movq 0x30(%rbx), %rax
movq %r15, 0x80(%rax)
movq %r15, 0x30(%rbx)
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, 0x40(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x30(%r12)
movq 0x30(%rbx), %rax
cmpl %ebp, 0x60(%rax)
jne 0xf66d
movl $0x1, 0x60(%rax)
movq %r12, 0x70(%rax)
movq 0x30(%rbx), %rax
movq %r13, 0x80(%rax)
movq %r13, 0x30(%rbx)
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, 0x48(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x38(%r12)
movq 0x30(%rbx), %rax
movq %r12, 0x80(%rax)
movq %r12, 0x30(%rbx)
movq 0x8(%r14), %rax
cmpq 0xb8f0(%rip), %rax      # 0x1afa0
je 0xf8aa
movq %r12, %rbp
addq $0x50, %rbp
movl $0x5, 0x50(%r12)
movq $0x0, 0x58(%r12)
movl 0x58(%rbx), %eax
incl %eax
movl %eax, 0x58(%rbx)
movl %eax, 0x54(%r12)
movq 0x8(%r14), %rdi
callq 0x102ec
movsbl %al, %eax
movl %eax, 0x28(%r12)
jmp 0xfc79
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, %rbp
movq 0x30(%r14), %rsi
cmpl $0xe, (%rsi)
jne 0xf916
movq %rbp, 0x30(%rsi)
jmp 0xfc79
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0xf728
movq %rbx, %rdi
callq 0xf240
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq 0x8(%r14), %rsi
movq 0x18(%r14), %rcx
movq 0x8(%rcx), %rdx
movq %rbx, %rdi
movq %rax, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xee7a
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, %r15
movl 0x14(%r14), %eax
andl $-0x2, %eax
cmpl $0x5c, %eax
jne 0xf948
movq %r15, 0x8(%rsp)
movl $0x88, %edi
callq 0xe13e
movq %rax, %r13
movl $0x7, %ebp
movl %ebp, (%rax)
leaq 0x6195(%rip), %rax      # 0x1592d
movq %rax, 0x8(%r13)
movl 0xc99e(%rip), %eax      # 0x1c140
incl %eax
movl %eax, 0xc996(%rip)      # 0x1c140
movl %eax, 0x4(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
xorl %r15d, %r15d
movq %r15, 0x20(%r13)
movl %r15d, 0x60(%r13)
movl %r15d, 0x50(%r13)
movq %r15, 0x80(%r13)
movl $0x88, %edi
callq 0xe13e
movq %rax, %r12
movl %ebp, (%rax)
leaq 0x6157(%rip), %rax      # 0x15939
movq %rax, 0x8(%r12)
movl 0xc953(%rip), %eax      # 0x1c140
incl %eax
movl %eax, 0xc94b(%rip)      # 0x1c140
movl %eax, 0x4(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq %r15, 0x20(%r12)
movl %r15d, 0x60(%r12)
movl %r15d, 0x50(%r12)
movq %r15, 0x80(%r12)
movq 0x30(%r14), %rax
movq 0x8(%rax), %rdx
cmpl $0x5d, 0x14(%r14)
jne 0xfa97
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rcx
movq %r13, %r8
callq 0xedeb
movl $0x1, %r15d
jmp 0xfaad
movq 0x30(%r14), %r15
cmpl $0xd, (%r15)
jne 0xfeb5
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfef3
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0xf875
movq %rbx, %rdi
callq 0xf240
movq 0x50(%r15), %rbp
jmp 0xfc79
movq 0x30(%r14), %rbp
testq %rbp, %rbp
jne 0xfc79
leaq 0x6158(%rip), %rdi      # 0x159ea
leaq 0x5fbb(%rip), %rsi      # 0x15854
leaq 0x604b(%rip), %rcx      # 0x158eb
movl $0x3b3, %edx            # imm = 0x3B3
callq 0x30e0
xorl %ebp, %ebp
jmp 0xfc79
movq 0x10(%rsp), %rbp
jmp 0xfc79
movl 0x4(%rbp), %ecx
testb $0x2, %cl
jne 0xfa6d
testb $0x20, %cl
jne 0xfbea
leaq 0x6049(%rip), %rdi      # 0x15920
jmp 0xfb5c
cmpl $0x8, %eax
je 0xfb88
cmpl $0xc, %eax
jne 0xfb55
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x57, %esi
xorl %edx, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x101fd
jmp 0xfc79
movq %rbx, %rdi
callq 0x100a6
movq %rdx, %r8
movq 0x30(%r14), %rcx
movq 0x8(%rcx), %rsi
movl 0x10(%rcx), %edx
movq %rbx, %rdi
movq %rax, %rcx
movq %rbp, %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe965
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, %r12
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
cmpl $0xc, (%rax)
jne 0xf96b
leaq 0xc39d(%rip), %rax      # 0x1bd08
movl 0x14(%r14), %ecx
xorl %ebp, %ebp
addl $-0x4a, %ecx
cmpl $0x11, %ecx
ja 0xfe28
leaq 0x5dcc(%rip), %rdx      # 0x15750
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0xb, %ebp
jmp 0xfe28
movq 0x20(%rax), %rbp
jmp 0xfc79
leaq 0x5f0e(%rip), %rdi      # 0x158b5
xorl %eax, %eax
callq 0xe054
jmp 0xfa55
testb $0x20, %cl
je 0xfed4
xorl %ebx, %ebx
cmpq $0x4, 0x10(%rax)
setne %bl
addl $0x3, %ebx
movsd 0x30(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x10, %edi
callq 0xe13e
movq %rax, %rbp
movl %ebx, (%rax)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0xfc79
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10037
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x102ec
movsbl %al, %edx
movq %rbx, %rdi
movl $0x3, %esi
jmp 0xfbdf
leaq 0x3726(%rip), %rdi      # 0x13174
xorl %eax, %eax
callq 0xe054
movl (%r14), %esi
leaq 0x5faa(%rip), %rdi      # 0x15a09
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xe054
jmp 0xfc79
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movl $0x10, %edi
callq 0xe13e
movq %rax, %r13
movl $0x2, (%rax)
movq $0x1, 0x8(%rax)
jmp 0xfc22
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rcx
movq %r12, %r8
callq 0xedeb
xorl %r15d, %r15d
movq %r12, %rbp
addq $0x50, %rbp
movl $0x10, %edi
callq 0xe13e
movl $0x2, (%rax)
movq %r15, 0x8(%rax)
movq %rax, 0x40(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x30(%r12)
movq 0x30(%rbx), %rax
movq %r13, 0x80(%rax)
movq %r13, 0x30(%rbx)
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq 0x38(%r14), %rcx
movq 0x8(%rcx), %rdx
leaq 0xbef0(%rip), %rsi      # 0x1b9f0
movq %rbx, %rdi
movq %rax, %rcx
callq 0xee7a
movq %rax, 0x48(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x38(%r12)
movq 0x30(%rbx), %rax
movq %r12, 0x80(%rax)
movq %r12, 0x30(%rbx)
movl $0x5, 0x50(%r12)
movq $0x0, 0x58(%r12)
movl 0x58(%rbx), %eax
incl %eax
movl %eax, 0x58(%rbx)
movl %eax, 0x54(%r12)
movl $0x77, 0x28(%r12)
jmp 0xfc79
leaq 0x5e68(%rip), %rdi      # 0x159c4
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xe054
jmp 0xfc79
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rbx, %rdi
movl $0x1f, %esi
movl $0x6c, %edx
movq %rax, %rcx
jmp 0xfbe2
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0xfb99
movq %rbx, %rdi
callq 0xf240
movq 0x8(%r14), %rax
testb $0x10, 0x4(%rax)
jne 0xfbbc
leaq 0xc55e(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x5dde(%rip), %rsi      # 0x15993
xorl %eax, %eax
callq 0xd56a
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf240
movq %rax, %r15
movq 0x8(%r14), %rdi
callq 0x102ec
movsbl %al, %edx
movq %rbx, %rdi
movl $0x58, %esi
movq %r15, %rcx
xorl %r8d, %r8d
jmp 0xfe51
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
xorl %r15d, %r15d
cmpq $0x4, 0x10(%rbp)
setne %r15b
addl $0x3, %r15d
movl $0x10, %edi
callq 0xe13e
movq %rax, %r13
movl %r15d, (%rax)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x8(%r13)
xorl %r15d, %r15d
cmpl $0x48, 0x14(%r14)
setne %r15b
incl %r15d
movq %rbp, %rdi
callq 0x102ec
movsbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
movq 0x10(%rsp), %r15
movq %r15, %rcx
movq %r13, %r8
callq 0x101fd
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
movq %rbx, %rdi
movq 0x8(%rsp), %rcx
movq %r12, %r8
movq %rax, %r9
callq 0xe965
movq %rax, %rbp
cmpb $0x0, 0x30(%r14)
cmovneq %r15, %rbp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %eax
ja 0xfdf1
testb $0x20, %al
movl $0x21, %eax
movl $0x35, %ebp
jmp 0xfe25
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %ecx
ja 0xfdff
movl $0x36, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x22(,%rax,4), %ebp
jmp 0xfe28
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %eax
ja 0xfe19
testb $0x20, %al
movl $0x20, %eax
movl $0x34, %ebp
jmp 0xfe25
movl $0x1, %ebp
jmp 0xfe28
movzbl 0x40(%rax), %eax
movl $0x8, %ebp
subl %eax, %ebp
jmp 0xfe28
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %ecx
ja 0xfe64
movl $0x38, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x24(,%rax,4), %ebp
jmp 0xfe28
movl $0x5, %ebp
jmp 0xfe28
movl $0xe, %ebp
jmp 0xfe28
movzbl 0x40(%rax), %ebp
xorl $0xd, %ebp
jmp 0xfe28
movl $0xa, %ebp
jmp 0xfe28
movl $0x9, %ebp
jmp 0xfe28
movl $0x2, %ebp
jmp 0xfe28
movl $0x4, %ebp
testb $0x2, 0x4(%rax)
je 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x4(,%rax,2), %ebp
jmp 0xfe28
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %ecx
ja 0xfe7e
movl $0x39, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x25(,%rax,4), %ebp
jmp 0xfe28
cmpq $0x4, 0x10(%rax)
movl 0x4(%rax), %ecx
ja 0xfe98
movl $0x37, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x23(,%rax,4), %ebp
jmp 0xfe28
testb $0x20, %al
movl $0x2b, %eax
movl $0x3d, %ebp
jmp 0xfe25
movl $0x3e, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x2c(,%rax,4), %ebp
jmp 0xfe28
testb $0x20, %al
movl $0x2a, %eax
movl $0x3c, %ebp
cmovel %eax, %ebp
testl %ebp, %ebp
jne 0xfe3a
leaq 0x5b11(%rip), %rdi      # 0x15944
xorl %eax, %eax
callq 0xe054
movq 0x8(%r14), %rdi
callq 0x102ec
movsbl %al, %edx
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rcx
movq %r12, %r8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x101fd
movl $0x40, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x2e(,%rax,4), %ebp
jmp 0xfe28
movl $0x41, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x2f(,%rax,4), %ebp
jmp 0xfe28
movl $0x3f, %ebp
testb $0x20, %cl
jne 0xfe28
movzbl 0x40(%rax), %eax
xorl $0x1, %eax
leal 0x2d(,%rax,4), %ebp
jmp 0xfe28
leaq 0x5b38(%rip), %rdi      # 0x159f4
leaq 0x5991(%rip), %rsi      # 0x15854
leaq 0x5a21(%rip), %rcx      # 0x158eb
movl $0x3b7, %edx            # imm = 0x3B7
callq 0x30e0
leaq 0x59fc(%rip), %rdi      # 0x158d7
leaq 0x5972(%rip), %rsi      # 0x15854
leaq 0x5a02(%rip), %rcx      # 0x158eb
movl $0x2d4, %edx            # imm = 0x2D4
callq 0x30e0