// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/wwas.c
// Function: statement
void
statement(void)
{
	Token t;
	Sym *s;
	word w;

	while(t = token(), t.type != TokEol){
		switch(t.type){
		case TokSymbol:
			s = t.sym;
			if(peek() == ','){
				peekc = 0;
				if(s->type == None ||
				   s->type & SymLabel && s->val == dot->val){
					s->type = SymValue | SymLabel;
					s->val = dot->val;
				}else{
					err(1, "error: redefinition by label");
				}
			}else if(peek() == '='){
				peekc = 0;
				w = expr(0);
				if(s->type == None || (s->type & SymLabel) == 0){
					s->type = SymValue;
					s->val = w;
				}else
					err(1, "error: redefinition by equ");
			}else{
				peekt = t;
				w = expr(0);
				putword(w);
			}
			break;
		case '-':
		case TokWord:
			peekt = t;
			w = expr(0);
			putword(w);
			break;

		case '$':
			t = token();
			if(t.type == TokWord)
				startaddr = t.w;
			else if(t.type == TokSymbol){
				startaddr = t.sym->val;
			}else
				err(1, "error: expected word or symbol");
			// end assembly
			peekc = EOF;
			return;

		case '*':
			w = expr(1);
			dot->val = w;
			break;

		default:
			err(1, "unknown token %c", t.type);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
callq 0x1b20
movl %eax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpl $0x80, -0x10(%rbp)
je 0x253e
movl -0x10(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x24, %eax
je 0x2497
jmp 0x2312
movl -0x44(%rbp), %eax
subl $0x2a, %eax
je 0x2504
jmp 0x2320
movl -0x44(%rbp), %eax
subl $0x2d, %eax
je 0x2468
jmp 0x232e
movl -0x44(%rbp), %eax
subl $0x81, %eax
je 0x234d
jmp 0x233a
movl -0x44(%rbp), %eax
subl $0x82, %eax
je 0x2468
jmp 0x2523
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x1780
cmpl $0x2c, %eax
jne 0x23d1
movl $0x0, 0x1a757(%rip)     # 0x1cac0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x2399
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x23b9
movq -0x18(%rbp), %rax
movzwl 0x10(%rax), %eax
movq 0x1a757(%rip), %rcx     # 0x1cae8
movzwl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jne 0x23b9
movq -0x18(%rbp), %rax
movl $0x9, 0x8(%rax)
movq 0x1a73d(%rip), %rax     # 0x1cae8
movw 0x10(%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x10(%rax)
jmp 0x23cc
movl $0x1, %edi
leaq 0xf6e(%rip), %rsi       # 0x3333
movb $0x0, %al
callq 0x1270
jmp 0x2463
callq 0x1780
cmpl $0x3d, %eax
jne 0x2437
movl $0x0, 0x1a6db(%rip)     # 0x1cac0
xorl %edi, %edi
callq 0x2090
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x2409
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x2422
movq -0x18(%rbp), %rax
movl $0x1, 0x8(%rax)
movw -0x1a(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x10(%rax)
jmp 0x2435
movl $0x1, %edi
leaq 0xf22(%rip), %rsi       # 0x3350
movb $0x0, %al
callq 0x1270
jmp 0x2461
movq -0x10(%rbp), %rax
movq %rax, 0x1a696(%rip)     # 0x1cad8
movq -0x8(%rbp), %rax
movq %rax, 0x1a693(%rip)     # 0x1cae0
xorl %edi, %edi
callq 0x2090
movw %ax, -0x1a(%rbp)
movzwl -0x1a(%rbp), %edi
callq 0x1d40
jmp 0x2463
jmp 0x2539
movq -0x10(%rbp), %rax
movq %rax, 0x1a665(%rip)     # 0x1cad8
movq -0x8(%rbp), %rax
movq %rax, 0x1a662(%rip)     # 0x1cae0
xorl %edi, %edi
callq 0x2090
movw %ax, -0x1a(%rbp)
movzwl -0x1a(%rbp), %edi
callq 0x1d40
jmp 0x2539
callq 0x1b20
movl %eax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpl $0x82, -0x10(%rbp)
jne 0x24c9
movw -0x8(%rbp), %ax
movw %ax, 0x1b6bb(%rip)      # 0x1db82
jmp 0x24f8
cmpl $0x81, -0x10(%rbp)
jne 0x24e3
movq -0x8(%rbp), %rax
movw 0x10(%rax), %ax
movw %ax, 0x1b6a1(%rip)      # 0x1db82
jmp 0x24f6
movl $0x1, %edi
leaq 0xe7c(%rip), %rsi       # 0x336b
movb $0x0, %al
callq 0x1270
jmp 0x24f8
movl $0xffffffff, 0x1a5be(%rip) # imm = 0xFFFFFFFF
jmp 0x253e
movl $0x1, %edi
callq 0x2090
movw %ax, -0x1a(%rbp)
movw -0x1a(%rbp), %cx
movq 0x1a5cb(%rip), %rax     # 0x1cae8
movw %cx, 0x10(%rax)
jmp 0x2539
movl -0x10(%rbp), %edx
movl $0x1, %edi
leaq 0xe58(%rip), %rsi       # 0x338a
movb $0x0, %al
callq 0x1270
jmp 0x22d8
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)