// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/parser.c
// Function: subtilis_parser_if_compound
int subtilis_parser_if_compound(subtilis_parser_t *p, subtilis_token_t *t,
				subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_keyword_fn fn;
	subtilis_ir_operand_t var_reg;
	int key_type = SUBTILIS_KEYWORD_MAX;
	unsigned int start;

	subtilis_symbol_table_level_up(p->local_st, p->l, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return key_type;
	p->level++;
	subtilis_lexer_get(p->l, t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return key_type;
	start = p->l->line;
	while (t->type != SUBTILIS_TOKEN_EOF) {
		tbuf = subtilis_token_get_text(t);
		if (t->type == SUBTILIS_TOKEN_IDENTIFIER) {
			if (p->current->endproc) {
				subtilis_error_set_useless_statement(
				    err, p->l->stream->name, p->l->line);
				return key_type;
			}
			subtilis_parser_assignment(p, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return key_type;
			continue;
		} else if ((t->type == SUBTILIS_TOKEN_OPERATOR) &&
			   !strcmp(tbuf, "<-")) {
			subtilis_parser_return(p, t, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return key_type;
			continue;
		} else if (t->type != SUBTILIS_TOKEN_KEYWORD) {
			subtilis_error_set_keyword_expected(
			    err, tbuf, p->l->stream->name, p->l->line);
			return key_type;
		}

		key_type = t->tok.keyword.type;
		if ((key_type == SUBTILIS_KEYWORD_ELSE) ||
		    (key_type == SUBTILIS_KEYWORD_ENDIF))
			break;

		if (p->current->endproc) {
			subtilis_error_set_useless_statement(
			    err, p->l->stream->name, p->l->line);
			return key_type;
		}

		fn = keyword_fns[key_type];
		if (!fn) {
			tbuf = subtilis_token_get_text(t);
			subtilis_error_set_not_supported(
			    err, tbuf, p->l->stream->name, p->l->line);
			return key_type;
		}
		fn(p, t, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return key_type;
	}

	if (t->type == SUBTILIS_TOKEN_EOF)
		subtilis_error_set_compund_not_term(err, p->l->stream->name,
						    start);

	p->current->endproc = false;

	var_reg.reg = SUBTILIS_IR_REG_LOCAL;
	subtilis_reference_deallocate_refs(p, var_reg, p->local_st, p->level,
					   err);
	if (err->type != SUBTILIS_ERROR_OK)
		return key_type;

	p->level--;
	subtilis_symbol_table_level_down(p->local_st, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return key_type;
	p->current->handler_list =
	    subtilis_handler_list_truncate(p->current->handler_list, p->level);
	return key_type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x95, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x3c320
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16da7
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x133f0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16ddf
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1702d
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x16e85
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
testb $0x1, 0x88(%rax)
je 0x16e5b
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x2e, %esi
leaq 0x93676(%rip), %r8      # 0xaa4bb
movl $0xf0, %r9d
callq 0x15930
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1b800
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16e80
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
jmp 0x16dec
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x16ecd
movq -0x28(%rbp), %rdi
leaq 0x93642(%rip), %rsi     # 0xaa4db
callq 0x12140
cmpl $0x0, %eax
jne 0x16ecd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x20b20
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x16ec8
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
jmp 0x16dec
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
je 0x16f23
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x10, %esi
leaq 0x94376(%rip), %rcx     # 0xab276
leaq 0x935b4(%rip), %rax     # 0xaa4bb
movq %rax, (%rsp)
movl $0xff, 0x8(%rsp)
callq 0x156d0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
jmp 0x16f25
jmp 0x16f27
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x23, -0x3c(%rbp)
je 0x16f3d
cmpl $0x27, -0x3c(%rbp)
jne 0x16f42
jmp 0x1702d
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
testb $0x1, 0x88(%rax)
je 0x16f8e
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x2e, %esi
leaq 0x93543(%rip), %r8      # 0xaa4bb
movl $0x10a, %r9d            # imm = 0x10A
callq 0x15930
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movslq -0x3c(%rbp), %rcx
leaq 0xb3847(%rip), %rax     # 0xca7e0
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x17002
movq -0x18(%rbp), %rdi
callq 0x12d70
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %r9d
movl $0x13, %esi
leaq 0x94297(%rip), %rcx     # 0xab276
leaq 0x934d5(%rip), %rax     # 0xaa4bb
movq %rax, (%rsp)
movl $0x112, 0x8(%rsp)       # imm = 0x112
callq 0x156d0
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq *%rax
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x17028
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
jmp 0x16dec
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x1705f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movl -0x40(%rbp), %ecx
movl $0x1e, %esi
leaq 0x93467(%rip), %r8      # 0xaa4bb
movl $0x11c, %r9d            # imm = 0x11C
callq 0x15930
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movb $0x0, 0x88(%rax)
movq $0x2, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x20(%rbp), %r8
movq -0x38(%rbp), %rsi
callq 0x6f4e0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x170a8
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x3c390
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x170da
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17108
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rsi
callq 0x37f70
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x78(%rax)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)