// File: /workspace/github_c_makefile_star2_O2/Yamsman[P]scc/src/parse.c
// Function: parse_stmt_jump
ast_n *parse_stmt_jump(lexer *lx) {
	ast_n *node = NULL;

	switch (lex_peek(lx).type) {
		case TOK_KW_GOTO:
			node = astn_new(STMT, STMT_GOTO, lex_peek(lx));
			lex_adv(lx);

			token t = lex_peek(lx);
			if (t.type != TOK_IDENT)
				c_error(&t.loc, "Expected identifier after 'goto'\n");
			lex_adv(lx);
			node->dat.stmt.lbl = t.dat.sval;
			break;
		case TOK_KW_CONTINUE:
			node = astn_new(STMT, STMT_CONTINUE, lex_peek(lx));
			lex_adv(lx);
			break;
		case TOK_KW_BREAK:
			node = astn_new(STMT, STMT_BREAK, lex_peek(lx));
			lex_adv(lx);
			break;
		case TOK_KW_RETURN:
			node = astn_new(STMT, STMT_RETURN, lex_peek(lx));
			lex_adv(lx);
			
			if (lex_peek(lx).type != TOK_SEM)
				node->dat.stmt.expr = parse_expr(lx);
			break;
	}

	//Missing ';'
	token t = lex_peek(lx);
	if (lex_peek(lx).type != TOK_SEM)
		c_error(&t.loc, "Missing ']' after statement\n");
	lex_adv(lx);

	return node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, %rbx
leaq 0x1b0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74e5
movl (%r14), %eax
addl $-0x3e, %eax
cmpl $0x3, %eax
ja 0xa5eb
leaq 0x322e(%rip), %rcx      # 0xd6a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x180(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74e5
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
pushq $0x2
popq %rdi
pushq $0xa
popq %rsi
callq 0x333c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7522
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x74e5
cmpl $0x35, (%r15)
je 0xa4e9
leaq 0x38(%rsp), %rdi
leaq 0x385d(%rip), %rsi      # 0xdd3f
xorl %eax, %eax
callq 0x35e4
movq %rbx, %rdi
callq 0x7522
movq 0x50(%rsp), %rax
movq %rax, 0x10(%r14)
jmp 0xa5ee
leaq 0x120(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74e5
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
pushq $0x2
popq %rdi
pushq $0xc
jmp 0xa5d8
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74e5
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
pushq $0x2
popq %rdi
pushq $0xd
popq %rsi
callq 0x333c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7522
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x74e5
cmpl $0x1, (%r15)
je 0xa5ee
movq %rbx, %rdi
callq 0x90d4
movq %rax, 0x18(%r14)
jmp 0xa5ee
leaq 0x150(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74e5
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
pushq $0x2
popq %rdi
pushq $0xb
popq %rsi
callq 0x333c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7522
jmp 0xa5ee
xorl %r14d, %r14d
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x74e5
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x74e5
cmpl $0x1, (%r15)
je 0xa627
leaq 0x68(%rsp), %rdi
leaq 0x3741(%rip), %rsi      # 0xdd61
xorl %eax, %eax
callq 0x35e4
movq %rbx, %rdi
callq 0x7522
movq %r14, %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r14
popq %r15
retq