// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/6/simp.c
// Function: tupget
static Node *
tupget(Simp *s, Node *tup, size_t idx, Node *dst)
{
	Node *plv, *prv, *sz, *stor, *dcl;
	size_t off, i;
	Type *ty;

	off = 0;
	ty = exprtype(tup);
	for (i = 0; i < ty->nsub; i++) {
		off = alignto(off, ty->sub[i]);
		if (i == idx)
			break;
		off += tysize(ty->sub[i]);
	}

	if (!dst) {
		dst = gentemp(tup->loc, ty->sub[idx], &dcl);
		if (isstacktype(ty->sub[idx]))
			declarelocal(s, dcl);
	}
	prv = add(addr(s, tup, ty->sub[i]), disp(tup->loc, off));
	if (stacknode(dst)) {
		sz = disp(dst->loc, size(dst));
		plv = addr(s, dst, exprtype(dst));
		stor = mkexpr(dst->loc, Oblit, plv, prv, sz, NULL);
	} else {
		stor = set(dst, load(prv));
	}
	append(s, stor);
	return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30340
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0x1a12a
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x16770
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x1a0ff
jmp 0x1a12a
movq -0x60(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1c0f0
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a0c8
cmpq $0x0, -0x20(%rbp)
jne 0x1a17e
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq (%rax), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2ffd0
movq %rax, -0x20(%rbp)
movq -0x60(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x369d0
cmpl $0x0, %eax
je 0x1a17c
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x17210
jmp 0x1a17e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x60(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x16af0
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movl %ecx, %esi
movq (%rax), %rdi
callq 0x17540
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x174a0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x167b0
cmpl $0x0, %eax
je 0x1a24c
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1c480
movq %rax, %rcx
movq -0x80(%rbp), %rax
movl %ecx, %esi
movq (%rax), %rdi
callq 0x17540
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30340
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq %rax, %rdx
callq 0x16af0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movq (%rax), %rdi
movl $0x46, %esi
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x2f400
movq %rax, -0x40(%rbp)
jmp 0x1a273
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
callq 0x18380
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x17580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17710
movq -0x20(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)