// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/typeinfo.c
// Function: tyoffset
ssize_t
tyoffset(Type *ty, Node *memb)
{
	size_t i;
	size_t off;

	ty = tybase(ty);
	if (ty->type == Typtr)
		ty = tybase(ty->sub[0]);

	switch (memb->type) {
	case Nname:
		assert(ty->type == Tystruct);
		off = 0;
		for (i = 0; i < ty->nmemb; i++) {
			off = alignto(off, decltype(ty->sdecls[i]));
			if (!strcmp(namestr(memb), declname(ty->sdecls[i])))
				return off;
			off += size(ty->sdecls[i]);
		}
		die("bad offset");
		return 0;
	case Nlit:
		assert(ty->type == Tytuple);
		assert(memb->lit.intval < ty->nsub);
		off = 0;
		for (i = 0; i < memb->lit.intval; i++) {
			off += tysize(ty->sub[i]);
			off = alignto(off, ty->sub[i+1]);
		}
		return off;
	default:
		die("bad offset node type");
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x36a30
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x12, (%rax)
jne 0x1c6da
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rdi
callq 0x36a30
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x9, %eax
je 0x1c7fb
jmp 0x1c6ef
movl -0x2c(%rbp), %eax
subl $0xa, %eax
jne 0x1c8c9
jmp 0x1c6fd
movq -0x10(%rbp), %rax
cmpl $0x17, (%rax)
jne 0x1c708
jmp 0x1c727
leaq 0x32121(%rip), %rdi     # 0x4e830
leaq 0x32042(%rip), %rsi     # 0x4e758
movl $0x170, %edx            # imm = 0x170
leaq 0x32123(%rip), %rcx     # 0x4e845
callq 0x6160
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jae 0x1c7ed
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30260
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x16770
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30600
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30200
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x6220
cmpl $0x0, %eax
jne 0x1c7bc
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1c8d7
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1c480
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1c737
leaq 0x32072(%rip), %rdi     # 0x4e866
movb $0x0, %al
callq 0x1df20
movq -0x10(%rbp), %rax
cmpl $0x16, (%rax)
jne 0x1c806
jmp 0x1c825
leaq 0x32064(%rip), %rdi     # 0x4e871
leaq 0x31f44(%rip), %rsi     # 0x4e758
movl $0x17b, %edx            # imm = 0x17B
leaq 0x32025(%rip), %rcx     # 0x4e845
callq 0x6160
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0x1c839
jmp 0x1c858
leaq 0x32045(%rip), %rdi     # 0x4e885
leaq 0x31f11(%rip), %rsi     # 0x4e758
movl $0x17c, %edx            # imm = 0x17C
leaq 0x31ff2(%rip), %rcx     # 0x4e845
callq 0x6160
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x1c8bf
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1c0f0
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rsi
callq 0x16770
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1c868
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1c8d7
leaq 0x31fd1(%rip), %rdi     # 0x4e8a1
movb $0x0, %al
callq 0x1df20
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)