// File: /workspace/github_c_makefile_star2_O1/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 0x7a57
movl (%r14), %eax
addl $-0x3e, %eax
cmpl $0x3, %eax
ja 0xae5f
leaq 0x39cb(%rip), %rcx      # 0xe6a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x180(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7a57
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x2, %edi
movl $0xa, %esi
callq 0x356c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7a94
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7a57
cmpl $0x35, (%r15)
je 0xad50
leaq 0x38(%rsp), %rdi
leaq 0x3ff6(%rip), %rsi      # 0xed3f
xorl %eax, %eax
callq 0x3250
movq %rbx, %rdi
callq 0x7a94
movq 0x50(%rsp), %rax
movq %rax, 0x10(%r14)
jmp 0xae62
leaq 0x120(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7a57
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x2, %edi
movl $0xc, %esi
jmp 0xae4d
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7a57
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x2, %edi
movl $0xd, %esi
callq 0x356c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7a94
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7a57
cmpl $0x1, (%r15)
je 0xae62
movq %rbx, %rdi
callq 0x985d
movq %rax, 0x18(%r14)
jmp 0xae62
leaq 0x150(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7a57
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x2, %edi
movl $0xb, %esi
callq 0x356c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7a94
jmp 0xae62
xorl %r14d, %r14d
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x7a57
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7a57
cmpl $0x1, (%r15)
je 0xae9b
leaq 0x68(%rsp), %rdi
leaq 0x3ecd(%rip), %rsi      # 0xed61
xorl %eax, %eax
callq 0x3250
movq %rbx, %rdi
callq 0x7a94
movq %r14, %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r14
popq %r15
retq