// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/evaluate.c
// Function: next_designators
static struct expression *next_designators(struct expression *old,
			     struct symbol *ctype,
			     struct expression *e, struct expression **v)
{
	struct expression *new = NULL;

	if (!old)
		return NULL;
	if (old->type == EXPR_INDEX) {
		struct expression *copy;
		unsigned n;

		copy = next_designators(old->idx_expression,
					old->ctype, e, v);
		if (!copy) {
			n = old->idx_to + 1;
			if (array_element_offset(old->ctype->bit_size, n) == ctype->bit_size) {
				convert_index(old);
				return NULL;
			}
			copy = e;
			*v = new = alloc_expression(e->pos, EXPR_INDEX);
		} else {
			n = old->idx_to;
			new = alloc_expression(e->pos, EXPR_INDEX);
		}

		new->idx_from = new->idx_to = n;
		new->idx_expression = copy;
		new->ctype = old->ctype;
		convert_index(old);
	} else if (old->type == EXPR_IDENTIFIER) {
		struct expression *copy;
		struct symbol *field;
		int offset = 0;

		copy = next_designators(old->ident_expression,
					old->ctype, e, v);
		if (!copy) {
			field = old->field->next_subobject;
			if (!field) {
				convert_ident(old);
				return NULL;
			}
			copy = e;
			*v = new = alloc_expression(e->pos, EXPR_IDENTIFIER);
			/*
			 * We can't necessarily trust "field->offset",
			 * because the field might be in an anonymous
			 * union, and the field offset is then the offset
			 * within that union.
			 *
			 * The "old->offset - old->field->offset"
			 * would be the offset of such an anonymous
			 * union.
			 */
			offset = old->offset - old->field->offset;
		} else {
			field = old->field;
			new = alloc_expression(e->pos, EXPR_IDENTIFIER);
		}

		new->field = field;
		new->expr_ident = field->ident;
		new->ident_expression = copy;
		new->ctype = field;
		new->offset = field->offset + offset;
		convert_ident(old);
	}
	return new;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3243c
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
movzbl (%rdi), %eax
cmpl $0x19, %eax
je 0x3233c
cmpl $0x1a, %eax
jne 0x3243c
movq %rsi, %r12
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x322d6
movl 0x24(%rbx), %ebp
testq %rax, %rax
je 0x32371
movq %rax, %r13
movq 0x8(%r14), %rdi
pushq $0x1a
popq %rsi
callq 0x30712
movq %rax, %r12
movq %r13, %r14
jmp 0x32408
movq 0x10(%rbx), %rsi
movq 0x38(%rbx), %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x322d6
movq 0x30(%rbx), %rbp
testq %rax, %rax
je 0x32399
movq %rax, %r13
movq 0x8(%r14), %rdi
pushq $0x19
popq %rsi
callq 0x30712
movq %rax, %r12
xorl %eax, %eax
movq %r13, %r14
jmp 0x323c2
incl %ebp
movq 0x10(%rbx), %rax
movslq 0x50(%rax), %rdi
movl %ebp, %esi
callq 0x324ab
movslq 0x50(%r12), %rcx
cmpq %rcx, %rax
jne 0x323f6
movq %rbx, %rdi
callq 0x324d2
jmp 0x3243c
movq 0x38(%rbp), %rbp
testq %rbp, %rbp
je 0x3242a
movq 0x8(%r14), %rdi
pushq $0x19
popq %rsi
callq 0x30712
movq %rax, %r12
movq %rax, (%r15)
movl 0x20(%rbx), %eax
movq 0x30(%rbx), %rcx
subl 0x48(%rcx), %eax
movq %rbp, 0x30(%r12)
movq 0x18(%rbp), %rcx
movq %rcx, 0x28(%r12)
movq %r14, 0x38(%r12)
movq %rbp, 0x10(%r12)
addl 0x48(%rbp), %eax
movl %eax, 0x20(%r12)
movq 0x38(%rbx), %rax
movb $0x1b, (%rbx)
movl $0x1, 0x24(%rbx)
movq %rax, 0x28(%rbx)
jmp 0x3243f
movq 0x8(%r14), %rdi
pushq $0x1a
popq %rsi
callq 0x30712
movq %rax, %r12
movq %rax, (%r15)
movl %ebp, 0x24(%r12)
movl %ebp, 0x20(%r12)
movq %r14, 0x28(%r12)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r12)
movq %rbx, %rdi
callq 0x324d2
jmp 0x3243f
movq 0x38(%rbx), %rax
movb $0x1b, (%rbx)
movl $0x1, 0x24(%rbx)
movq %rax, 0x28(%rbx)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq