// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/symbol.c
// Function: count_array_initializer
static int count_array_initializer(struct symbol *t, struct expression *expr)
{
	int nr = 0;
	int is_char = 0;

	/*
	 * Arrays of character types are special; they can be initialized by
	 * string literal _or_ by string literal in braces.  The latter means
	 * that with T x[] = {<string literal>} number of elements in x depends
	 * on T - if it's a character type, we get the length of string literal
	 * (including NUL), otherwise we have one element here.
	 */
	if (t->ctype.base_type == &int_type && t->rank == -2)
		is_char = 1;
	else if (t == wchar_ctype && is_wstring_expr(expr))
		is_char = 1;

	switch (expr->type) {
	case EXPR_INITIALIZER: {
		struct expression *entry;
		int count = 0;
		int str_len = 0;
		FOR_EACH_PTR(expr->expr_list, entry) {
			count++;
			switch (entry->type) {
			case EXPR_INDEX:
				if (entry->idx_to >= nr)
					nr = entry->idx_to+1;
				break;
			case EXPR_PREOP: {
				struct expression *e = entry;
				if (is_char) {
					while (e && e->type == EXPR_PREOP && e->op == '(')
						e = e->unop;
					if (e && e->type == EXPR_STRING) {
						entry = e;
			case EXPR_STRING:
						if (is_char)
							str_len = entry->string->length;
					}


				}
			}
			default:
				nr++;
			}
		} END_FOR_EACH_PTR(entry);
		if (count == 1 && str_len)
			nr = str_len;
		break;
	}
	case EXPR_PREOP:
		if (is_char) { 
			struct expression *e = expr;
			while (e && e->type == EXPR_PREOP && e->op == '(')
				e = e->unop;
			if (e && e->type == EXPR_STRING) {
				expr = e;
	case EXPR_STRING:
				if (is_char)
					nr = expr->string->length;
			}
		}
		break;
	default:
		break;
	}
	return nr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
leaq 0x4ffcf(%rip), %rcx     # 0x91258
cmpq %rcx, 0x60(%rax)
jne 0x412aa
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shll $0x6, %eax
sarl $0x1d, %eax
cmpl $-0x2, %eax
jne 0x412aa
movl $0x1, -0x18(%rbp)
jmp 0x412d2
movq -0x8(%rbp), %rax
leaq 0x4937b(%rip), %rcx     # 0x8a630
cmpq (%rcx), %rax
jne 0x412d0
movq -0x10(%rbp), %rdi
callq 0x41620
testb $0x1, %al
jne 0x412c9
jmp 0x412d0
movl $0x1, -0x18(%rbp)
jmp 0x412d2
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x5c(%rbp)
subl $0x2, %eax
je 0x41538
jmp 0x412e7
movl -0x5c(%rbp), %eax
subl $0x9, %eax
je 0x414c0
jmp 0x412f5
movl -0x5c(%rbp), %eax
subl $0x18, %eax
jne 0x41556
jmp 0x41303
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x41339
jmp 0x414a9
jmp 0x4133b
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x38(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x41491
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x4138d
cmpq $0x0, -0x20(%rbp)
jne 0x4138d
jmp 0x41483
movl -0x24(%rbp), %eax
incl %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x60(%rbp)
subl $0x2, %eax
je 0x4145a
jmp 0x413aa
movl -0x60(%rbp), %eax
subl $0x9, %eax
je 0x413e0
jmp 0x413b4
movl -0x60(%rbp), %eax
subl $0x1a, %eax
jne 0x41478
jmp 0x413c2
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
cmpl -0x14(%rbp), %eax
jb 0x413db
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x41481
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x41476
jmp 0x413f4
xorl %eax, %eax
cmpq $0x0, -0x50(%rbp)
movb %al, -0x61(%rbp)
je 0x41424
movq -0x50(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x61(%rbp)
jne 0x41424
movq -0x50(%rbp), %rax
cmpl $0x28, 0x4(%rax)
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x4142d
jmp 0x4143b
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x413f4
cmpq $0x0, -0x50(%rbp)
je 0x41474
movq -0x50(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x2, %eax
jne 0x41474
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x41472
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x28(%rbp)
jmp 0x41474
jmp 0x41476
jmp 0x41478
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x41483
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x41342
jmp 0x41493
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x4133b
cmpl $0x1, -0x24(%rbp)
jne 0x414bb
cmpl $0x0, -0x28(%rbp)
je 0x414bb
movl -0x28(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x41558
cmpl $0x0, -0x18(%rbp)
je 0x41554
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x58(%rbp)
movb %al, -0x62(%rbp)
je 0x41502
movq -0x58(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x62(%rbp)
jne 0x41502
movq -0x58(%rbp), %rax
cmpl $0x28, 0x4(%rax)
sete %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x4150b
jmp 0x41519
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x414d2
cmpq $0x0, -0x58(%rbp)
je 0x41552
movq -0x58(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x2, %eax
jne 0x41552
movq -0x58(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x41550
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x14(%rbp)
jmp 0x41552
jmp 0x41554
jmp 0x41558
jmp 0x41558
movl -0x14(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)