// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]cproc/stmt.c
// Function: label
static bool
label(struct func *f, struct scope *s)
{
	char *name;
	struct gotolabel *g;
	struct block *b;
	unsigned long long i;

	attr(NULL, 0);
	switch (tok.kind) {
	case TCASE:
		next();
		if (!s->switchcases)
			error(&tok.loc, "'case' label must be in switch");
		b = mkblock("switch_case");
		funclabel(f, b);
		i = intconstexpr(s, true);
		switchcase(s->switchcases, i, b);
		expect(TCOLON, "after case expression");
		break;
	case TDEFAULT:
		next();
		if (!s->switchcases)
			error(&tok.loc, "'default' label must be in switch");
		if (s->switchcases->defaultlabel)
			error(&tok.loc, "multiple 'default' labels");
		expect(TCOLON, "after 'default'");
		s->switchcases->defaultlabel = mkblock("switch_default");
		funclabel(f, s->switchcases->defaultlabel);
		break;
	case TIDENT:
		name = tok.lit;
		if (!peek(TCOLON))
			return false;
		g = funcgoto(f, name);
		g->defined = true;
		funclabel(f, g->label);
		break;
	default:
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %esi, %esi
movl %esi, %edi
callq 0x3360
leaq 0x11638(%rip), %rax     # 0x221a8
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x4, %eax
je 0x10cb2
jmp 0x10b80
movl -0x3c(%rbp), %eax
subl $0xd, %eax
je 0x10b9b
jmp 0x10b8a
movl -0x3c(%rbp), %eax
subl $0x12, %eax
je 0x10c1e
jmp 0x10d00
callq 0xd540
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x10bc4
leaq 0x115f6(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xad33(%rip), %rsi      # 0x1b8f0
movb $0x0, %al
callq 0x11190
leaq 0xad44(%rip), %rdi      # 0x1b90f
callq 0x12b50
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x13810
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x90c0
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x12af0
movl $0x5f, %edi
leaq 0xad07(%rip), %rsi      # 0x1b91b
callq 0xd8d0
jmp 0x10d06
callq 0xd540
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x10c47
leaq 0x11573(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xacf1(%rip), %rsi      # 0x1b931
movb $0x0, %al
callq 0x11190
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x10c6f
leaq 0x1154b(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xaceb(%rip), %rsi      # 0x1b953
movb $0x0, %al
callq 0x11190
movl $0x5f, %edi
leaq 0x9364(%rip), %rsi      # 0x19fdf
callq 0xd8d0
leaq 0xace6(%rip), %rdi      # 0x1b96d
callq 0x12b50
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x13810
jmp 0x10d06
leaq 0x114ef(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x5f, %edi
callq 0xd7b0
testb $0x1, %al
jne 0x10cd5
movb $0x0, -0x1(%rbp)
jmp 0x10d0a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x13f50
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x13810
jmp 0x10d06
movb $0x0, -0x1(%rbp)
jmp 0x10d0a
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)