// File: /workspace/github_c_makefile_star2_O3/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 %rcx, 0x8(%rsp)
movq (%rdi), %r12
movq %r12, 0x50(%rsp)
xorl %ebp, %ebp
testq %r12, %r12
je 0x3854d
movq %r8, %r14
movl %edx, %ebx
movq %rdi, %r15
movl (%r12), %eax
movzbl %al, %ecx
testb $0x20, %bl
jne 0x37c9f
cmpl $0x18, %ecx
jne 0x37c25
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x3854d
movq %r12, %r13
xorl %ecx, %ecx
xorl %r12d, %r12d
movq %rax, %rdx
movzwl (%rdx), %r8d
movsbl %r8b, %edi
testw %di, %di
jle 0x37bed
movzwl %di, %edi
movzwl %r8w, %r8d
xorl %r9d, %r9d
cmpl $0x100, %r8d            # imm = 0x100
setb %r10b
movq 0x18(%rdx,%r9,8), %r11
testq %r11, %r11
setne %bl
orb %r10b, %bl
movzbl %bl, %r10d
addl %r10d, %ecx
testq %r12, %r12
cmovneq %r12, %r11
testb %r10b, %r10b
cmovneq %r11, %r12
incq %r9
cmpq %r9, %rdi
jne 0x37bb7
movq 0x10(%rdx), %rdx
cmpq %rax, %rdx
jne 0x37ba0
xorl %ebp, %ebp
cmpl $0x1, %ecx
jne 0x3854d
movb (%r12), %al
addb $-0x18, %al
cmpb $0x3, %al
jb 0x3854d
testl %esi, %esi
je 0x37c25
movq 0x8(%r13), %rdi
leaq 0x12b5a(%rip), %rsi     # 0x4a778
xorl %eax, %eax
callq 0x118fc
movq %r12, 0x50(%rsp)
movq %r12, (%r15)
movq %r12, %rdi
callq 0x32223
movl $0x1, %ebp
testq %rax, %rax
je 0x3854d
leaq 0x12a84(%rip), %rcx     # 0x4a6ce
movq %r12, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x36caf
orl 0x68(%rbx), %r14d
testb $0x14, %r14b
je 0x3854d
testb $0x60, 0x1(%r12)
jne 0x3854d
leaq 0x2f176(%rip), %rax     # 0x66df4
cmpl $0x0, (%rax)
je 0x3854d
movq 0x8(%r12), %rdi
leaq 0x12a47(%rip), %rsi     # 0x4a6da
xorl %eax, %eax
callq 0x118fc
jmp 0x3854d
cmpl $0x18, %ecx
jne 0x37ced
movq 0x8(%rsp), %rcx
movzbl (%rcx), %edx
cmpl $0x3, %edx
jne 0x37cbd
movq 0x8(%rsp), %rcx
movq 0x60(%rcx), %rcx
movzbl (%rcx), %edx
cmpl $0x6, %edx
jne 0x37efa
movq 0x60(%rcx), %rcx
movl 0x50(%rcx), %esi
leaq 0x2ca2c(%rip), %rdi     # 0x64700
movzbl (%rcx), %edx
cmpl (%rdi), %esi
jne 0x37d85
cmpl $0xb, %edx
je 0x37d8e
jmp 0x37d9e
leaq 0x50(%rsp), %rdi
callq 0x38561
testl %eax, %eax
je 0x37d44
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x3, %ecx
jne 0x37d14
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rax
movzbl (%rax), %ecx
cmpl $0x6, %ecx
jne 0x3854d
movq 0x60(%rax), %rax
movl 0x50(%rax), %edx
leaq 0x2c9d5(%rip), %rsi     # 0x64700
movzbl (%rax), %ecx
cmpl (%rsi), %edx
jne 0x37e39
cmpl $0xb, %ecx
je 0x37e42
jmp 0x37e52
cmpl $0x20, %ebx
jne 0x3854d
movq 0x50(%rsp), %rdi
callq 0x32223
testq %rax, %rax
je 0x3854d
movq 0x8(%rsp), %rcx
cmpb $0x3, (%rcx)
jne 0x37d6e
movq 0x60(%rcx), %rcx
cmpb $0x3, (%rax)
jne 0x37d77
movq 0x60(%rax), %rax
xorl %ebp, %ebp
cmpq %rax, %rcx
sete %bpl
jmp 0x3854d
cmpl $0x3, %edx
jne 0x37d8e
movq 0x60(%rcx), %rcx
leaq 0x2c8cb(%rip), %rdx     # 0x64660
cmpq (%rdx), %rcx
jne 0x37efa
movq 0x20(%r12), %rcx
testq %rcx, %rcx
je 0x37efa
movl %ebx, %r13d
xorl %edx, %edx
xorl %esi, %esi
movq %rcx, %rdi
movzwl (%rdi), %r9d
movsbl %r9b, %r8d
testw %r8w, %r8w
jle 0x37e06
movzwl %r8w, %r8d
movzwl %r9w, %r9d
xorl %r10d, %r10d
cmpl $0x100, %r9d            # imm = 0x100
setb %r11b
movq 0x18(%rdi,%r10,8), %rbx
testq %rbx, %rbx
setne %bpl
orb %r11b, %bpl
testq %rdx, %rdx
cmovneq %rdx, %rbx
testb %bpl, %bpl
cmovneq %rbx, %rdx
movzbl %bpl, %r11d
addl %r11d, %esi
incq %r10
cmpq %r10, %r8
jne 0x37dcf
movq 0x10(%rdi), %rdi
cmpq %rcx, %rdi
jne 0x37db6
movq %rdx, 0x10(%rsp)
cmpl $0x1, %esi
movl %r13d, %ebx
jne 0x37efa
leaq 0x10(%rsp), %rdi
callq 0x38561
testl %eax, %eax
je 0x37ef6
movq 0x10(%rsp), %rbx
jmp 0x37e57
cmpl $0x3, %ecx
jne 0x37e42
movq 0x60(%rax), %rax
leaq 0x2c817(%rip), %rcx     # 0x64660
cmpq (%rcx), %rax
jne 0x3854d
movq 0x50(%rsp), %rbx
movq %rbx, (%r15)
movq 0x8(%rbx), %r12
xorl %edi, %edi
callq 0x2f9f5
movq %rax, %r14
movq %r12, 0x8(%rax)
movw $0x2, (%rax)
movaps (%rbx), %xmm0
movaps 0x10(%rbx), %xmm1
movaps 0x20(%rbx), %xmm2
movaps 0x30(%rbx), %xmm3
movaps %xmm0, (%rax)
movaps %xmm1, 0x10(%rax)
movaps %xmm2, 0x20(%rax)
movaps %xmm3, 0x30(%rax)
movq %rax, %rdi
callq 0x32223
movq 0x8(%rsp), %rcx
movl 0x50(%rcx), %ecx
cmpl $-0x1, %ecx
je 0x37eee
cmpl $0x0, 0x20(%rbx)
jne 0x37eb3
leaq 0x32b67(%rip), %rdx     # 0x6aa18
jmp 0x37ebd
leaq 0x2c7a6(%rip), %rdx     # 0x64660
movq (%rdx), %rdx
addl 0x50(%rdx), %ecx
cmpl 0x50(%rax), %ecx
jae 0x37ece
leaq 0x12839(%rip), %rsi     # 0x4a705
jmp 0x37ee3
jne 0x37eee
leaq 0x2ef35(%rip), %rax     # 0x66e0c
cmpl $0x0, (%rax)
je 0x37eee
leaq 0x12850(%rip), %rsi     # 0x4a733
movq 0x8(%rbx), %rdi
xorl %eax, %eax
callq 0x118fc
movq %r14, (%r15)
jmp 0x38548
movl (%r12), %eax
movq $0x0, 0x10(%rsp)
btl $0x10, %eax
movq 0x8(%rsp), %r15
jae 0x37f18
leaq 0x20(%r12), %rdi
callq 0x22c4e
movq %r12, 0x68(%rsp)
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x3852c
movl %ebx, 0x5c(%rsp)
testb $0x10, %bl
leaq 0x129c5(%rip), %rcx     # 0x4a8fe
leaq 0x126d8(%rip), %rdx     # 0x4a618
cmoveq %rcx, %rdx
movq %rdx, 0x78(%rsp)
movq %rax, %r12
movl $0x0, 0x24(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x70(%rsp)
movzwl (%r12), %eax
testb %al, %al
jle 0x38517
leaq 0x18(%r12), %rdx
leaq 0x10(%r12), %rcx
movq %rcx, 0x48(%rsp)
xorl %ebx, %ebx
movq %r12, 0x40(%rsp)
movq %rdx, 0x28(%rsp)
movslq %ebx, %rcx
movq (%rdx,%rcx,8), %rbp
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x37fa4
testq %rbp, %rbp
je 0x38506
leaq (%rdx,%rcx,8), %r13
movzbl (%rbp), %eax
addl $-0x19, %eax
cmpl $0x1, %eax
movq %rbp, 0x30(%rsp)
ja 0x380b6
movq %r15, %rcx
xorl %eax, %eax
movq %rbp, %rdx
movq %rdx, %r12
cmpb $0x3, (%rcx)
jne 0x37fd3
movq 0x60(%rcx), %rdx
jmp 0x37fd6
movq %rcx, %rdx
movzbl (%r12), %ecx
cmpl $0x19, %ecx
je 0x38054
cmpl $0x1a, %ecx
jne 0x38194
cmpb $0x6, (%rdx)
jne 0x381fd
movq 0x60(%rdx), %rcx
movl 0x50(%rdx), %edi
testl %edi, %edi
js 0x38039
movslq 0x50(%rcx), %rsi
testq %rsi, %rsi
js 0x38039
leaq 0x2c6f3(%rip), %rax     # 0x64700
movslq (%rax), %r8
movq %rsi, %rax
xorl %edx, %edx
divq %r8
subl %edx, %r8d
testq %rdx, %rdx
movl $0x0, %eax
cmovel %eax, %r8d
addl %esi, %r8d
imull 0x24(%r12), %r8d
cmpl %r8d, %edi
jbe 0x384aa
movq %rcx, 0x10(%r12)
movq 0x28(%r12), %rdx
movq %r12, %rax
testq %rdx, %rdx
jne 0x37fc5
jmp 0x381d2
movl $0x0, 0x3c(%rsp)
movzbl (%rdx), %eax
addl $-0x7, %eax
cmpl $0x1, %eax
ja 0x38209
movq 0x28(%r12), %rdi
movq 0x98(%rdx), %rsi
leaq 0x3c(%rsp), %rdx
callq 0x37a8b
testq %rax, %rax
je 0x38215
movq %rax, %rcx
movl 0x3c(%rsp), %eax
movl %eax, 0x20(%r12)
movq %rcx, 0x10(%r12)
movq %rcx, 0x30(%r12)
movq 0x38(%r12), %rdx
testq %rdx, %rdx
je 0x381d2
movq %r12, %rax
jmp 0x37fc5
cmpq $0x0, 0x10(%rsp)
je 0x380d5
movq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
leaq 0x10(%rsp), %rcx
callq 0x386dd
jmp 0x380eb
movq %rbp, 0x10(%rsp)
movq %r15, %rdi
movl 0x5c(%rsp), %esi
leaq 0x10(%rsp), %rdx
callq 0x385c8
testq %rax, %rax
je 0x38154
movq %rax, 0x18(%rsp)
cmpb $0x3, (%r15)
movq %r15, %rbp
jne 0x38102
movq 0x60(%r15), %rbp
leaq 0x28497(%rip), %rax     # 0x605a0
cmpl $0x0, (%rax)
je 0x38289
testb $0x1, 0x56(%rbp)
je 0x38289
movq 0x18(%r15), %rax
leaq 0x126fa(%rip), %r12     # 0x4a821
testq %rax, %rax
leaq 0x879c(%rip), %rcx      # 0x408cd
cmoveq %rcx, %r12
je 0x38221
movzbl 0x10(%rax), %edx
movl %edx, 0x38(%rsp)
leaq 0x9f81(%rip), %rdx      # 0x420cb
movq %rdx, 0x60(%rsp)
jmp 0x3822e
movq 0x8(%rbp), %rdi
leaq 0x12730(%rip), %rsi     # 0x4a88f
movq 0x78(%rsp), %rdx
xorl %eax, %eax
callq 0x118fc
movsbq (%r12), %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r13
jae 0x381de
leaq 0x8(%r13), %rcx
movq 0x8(%r13), %rdx
movq %rdx, (%r13)
movq %rcx, %r13
cmpq %rax, %rcx
jb 0x3817e
jmp 0x381e1
leaq 0x12789(%rip), %rdx     # 0x4a924
cmpl $0x1b, %ecx
je 0x384b1
testq %rax, %rax
je 0x384c2
movq %rax, 0x10(%rsp)
xorl %ecx, %ecx
cmpq %rbp, %rax
setne %cl
movl %ecx, 0x24(%rsp)
movq 0x18(%rsp), %rdi
callq 0x3889b
movq %rbp, 0x18(%rsp)
jmp 0x382c4
leaq 0x1270b(%rip), %rdx     # 0x4a8e4
jmp 0x384b1
movq %r13, %rcx
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%rcx)
decb (%r12)
decl %ebx
movq $0x0, 0x18(%rsp)
jmp 0x38501
leaq 0x126b0(%rip), %rdx     # 0x4a8b4
jmp 0x384b1
leaq 0x126dc(%rip), %rdx     # 0x4a8ec
jmp 0x384b1
leaq 0x126f2(%rip), %rdx     # 0x4a90e
jmp 0x384b1
movl $0x0, 0x38(%rsp)
movq %rcx, 0x60(%rsp)
leaq 0x12(%rax), %r15
testq %rax, %rax
cmoveq %rcx, %r15
movzbl (%rbp), %edi
callq 0x2ba8b
movq %rax, 0x80(%rsp)
movq 0x18(%rbp), %rdi
callq 0x2de35
movq %rax, %r10
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x12568(%rip), %rsi     # 0x4a7ce
movq %r12, %rdx
movl 0x38(%rsp), %ecx
movq %r15, %r8
movq 0x60(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq 0x88(%rsp)
callq 0x118fc
addq $0x10, %rsp
cmpl $0x0, 0x24(%rsp)
je 0x382bb
leaq 0x2eb85(%rip), %rax     # 0x66e1c
cmpl $0x0, (%rax)
movq 0x30(%rsp), %rax
je 0x382bb
movq 0x8(%rax), %rdi
movl $0x0, 0x24(%rsp)
leaq 0x12581(%rip), %rsi     # 0x4a835
xorl %eax, %eax
callq 0x118fc
movq 0x18(%rsp), %rax
movq %rax, (%r13)
movq 0x10(%rsp), %r15
movq 0x10(%r15), %r12
movzbl (%r12), %eax
cmpl $0x3, %eax
jne 0x382e1
movq 0x60(%r12), %r12
movzbl (%r12), %eax
cmpl $0xa, %eax
jne 0x38303
movq %r12, %rdi
callq 0x2b0b8
movq %rax, %r12
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x38303
movq 0x60(%r12), %r12
movzbl (%r12), %eax
cmpl $0x9, %eax
jne 0x38312
movq 0x60(%r12), %r12
movzbl (%r12), %eax
cmpl $0x2, %eax
jne 0x3832e
movq 0x60(%r12), %rcx
cmpq 0x27c65(%rip), %rcx     # 0x5ff88
je 0x3833c
cmpq 0x27c24(%rip), %rcx     # 0x5ff50
je 0x38343
movl %eax, %eax
leaq 0x11879(%rip), %rcx     # 0x49bb0
movl (%rcx,%rax,4), %ebp
jmp 0x38348
movl $0x1, %ebp
jmp 0x38348
movl $0x9, %ebp
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
cmpb $0x1a, (%rax)
setne %cl
shll $0x4, %ecx
leaq (%rax,%rcx), %r15
addq $0x28, %r15
movq 0x8(%rsp), %rcx
movq 0x68(%rcx), %rcx
andl $0x5f, %ecx
orq %rcx, %r14
movq 0x10(%rax), %rcx
movq %r15, %rdi
movl $0x1, %esi
movl %ebp, %edx
movq %r14, %r8
callq 0x37b3d
testl %eax, %eax
jne 0x383c9
testb $0x20, %bpl
je 0x383d8
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x385c8
testq %rax, %rax
je 0x38425
movq %rax, %r15
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x124b5(%rip), %rsi     # 0x4a86d
xorl %eax, %eax
callq 0x118fc
movq %r15, 0x10(%rsp)
jmp 0x382c9
movq 0x8(%rsp), %r15
movq 0x40(%rsp), %r12
jmp 0x38501
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x1246c(%rip), %rsi     # 0x4a854
xorl %eax, %eax
callq 0x118fc
movq 0x40(%rsp), %r12
movsbq (%r12), %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r13
jae 0x38458
movq 0x8(%rsp), %r15
leaq 0x8(%r13), %rcx
movq 0x8(%r13), %rdx
movq %rdx, (%r13)
movq %rcx, %r13
cmpq %rax, %rcx
jb 0x3840c
jmp 0x384f3
movq 0x40(%rsp), %r12
movsbq (%r12), %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r13
jae 0x38465
movq 0x8(%rsp), %r15
leaq 0x8(%r13), %rcx
movq 0x8(%r13), %rdx
movq %rdx, (%r13)
movq %rcx, %r13
cmpq %rax, %rcx
jb 0x38442
jmp 0x3846d
movq %r13, %rcx
movq 0x8(%rsp), %r15
jmp 0x384f3
movq %r13, %rcx
movq 0x8(%rsp), %r15
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%rcx)
decb (%r12)
decl %ebx
testb $0x10, %bpl
leaq 0x12192(%rip), %rdx     # 0x4a618
leaq 0x12471(%rip), %rax     # 0x4a8fe
cmoveq %rax, %rdx
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x123ee(%rip), %rsi     # 0x4a88f
xorl %eax, %eax
callq 0x118fc
jmp 0x38501
leaq 0x1241c(%rip), %rdx     # 0x4a8cd
movq %r12, %rdi
leaq 0x123ea(%rip), %rsi     # 0x4a8a5
xorl %eax, %eax
callq 0x11b04
movq 0x40(%rsp), %r12
movsbq (%r12), %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
cmpq %rax, %r13
jae 0x384f0
leaq 0x8(%r13), %rcx
movq 0x8(%r13), %rdx
movq %rdx, (%r13)
movq %rcx, %r13
cmpq %rax, %rcx
jb 0x384da
jmp 0x384f3
movq %r13, %rcx
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%rcx)
decb (%r12)
decl %ebx
movq 0x28(%rsp), %rdx
incl %ebx
movl (%r12), %eax
movsbl %al, %ecx
cmpl %ecx, %ebx
jl 0x37f8a
movq 0x10(%r12), %r12
movq 0x70(%rsp), %rax
cmpq %rax, %r12
jne 0x37f62
jmp 0x38535
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x3889b
movq 0x68(%rsp), %rax
movq %r15, 0x10(%rax)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq