// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/blob.c
// Function: bloblit
static size_t
bloblit(Blob *seq, Htab *strtab, Node *v, Type *ty)
{
	char buf[128];
	char *lbl;
	size_t sz;
	Blobtype intsz[] = {
		[1] = Bti8,
		[2] = Bti16,
		[4] = Bti32,
		[8] = Bti64
	};
	union {
		float fv;
		double dv;
		uint64_t qv;
		uint32_t lv;
	} u;

	assert(v->type == Nlit);
	sz = tysize(ty);
	switch (v->lit.littype) {
	case Lvoid:	break;
	case Lint:	b(seq, mkblobi(intsz[sz], v->lit.intval));	break;
	case Lbool:	b(seq, mkblobi(Bti8, v->lit.boolval));	break;
	case Lchr:	b(seq, mkblobi(Bti32, v->lit.chrval));	break;
	case Lflt:
		if (tybase(v->lit.type)->type == Tyflt32) {
			u.fv = v->lit.fltval;
			b(seq, mkblobi(Bti32, u.lv));
		} else if (tybase(v->lit.type)->type == Tyflt64) {
			u.dv = v->lit.fltval;
			b(seq, mkblobi(Bti64, u.qv));
		}
		break;
	case Lstr:
		if (hthas(strtab, &v->lit.strval)) {
			lbl = htget(strtab, &v->lit.strval);
		} else {
			lbl = genlocallblstr(buf, sizeof buf);
			htput(strtab, &v->lit.strval, strdup(lbl));
		}
		if (v->lit.strval.len > 0)
			b(seq, mkblobref(lbl, 0, 1));
		else
			b(seq, mkblobi(Bti64, 0));
		b(seq, mkblobi(Bti64, v->lit.strval.len));
		break;
	case Lfunc:
		lbl = asmname(v);
		b(seq, mkblobi(Bti64, 0));
		b(seq, mkblobref(lbl, 0, 0));
		break;
	case Llbl:
		die("Can't generate literal labels, ffs. They're not data.");
		break;
	}
	return sz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0xe0(%rbp), %rdi
xorl %esi, %esi
movl $0x24, %edx
callq 0x6180
movl $0x1, -0xd8(%rbp)
movl $0x2, -0xd0(%rbp)
movl $0x3, -0xc0(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x9, 0x8(%rax)
jne 0x70b8
jmp 0x70d7
leaq 0x440ed(%rip), %rdi     # 0x4b1ac
leaq 0x44091(%rip), %rsi     # 0x4b157
movl $0x87, %edx
leaq 0x440ea(%rip), %rcx     # 0x4b1bc
callq 0x6160
movq -0x20(%rbp), %rdi
callq 0x1c0f0
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0xf0(%rbp)
subq $0x7, %rax
ja 0x73f5
movq -0xf0(%rbp), %rax
leaq 0x43f3b(%rip), %rcx     # 0x4b048
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x73f5
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xb0(%rbp), %rax
movl -0xe0(%rbp,%rax,4), %edi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x6480
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x73f5
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rax
movslq 0x30(%rax), %rsi
xorl %edi, %edi
callq 0x6480
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x73f5
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, %esi
movl $0x2, %edi
callq 0x6480
movq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x73f5
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x36a30
cmpl $0xf, (%rax)
jne 0x720a
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0xe8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, %esi
movl $0x2, %edi
callq 0x6480
movq -0x110(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x725a
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x36a30
cmpl $0x10, (%rax)
jne 0x7258
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0xe8(%rbp), %rsi
movl $0x3, %edi
callq 0x6480
movq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x725a
jmp 0x73f5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
addq $0x18, %rsi
callq 0x496f0
cmpl $0x0, %eax
je 0x7297
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
addq $0x18, %rsi
callq 0x49490
movq %rax, -0xa8(%rbp)
jmp 0x72ef
leaq -0xa0(%rbp), %rdi
movl $0x80, %esi
callq 0x7ac0
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rax
addq $0x18, %rax
addq $0x18, %rax
movq %rax, -0x120(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x6330
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
movq %rax, %rdx
callq 0x49100
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jbe 0x732b
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x65a0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x7353
movq -0x8(%rbp), %rax
movq %rax, -0x138(%rbp)
movl $0x3, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6480
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x3, %edi
callq 0x6480
movq -0x140(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x73f5
movq -0x18(%rbp), %rdi
callq 0x7720
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
movl $0x3, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6480
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x65a0
movq -0x148(%rbp), %rdi
movq %rax, %rsi
callq 0x66a0
jmp 0x73f5
leaq 0x43dfd(%rip), %rdi     # 0x4b1eb
movb $0x0, %al
callq 0x1df20
movq -0xb0(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)