// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/init.c
// Function: initializer
Type initializer(Type ty, int lev) {
	int n = 0;
	Tree e;
	Type aty;
	static char follow[] = { IF, CHAR, STATIC, 0 };

	ty = unqual(ty);
	if (isscalar(ty)) {
		if (!current)
			needconst++;
		if (t == '{') {
			t = gettok();
			e = expr1(0);
			initend(lev, follow);
		} else
			e = expr1(0);
		e = pointer(e);
		aty = assign(ty, e);
		if (aty)
			e = cast(e, aty);
		else
			error("invalid initialization type; found `%t' expected `%t'\n",
				e->type, ty);
		if (current)
			n = genasgn(e, current);
		else {
			n = genconst(e, 1);
			ntree = 0;
			needconst--;
		}
	}
	if ((isunion(ty) || isstruct(ty)) && ty->size == 0) {
		static char follow[] = { CHAR, STATIC, 0 };
		error("cannot initialize undefined `%t'\n", ty);
		skipto(';', follow);
		return ty;
	} else if (isunion(ty)) {
		if (t == '{') {
			t = gettok();
			n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
			initend(lev, follow);
		} else {
			if (lev == 0)
				error("missing { in initialization of `%t'\n", ty);
			n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
		}
	} else if (isstruct(ty)) {
		if (t == '{') {
			t = gettok();
			n = initstruct(0, ty, lev + 1);
			test('}', follow);
		} else if (current) {
			e = expr1(0);
			if (assign(ty, e))
				genasgn(e, current);
			else
				error("invalid initialization type; found `%t' expected `%t'\n",
					e->type, ty);
			n = ty->size;
		} else if (lev > 0)
			n = initstruct(ty->size, ty, lev + 1);
		else {
			error("missing { in initialization of `%t'\n", ty);
			n = initstruct(ty->u.sym->u.s.flist->type->size, ty, lev + 1);
		}
	}
	if (isarray(ty))
		aty = unqual(ty->type);
	if (isarray(ty) && ischar(aty)) {
		if (t == SCON) {
			if (ty->size > 0 && ty->size == tsym->type->size - 1)
				tsym->type = array(chartype, ty->size, STRUCT_ALIGN);
			n = tsym->type->size;
			if (current)
				genchar(tsym, current);
			else
				defstring(tsym->type->size, tsym->u.c.v.p);
			t = gettok();
		} else if (t == '{') {
			t = gettok();
			if (t == SCON) {
				ty = initializer(ty, lev + 1);
				initend(lev, follow);
				return ty;
			}
			n = initchar(0, aty);
			test('}', follow);
		} else if (lev > 0 && ty->size > 0)
			n = initchar(ty->size, aty);
		else {	/* eg, char c[] = 0; */
			error("missing { in initialization of `%t'\n", ty);
			n = initchar(1, aty);
		}
	} else if (isarray(ty)) {
		if (t == '{') {
			t = gettok();
			n = initarray(0, aty, lev + 1);
			test('}', follow);
		} else if (lev > 0 && ty->size > 0)
			n = initarray(ty->size, aty, lev + 1);
		else {
			error("missing { in initialization of `%t'\n", ty);
			n = initarray(aty->size, aty, lev + 1);
		}
	}
	if (ty->size) {
		if (n > ty->size)
			error("too many initializers\n");
		else if (n < ty->size)
			genspace(ty->size - n, current);
	} else if (isarray(ty) && ty->type->size > 0)
		ty = array(ty->type, n/ty->type->size, 0);
	else
		ty->size = n;
	return ty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13010
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13018
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13037
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x1303f
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x7, (%rax)
jbe 0x13074
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x1305f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x13067
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpl $0xd, (%rax)
jne 0x1317c
cmpq $0x0, 0x289cc(%rip)     # 0x3ba48
jne 0x13093
leaq 0x2be53(%rip), %rax     # 0x3eed8
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x2be47(%rip), %rax     # 0x3eed8
movl %ecx, (%rax)
leaq 0x2aae6(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x130cb
callq 0x15170
movl %eax, %ecx
leaq 0x2aad3(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
xorl %edi, %edi
callq 0xfe00
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
leaq 0x268bf(%rip), %rsi     # 0x39983
callq 0x13860
jmp 0x130d6
xorl %edi, %edi
callq 0xfe00
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf9f0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe2d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1310e
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xe9b0
movq %rax, -0x20(%rbp)
jmp 0x13128
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x1d41f(%rip), %rdi     # 0x30540
movb $0x0, %al
callq 0xd530
cmpq $0x0, 0x28918(%rip)     # 0x3ba48
je 0x13147
movq -0x20(%rbp), %rdi
movq 0x2890b(%rip), %rsi     # 0x3ba48
callq 0x138b0
movl %eax, -0x18(%rbp)
jmp 0x1317a
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x12bb0
movl %eax, -0x18(%rbp)
leaq 0x2de79(%rip), %rax     # 0x40fd8
movl $0x0, (%rax)
leaq 0x2bd6c(%rip), %rax     # 0x3eed8
movl (%rax), %ecx
addl $-0x1, %ecx
leaq 0x2bd60(%rip), %rax     # 0x3eed8
movl %ecx, (%rax)
jmp 0x1317c
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13193
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x1319b
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpl $0xa, (%rax)
je 0x131f4
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x131bb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x131c3
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x9, (%rax)
je 0x131f4
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x131e3
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x131eb
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0xa, (%rax)
jne 0x1322e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x1322e
movq -0x10(%rbp), %rsi
leaq 0x1d36e(%rip), %rdi     # 0x30577
movb $0x0, %al
callq 0xd530
movl $0x3b, %edi
leaq 0x2676b(%rip), %rsi     # 0x39987
callq 0xd990
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x13845
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13245
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x1324d
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpl $0xa, (%rax)
jne 0x132ee
leaq 0x2a91f(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x132ac
callq 0x15170
movl %eax, %ecx
leaq 0x2a90c(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x58(%rax), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13a40
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %edi
leaq 0x266de(%rip), %rsi     # 0x39983
callq 0x13860
jmp 0x132e9
cmpl $0x0, -0x14(%rbp)
jne 0x132c4
movq -0x10(%rbp), %rsi
leaq 0x1d2dc(%rip), %rdi     # 0x30599
movb $0x0, %al
callq 0xd530
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x58(%rax), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13a40
movl %eax, -0x18(%rbp)
jmp 0x13448
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13305
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x1330d
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpl $0x9, (%rax)
je 0x13342
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x1332d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x13335
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpl $0xa, (%rax)
jne 0x13446
leaq 0x2a837(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x13388
callq 0x15170
movl %eax, %ecx
leaq 0x2a824(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
xorl %edi, %edi
callq 0x13a40
movl %eax, -0x18(%rbp)
movl $0x7d, %edi
leaq 0x26605(%rip), %rsi     # 0x39983
callq 0xdb30
jmp 0x13444
cmpq $0x0, 0x286b8(%rip)     # 0x3ba48
je 0x133e8
xorl %edi, %edi
callq 0xfe00
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe2d0
cmpq $0x0, %rax
je 0x133c2
movq -0x20(%rbp), %rdi
movq 0x2868d(%rip), %rsi     # 0x3ba48
callq 0x138b0
jmp 0x133dc
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x1d16b(%rip), %rdi     # 0x30540
movb $0x0, %al
callq 0xd530
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
jmp 0x13442
cmpl $0x0, -0x14(%rbp)
jle 0x13409
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13a40
movl %eax, -0x18(%rbp)
jmp 0x13440
movq -0x10(%rbp), %rsi
leaq 0x1d185(%rip), %rdi     # 0x30599
movb $0x0, %al
callq 0xd530
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x58(%rax), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13a40
movl %eax, -0x18(%rbp)
jmp 0x13442
jmp 0x13444
jmp 0x13446
jmp 0x13448
jmp 0x1344a
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x13461
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x13469
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x134a5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0xf, (%rax)
jb 0x13491
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x1349d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x134bf
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x134ca
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x136ac
movq -0x28(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x134f4
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x134ff
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x136ac
leaq 0x2a66a(%rip), %rax     # 0x3db80
cmpl $0x24, (%rax)
jne 0x135e3
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x13574
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x2a5b9(%rip), %rcx     # 0x3daf0
movq (%rcx), %rcx
movq 0x20(%rcx), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x13574
leaq 0x30c91(%rip), %rax     # 0x441e0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x1, %edx
callq 0x27160
movq %rax, %rcx
leaq 0x2a583(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq %rcx, 0x20(%rax)
leaq 0x2a575(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq 0x20(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
cmpq $0x0, 0x284b8(%rip)     # 0x3ba48
je 0x135aa
leaq 0x2a557(%rip), %rax     # 0x3daf0
movq (%rax), %rdi
movq 0x284a5(%rip), %rsi     # 0x3ba48
callq 0x13bf0
jmp 0x135ce
leaq 0x2a53f(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq 0x20(%rax), %rax
movl 0x8(%rax), %edi
leaq 0x2a52e(%rip), %rax     # 0x3daf0
movq (%rax), %rax
movq 0x48(%rax), %rsi
callq 0x2a920
callq 0x15170
movl %eax, %ecx
leaq 0x2a5a4(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
jmp 0x136a7
leaq 0x2a596(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x1365b
callq 0x15170
movl %eax, %ecx
leaq 0x2a583(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
leaq 0x2a57a(%rip), %rax     # 0x3db80
cmpl $0x24, (%rax)
jne 0x1363a
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
callq 0x12fe0
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %edi
leaq 0x2635b(%rip), %rsi     # 0x39983
callq 0x13860
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x13845
movq -0x28(%rbp), %rsi
xorl %edi, %edi
callq 0x13da0
movl %eax, -0x18(%rbp)
movl $0x7d, %edi
leaq 0x2632f(%rip), %rsi     # 0x39983
callq 0xdb30
jmp 0x136a5
cmpl $0x0, -0x14(%rbp)
jle 0x13680
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x13680
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x28(%rbp), %rsi
callq 0x13da0
movl %eax, -0x18(%rbp)
jmp 0x136a3
movq -0x10(%rbp), %rsi
leaq 0x1cf0e(%rip), %rdi     # 0x30599
movb $0x0, %al
callq 0xd530
movq -0x28(%rbp), %rsi
movl $0x1, %edi
callq 0x13da0
movl %eax, -0x18(%rbp)
jmp 0x136a5
jmp 0x136a7
jmp 0x13780
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x136c6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x136d1
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x1377e
leaq 0x2a498(%rip), %rax     # 0x3db80
cmpl $0x7b, (%rax)
jne 0x13724
callq 0x15170
movl %eax, %ecx
leaq 0x2a485(%rip), %rax     # 0x3db80
movl %ecx, (%rax)
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
xorl %edi, %edi
callq 0x13ef0
movl %eax, -0x18(%rbp)
movl $0x7d, %edi
leaq 0x26266(%rip), %rsi     # 0x39983
callq 0xdb30
jmp 0x1377c
cmpl $0x0, -0x14(%rbp)
jle 0x1374f
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x1374f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13ef0
movl %eax, -0x18(%rbp)
jmp 0x1377a
movq -0x10(%rbp), %rsi
leaq 0x1ce3f(%rip), %rdi     # 0x30599
movb $0x0, %al
callq 0xd530
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x13ef0
movl %eax, -0x18(%rbp)
jmp 0x1377c
jmp 0x1377e
jmp 0x13780
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x137cc
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0x137a6
leaq 0x1ce21(%rip), %rdi     # 0x305be
movb $0x0, %al
callq 0xd530
jmp 0x137ca
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x137c8
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
subl -0x18(%rbp), %edi
movq 0x28285(%rip), %rsi     # 0x3ba48
callq 0x13f70
jmp 0x137ca
jmp 0x1383d
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jb 0x137e6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x137f1
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x13831
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
jle 0x13831
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltd
idivl 0x8(%rcx)
movl %eax, %esi
xorl %edx, %edx
callq 0x27160
movq %rax, -0x10(%rbp)
jmp 0x1383b
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x1383d
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)