// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/evaluate.c
// Function: handle_initializer
static int handle_initializer(struct expression **ep, int nested,
		int class, struct symbol *ctype, unsigned long mods)
{
	struct expression *e = *ep, *p;
	struct symbol *type;

	if (!e)
		return 0;

	/* scalar */
	if (!(class & TYPE_COMPOUND)) {
		e = handle_scalar(e, nested);
		if (!e)
			return 0;
		*ep = e;
		if (!evaluate_expression(e))
			return 1;
		compatible_assignment_types(e, ctype, ep, "initializer");
		/*
		 * Initializers for static storage duration objects
		 * shall be constant expressions or a string literal [6.7.8(4)].
		 */
		mods |= ctype->ctype.modifiers;
		mods &= (MOD_TOPLEVEL | MOD_STATIC);
		if (mods && !(e->flags & (CEF_ACE | CEF_ADDR)))
			if (Wconstexpr_not_const)
				warning(e->pos, "non-constant initializer for static object");

		return 1;
	}

	/*
	 * sublist; either a string, or we dig in; the latter will deal with
	 * pathologies, so we don't need anything fancy here.
	 */
	if (e->type == EXPR_INITIALIZER) {
		if (is_string_type(ctype)) {
			struct expression *v = NULL;
			int count = 0;

			FOR_EACH_PTR(e->expr_list, p) {
				if (!v)
					v = p;
				count++;
			} END_FOR_EACH_PTR(p);
			if (count == 1 && is_string_literal(&v)) {
				*ep = e = v;
				goto String;
			}
		}
		handle_list_initializer(e, class, ctype, mods);
		return 1;
	}

	/* string */
	if (is_string_literal(&e)) {
		/* either we are doing array of char, or we'll have to dig in */
		if (is_string_type(ctype)) {
			*ep = e;
			goto String;
		}
		return 0;
	}
	/* struct or union can be initialized by compatible */
	if (class != TYPE_COMPOUND)
		return 0;
	type = evaluate_expression(e);
	if (!type)
		return 0;
	if (ctype->type == SYM_NODE)
		ctype = ctype->ctype.base_type;
	if (type->type == SYM_NODE)
		type = type->ctype.base_type;
	if (ctype == type)
		return 1;
	return 0;

String:
	p = alloc_expression(e->pos, EXPR_STRING);
	*p = *e;
	type = evaluate_expression(p);
	if (ctype->bit_size != -1) {
		struct symbol *char_type = e->wide ? wchar_ctype : &char_ctype;
		unsigned int size_with_null = ctype->bit_size + char_type->bit_size;
		if (size_with_null < type->bit_size)
			warning(e->pos,
				"too long initializer-string for array of char");
		else if (Winit_cstring && size_with_null == type->bit_size) {
			warning(e->pos,
				"too long initializer-string for array of char(no space for nul char)");
		}
	}
	*ep = p;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq (%rdi), %r12
movq %r12, 0x58(%rsp)
xorl %ebp, %ebp
testq %r12, %r12
je 0x320fc
movq %r8, %r14
movq %rdi, %rbx
movl (%r12), %r15d
movzbl %r15b, %eax
movl %edx, 0x28(%rsp)
testb $0x20, %dl
movq %rcx, 0x18(%rsp)
jne 0x319d0
cmpl $0x18, %eax
jne 0x31958
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x320fc
movq %r12, %r15
xorl %ecx, %ecx
xorl %r12d, %r12d
movq %rax, %rdx
movzwl (%rdx), %edi
movsbl %dil, %r8d
testw %r8w, %r8w
movl $0x0, %r9d
cmovgl %r8d, %r9d
movzwl %r9w, %r8d
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x31920
cmpw $0x100, %di             # imm = 0x100
setb %r10b
movq 0x18(%rdx,%r9,8), %r11
testq %r11, %r11
setne %bpl
orb %r10b, %bpl
movzbl %bpl, %r10d
addl %r10d, %ecx
testq %r12, %r12
cmovneq %r12, %r11
testb %r10b, %r10b
cmovneq %r11, %r12
incq %r9
jmp 0x318e9
movq 0x10(%rdx), %rdx
cmpq %rax, %rdx
jne 0x318cd
xorl %ebp, %ebp
cmpl $0x1, %ecx
jne 0x320fc
movb (%r12), %al
addb $-0x18, %al
cmpb $0x3, %al
jb 0x320fc
testl %esi, %esi
je 0x31958
movq 0x8(%r15), %rdi
leaq 0x12079(%rip), %rsi     # 0x439ca
xorl %eax, %eax
callq 0x1108a
movq %r12, 0x58(%rsp)
movq %r12, (%rbx)
movq %r12, %rdi
callq 0x2d0ed
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x320fc
leaq 0x11fa5(%rip), %rcx     # 0x43920
movq %r12, %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x30c8b
orl 0x68(%r15), %r14d
testb $0x14, %r14b
je 0x320fc
testb $0x60, 0x1(%r12)
jne 0x320fc
leaq 0x2f445(%rip), %rax     # 0x60df4
cmpl $0x0, (%rax)
je 0x320fc
movq 0x8(%r12), %rdi
leaq 0x11f68(%rip), %rsi     # 0x4392c
xorl %eax, %eax
callq 0x1108a
jmp 0x320fc
cmpl $0x18, %eax
jne 0x31a8f
movq %r12, 0x30(%rsp)
movq %rcx, %rdi
callq 0x3211d
testl %eax, %eax
je 0x31b1c
movq 0x30(%rsp), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x31b21
xorl %ecx, %ecx
xorl %edx, %edx
movq %rax, %rsi
movzwl (%rsi), %edi
movsbl %dil, %r8d
testw %r8w, %r8w
movl $0x0, %r9d
cmovgl %r8d, %r9d
movzwl %r9w, %r8d
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x31a5a
cmpw $0x100, %di             # imm = 0x100
setb %r10b
movq 0x18(%rsi,%r9,8), %r11
testq %r11, %r11
setne %bpl
orb %r10b, %bpl
testq %rcx, %rcx
cmovneq %rcx, %r11
testb %bpl, %bpl
cmovneq %r11, %rcx
movzbl %bpl, %r10d
addl %r10d, %edx
incq %r9
jmp 0x31a23
movq 0x10(%rsi), %rsi
cmpq %rax, %rsi
jne 0x31a07
movq %rcx, 0x8(%rsp)
cmpl $0x1, %edx
movq 0x30(%rsp), %rcx
jne 0x31b21
leaq 0x8(%rsp), %rdi
callq 0x3216a
testl %eax, %eax
je 0x32110
movq 0x8(%rsp), %r15
jmp 0x31ab8
leaq 0x58(%rsp), %rdi
callq 0x3216a
testl %eax, %eax
je 0x32058
movq 0x18(%rsp), %rdi
callq 0x3211d
testl %eax, %eax
je 0x320fc
movq 0x58(%rsp), %r15
movq %r15, (%rbx)
movq 0x8(%r15), %rdi
pushq $0x2
popq %rsi
callq 0x30712
movq %rax, %r14
movaps (%r15), %xmm0
movaps 0x10(%r15), %xmm1
movaps 0x20(%r15), %xmm2
movaps 0x30(%r15), %xmm3
movaps %xmm0, (%rax)
movaps %xmm1, 0x10(%rax)
movaps %xmm2, 0x20(%rax)
movaps %xmm3, 0x30(%rax)
movq %rax, %rdi
callq 0x2d0ed
movq 0x18(%rsp), %rcx
movl 0x50(%rcx), %ecx
cmpl $-0x1, %ecx
je 0x320f6
cmpl $0x0, 0x20(%r15)
jne 0x320bb
leaq 0x32f01(%rip), %rdx     # 0x64a18
jmp 0x320c5
movq 0x30(%rsp), %rcx
andq $0x0, 0x8(%rsp)
btl $0x10, %r15d
jae 0x31b3c
leaq 0x20(%rcx), %rdi
callq 0x1ff30
movq 0x30(%rsp), %rcx
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
movl 0x28(%rsp), %eax
je 0x32098
testb $0x10, %al
leaq 0x11ffa(%rip), %rax     # 0x43b50
leaq 0x11d0d(%rip), %rdx     # 0x4386a
cmoveq %rax, %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, %rbx
movl $0x0, 0x2c(%rsp)
movq $0x0, 0x20(%rsp)
movq %rcx, 0x70(%rsp)
leaq 0x18(%rbx), %r15
leaq 0x10(%rbx), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
movq %rbx, 0x38(%rsp)
movq %r15, 0x50(%rsp)
movl (%rbx), %eax
movsbl %al, %ecx
cmpl %ecx, %r12d
jge 0x32040
movslq %r12d, %rcx
movq (%r15,%rcx,8), %r13
cmpw $0x100, %ax             # imm = 0x100
jb 0x31bbd
testq %r13, %r13
je 0x32038
movl %r12d, 0x14(%rsp)
leaq (%r15,%rcx,8), %r12
movzbl (%r13), %eax
addl $-0x19, %eax
cmpl $0x1, %eax
ja 0x31ca2
movq 0x18(%rsp), %rbx
xorl %eax, %eax
movq %r13, %rcx
movq %rcx, %rbp
cmpb $0x3, (%rbx)
jne 0x31bef
movq 0x60(%rbx), %rcx
jmp 0x31bf2
movq %rbx, %rcx
movzbl (%rbp), %esi
cmpl $0x19, %esi
je 0x31c49
cmpl $0x1a, %esi
jne 0x31d95
cmpb $0x6, (%rcx)
jne 0x31ddf
movq 0x60(%rcx), %rbx
movl 0x50(%rcx), %r15d
testl %r15d, %r15d
js 0x31c34
movslq 0x50(%rbx), %rdi
testq %rdi, %rdi
js 0x31c34
movl 0x24(%rbp), %esi
callq 0x324ab
cmpl %eax, %r15d
jbe 0x31fe2
movq %rbx, 0x10(%rbp)
movq 0x28(%rbp), %rcx
movq %rbp, %rax
testq %rcx, %rcx
jne 0x31be1
jmp 0x31dd3
andl $0x0, 0x60(%rsp)
movzbl (%rcx), %eax
addl $-0x7, %eax
cmpl $0x1, %eax
ja 0x31deb
movq 0x28(%rbp), %rdi
movq 0x98(%rcx), %rsi
leaq 0x60(%rsp), %rdx
callq 0x317c5
testq %rax, %rax
je 0x31df7
movq %rax, %rbx
movl 0x60(%rsp), %eax
movl %eax, 0x20(%rbp)
movq %rbx, 0x10(%rbp)
movq %rbx, 0x30(%rbp)
movq 0x38(%rbp), %rcx
testq %rcx, %rcx
je 0x31dd3
movq %rbp, %rax
jmp 0x31be1
cmpq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rsi
je 0x31cc3
movq 0x20(%rsp), %rdi
movq %r13, %rdx
leaq 0x8(%rsp), %rcx
callq 0x322d6
jmp 0x31cd9
movq %r13, 0x8(%rsp)
movq %rsi, %rdi
movl 0x28(%rsp), %esi
leaq 0x8(%rsp), %rdx
callq 0x321ca
testq %rax, %rax
je 0x31d46
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
cmpb $0x3, (%rax)
movq %rax, %rbx
jne 0x31cf4
movq 0x60(%rax), %rbx
leaq 0x288a5(%rip), %rcx     # 0x5a5a0
cmpl $0x0, (%rcx)
je 0x31e63
testb $0x1, 0x56(%rbx)
je 0x31e63
movq 0x18(%rax), %rax
leaq 0x11d5a(%rip), %r15     # 0x43a73
testq %rax, %rax
leaq 0x7baa(%rip), %rcx      # 0x398cd
cmoveq %rcx, %r15
je 0x31e03
movzbl 0x10(%rax), %edx
movl %edx, 0x4c(%rsp)
leaq 0x93ef(%rip), %rdx      # 0x3b12b
movq %rdx, 0x68(%rsp)
jmp 0x31e10
movq %r13, %rdi
movq 0x78(%rsp), %rsi
callq 0x32451
movsbq (%rbx), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r12
jae 0x31d74
movq 0x8(%r12), %rcx
movq %rcx, (%r12)
addq $0x8, %r12
jmp 0x31d60
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%r12)
decb (%rbx)
movl 0x14(%rsp), %r12d
decl %r12d
movq $0x0, 0x20(%rsp)
jmp 0x32038
leaq 0x11dda(%rip), %rdx     # 0x43b76
cmpl $0x1b, %esi
je 0x31fe9
testq %rax, %rax
je 0x31ffa
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
cmpq %r13, %rax
setne %cl
movl %ecx, 0x2c(%rsp)
movq 0x20(%rsp), %rdi
callq 0x32466
movq %r13, 0x20(%rsp)
jmp 0x31e99
leaq 0x11d5c(%rip), %rdx     # 0x43b36
jmp 0x31fe9
leaq 0x11d20(%rip), %rdx     # 0x43b06
jmp 0x31fe9
leaq 0x11d4c(%rip), %rdx     # 0x43b3e
jmp 0x31fe9
leaq 0x11d62(%rip), %rdx     # 0x43b60
jmp 0x31fe9
movl $0x0, 0x4c(%rsp)
movq %rcx, 0x68(%rsp)
leaq 0x12(%rax), %rbp
testq %rax, %rax
cmoveq %rcx, %rbp
movzbl (%rbx), %edi
callq 0x270d6
movq %rax, 0x80(%rsp)
movq 0x18(%rbx), %rdi
callq 0x2936d
movq %rax, %r10
movq 0x8(%r13), %rdi
leaq 0x11bde(%rip), %rsi     # 0x43a20
movq %r15, %rdx
movl 0x4c(%rsp), %ecx
movq %rbp, %r8
movq 0x68(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq 0x88(%rsp)
callq 0x1108a
popq %rax
popq %rcx
cmpl $0x0, 0x2c(%rsp)
je 0x31e90
leaq 0x2efab(%rip), %rax     # 0x60e1c
cmpl $0x0, (%rax)
je 0x31e90
movq 0x8(%r13), %rdi
movl $0x0, 0x2c(%rsp)
leaq 0x11bfe(%rip), %rsi     # 0x43a87
xorl %eax, %eax
callq 0x1108a
movq 0x20(%rsp), %rax
movq %rax, (%r12)
movq 0x8(%rsp), %rbx
movq %r14, %r15
movq 0x10(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0x2f4dd
movq 0x8(%rsp), %rcx
xorl %edx, %edx
cmpb $0x1a, (%rcx)
movl %eax, %ebp
setne %dl
shll $0x4, %edx
leaq (%rcx,%rdx), %rbx
addq $0x28, %rbx
movq 0x18(%rsp), %rax
movq 0x68(%rax), %r14
andl $0x5f, %r14d
orq %r15, %r14
movq 0x10(%rcx), %rcx
movq %rbx, %rdi
pushq $0x1
popq %rsi
movl %ebp, %edx
movq %r14, %r8
callq 0x31867
testl %eax, %eax
jne 0x31f2a
testb $0x20, %bpl
je 0x31f3e
movq 0x60(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x321ca
testq %rax, %rax
je 0x31f7f
movq %rax, %rbx
movq 0x8(%r13), %rdi
leaq 0x11ba6(%rip), %rsi     # 0x43abf
xorl %eax, %eax
callq 0x1108a
movq %rbx, 0x8(%rsp)
jmp 0x31e9e
movq 0x38(%rsp), %rbx
movq 0x50(%rsp), %r15
movl 0x14(%rsp), %r12d
jmp 0x32038
movq 0x8(%r13), %rdi
leaq 0x11b5d(%rip), %rsi     # 0x43aa6
xorl %eax, %eax
callq 0x1108a
movq 0x38(%rsp), %rbx
movsbq (%rbx), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq 0x50(%rsp), %r15
cmpq %rax, %r12
jae 0x32025
movq 0x8(%r12), %rcx
movq %rcx, (%r12)
addq $0x8, %r12
jmp 0x31f67
movq 0x38(%rsp), %rax
movsbq (%rax), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r12
jae 0x31fa5
movq 0x8(%r12), %rcx
movq %rcx, (%r12)
addq $0x8, %r12
jmp 0x31f91
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%r12)
movq 0x38(%rsp), %rbx
decb (%rbx)
movl 0x14(%rsp), %r12d
decl %r12d
testb $0x10, %bpl
leaq 0x118a2(%rip), %rsi     # 0x4386a
leaq 0x11b81(%rip), %rax     # 0x43b50
cmoveq %rax, %rsi
movq %r13, %rdi
callq 0x32451
movq 0x50(%rsp), %r15
jmp 0x32038
leaq 0x11b36(%rip), %rdx     # 0x43b1f
movq %rbp, %rdi
leaq 0x11b04(%rip), %rsi     # 0x43af7
xorl %eax, %eax
callq 0x11292
movq 0x38(%rsp), %rbx
movsbq (%rbx), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq 0x50(%rsp), %r15
cmpq %rax, %r12
jae 0x32025
movq 0x8(%r12), %rcx
movq %rcx, (%r12)
addq $0x8, %r12
jmp 0x32011
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%r12)
decb (%rbx)
movl 0x14(%rsp), %r12d
decl %r12d
incl %r12d
jmp 0x31b99
movq 0x40(%rsp), %rax
movq (%rax), %rbx
movq 0x70(%rsp), %rcx
cmpq %rcx, %rbx
jne 0x31b7f
jmp 0x320a1
cmpl $0x20, 0x28(%rsp)
jne 0x320fc
movq 0x58(%rsp), %rdi
callq 0x2d0ed
testq %rax, %rax
je 0x320fc
movq 0x18(%rsp), %rcx
cmpb $0x3, (%rcx)
jne 0x32084
movq 0x60(%rcx), %rcx
cmpb $0x3, (%rax)
jne 0x3208d
movq 0x60(%rax), %rax
xorl %ebp, %ebp
cmpq %rax, %rcx
sete %bpl
jmp 0x320fc
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x32466
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, 0x10(%rcx)
jmp 0x320f9
leaq 0x2c59e(%rip), %rdx     # 0x5e660
movq (%rdx), %rdx
addl 0x50(%rdx), %ecx
cmpl 0x50(%rax), %ecx
jae 0x320d6
leaq 0x11883(%rip), %rsi     # 0x43957
jmp 0x320eb
jne 0x320f6
leaq 0x2ed2d(%rip), %rax     # 0x60e0c
cmpl $0x0, (%rax)
je 0x320f6
leaq 0x1189a(%rip), %rsi     # 0x43985
movq 0x8(%r15), %rdi
xorl %eax, %eax
callq 0x1108a
movq %r14, (%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rcx
movl (%rcx), %r15d
jmp 0x31b21