// File: /workspace/github_c_makefile_star2_O0/Oric4ever[P]lcc65/6502/build/../src/init.c
// Function: initfields
static int initfields(p, q) Field p, q; {
	unsigned int bits = 0;
	int i, n = 0;

	if (current) {
		Tree e = constnode(0, unsignedtype);
		do {
			Tree x = expr1(0);
			if (fieldsize(p) < 8*p->type->size)
				x = (*opnode['&'])(BAND, x,
					constnode(fieldmask(p), unsignedtype));
			e = (*opnode['|'])(BOR, e,
				(*opnode[LSHIFT])(LSH, x, constnode(fieldright(p), inttype)));
			if (p->link == q)
				break;
			p = p->link;
		} while (t == ',' && (t = gettok()));
		if (q && (n = q->offset - p->offset) < unsignedtype->size)
#ifdef LITTLE_ENDIAN
			for (i = 0; i < n; i++) {
				genasgn(retype(e, chartype), current);
				e = (*opnode[RSHIFT])(RSH, e, constnode(8, inttype));
			}
#else
			for (i = n - 1; i >= 0; i--) {
				Tree x = (*opnode[RSHIFT])(RSH, e,
					constnode(8*(unsignedtype->size - n + i), inttype));
				genasgn(retype(x, chartype), current);
			}
#endif
		else
			n = genasgn(e, current);
		return n;
	}
	do {
		i = initvalue(inttype)->u.v.i;
		if (fieldsize(p) < 8*p->type->size) {
			if ((p->type == inttype && i >= 0 && (i&~(fieldmask(p)>>1)) !=  0)
			||  (p->type == inttype && i <  0 && (i| (fieldmask(p)>>1)) != ~0)
			||  (p->type == unsignedtype      && (i& ~fieldmask(p))))
				warning("initializer exceeds bit-field width\n");
			i &= fieldmask(p);
		}
		bits |= i<<fieldright(p);
		if (p->to > n)
			n = p->to;
		if (p->link == q)
			break;
		p = p->link;
	} while (t == ',' && (t = gettok()));
	n = (n + 7)/8;
	for (i = 0; i < n; i++) {
		Value v;
#ifdef LITTLE_ENDIAN
		v.uc = bits;
		bits >>= 8;
#else
		v.uc = bits>>(8*(unsignedtype->size - 1));
		bits <<= 8;
#endif
		defconst(C, v);
	}
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, 0x277ff(%rip)     # 0x3ba48
je 0x14485
leaq 0x2ffe2(%rip), %rax     # 0x44238
movq (%rax), %rsi
xorl %edi, %edi
callq 0xc7b0
movq %rax, -0x30(%rbp)
xorl %edi, %edi
callq 0xfe00
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x14(%rcx), %ecx
subl %ecx, %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl 0x8(%rcx), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jge 0x142ee
leaq 0x24eb6(%rip), %rax     # 0x39150
movq 0x130(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %ecx
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
subl %eax, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
shll %cl, %edi
xorl $-0x1, %edi
leaq 0x2ff68(%rip), %rax     # 0x44238
movq (%rax), %rsi
callq 0xc7b0
movq -0x50(%rbp), %rsi
movq %rax, %rdx
movq -0x48(%rbp), %rax
movl $0x180, %edi            # imm = 0x180
callq *%rax
movq %rax, -0x38(%rbp)
leaq 0x24e5b(%rip), %rax     # 0x39150
movq 0x3e0(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0x24e41(%rip), %rax     # 0x39150
movq 0x1c8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %edi
leaq 0x2fec7(%rip), %rax     # 0x441f8
movq (%rax), %rsi
callq 0xc7b0
movq -0x70(%rbp), %rsi
movq %rax, %rdx
movq -0x68(%rbp), %rax
movl $0x150, %edi            # imm = 0x150
callq *%rax
movq -0x60(%rbp), %rsi
movq %rax, %rdx
movq -0x58(%rbp), %rax
movl $0x1a0, %edi            # imm = 0x1A0
callq *%rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x14371
jmp 0x143b0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
leaq 0x297fa(%rip), %rcx     # 0x3db80
cmpl $0x2c, (%rcx)
movb %al, -0x71(%rbp)
jne 0x143a5
callq 0x15170
leaq 0x297e6(%rip), %rcx     # 0x3db80
movl %eax, (%rcx)
cmpl $0x0, %eax
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x14264
cmpq $0x0, -0x18(%rbp)
je 0x14467
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x24(%rbp)
leaq 0x2fe65(%rip), %rcx     # 0x44238
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x14467
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x14465
movq -0x30(%rbp), %rdi
leaq 0x2fde7(%rip), %rax     # 0x441e0
movq (%rax), %rsi
callq 0x25a20
movq %rax, %rdi
movq 0x2763d(%rip), %rsi     # 0x3ba48
callq 0x138b0
leaq 0x24d39(%rip), %rax     # 0x39150
movq 0x1c0(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0x2fdc4(%rip), %rax     # 0x441f8
movq (%rax), %rsi
movl $0x8, %edi
callq 0xc7b0
movq -0x88(%rbp), %rsi
movq %rax, %rdx
movq -0x80(%rbp), %rax
movl $0x170, %edi            # imm = 0x170
callq *%rax
movq %rax, -0x30(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x143e6
jmp 0x1447a
movq -0x30(%rbp), %rdi
movq 0x275d6(%rip), %rsi     # 0x3ba48
callq 0x138b0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14693
jmp 0x14487
leaq 0x2fd6a(%rip), %rax     # 0x441f8
movq (%rax), %rdi
callq 0x14150
movl 0x28(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x14(%rcx), %ecx
subl %ecx, %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl 0x8(%rcx), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jge 0x145c2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x2fd25(%rip), %rcx     # 0x441f8
cmpq (%rcx), %rax
jne 0x1450f
cmpl $0x0, -0x20(%rbp)
jl 0x1450f
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x16(%rcx), %ecx
movq -0x10(%rbp), %rdx
movswl 0x14(%rdx), %edx
subl %edx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
movl %edx, %ecx
xorl $-0x1, %ecx
shrl %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x14592
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x2fcda(%rip), %rcx     # 0x441f8
cmpq (%rcx), %rax
jne 0x14553
cmpl $0x0, -0x20(%rbp)
jge 0x14553
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x16(%rcx), %ecx
movq -0x10(%rbp), %rdx
movswl 0x14(%rdx), %edx
subl %edx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
movl %edx, %ecx
xorl $-0x1, %ecx
shrl %ecx
orl %ecx, %eax
cmpl $-0x1, %eax
jne 0x14592
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
leaq 0x2fcd6(%rip), %rcx     # 0x44238
cmpq (%rcx), %rax
jne 0x145a0
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x16(%rcx), %ecx
movq -0x10(%rbp), %rdx
movswl 0x14(%rdx), %edx
subl %edx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
movl %edx, %ecx
xorl $-0x1, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x145a0
leaq 0x1c073(%rip), %rdi     # 0x3060c
movb $0x0, %al
callq 0xdba0
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %ecx
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
subl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
xorl $-0x1, %eax
andl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x14(%rcx), %ecx
shll %cl, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
cmpl -0x24(%rbp), %eax
jle 0x145ed
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x145fd
jmp 0x14645
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
leaq 0x2956e(%rip), %rcx     # 0x3db80
cmpl $0x2c, (%rcx)
movb %al, -0x89(%rbp)
jne 0x14637
callq 0x15170
leaq 0x29557(%rip), %rcx     # 0x3db80
movl %eax, (%rcx)
cmpl $0x0, %eax
setne %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x14487
movl -0x24(%rbp), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1468d
movl -0x1c(%rbp), %eax
movb %al, -0x40(%rbp)
movl -0x1c(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x1c(%rbp)
movq -0x40(%rbp), %rsi
movl $0x3, %edi
callq 0x2a830
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1465d
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nop