// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: stat_cbr
static void _stat_cbr(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_CBR);
	assert(node->nchilds == 3);

	ParserASTNode *node_cond = node->childs[0];
	_GetParamInfoResult result_cond;
	_get_param_info(ctx, node_cond, &result_cond);
	if (!_is_integer_type(result_cond.type)
			&& !_is_pointer_type(result_cond.type)) {
		_SYNERR_NODE(
			ctx,
			node_cond,
			"condition parameter type must be integer type or pointer type."
		);
	}

	ParserASTNode *node_label_true = node->childs[1];
	assert(node_label_true->type == BE_NODE_IDENTIFIER);
	if (!parser_get_symbol_from_node(ctx, node, BE_SYM_LABEL, node_label_true->token)) {
		_SYNERR_TOKEN(
			ctx,
			node_label_true->token,
			"undefined label."
		);
	}

	ParserASTNode *node_label_false = node->childs[2];
	assert(node_label_false->type == BE_NODE_IDENTIFIER);
	if (!parser_get_symbol_from_node(ctx, node, BE_SYM_LABEL, node_label_false->token)) {
		_SYNERR_TOKEN(
			ctx,
			node_label_false->token,
			"undefined label."
		);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5c3dc
jmp 0x5c3fb
leaq 0x23d7e(%rip), %rdi     # 0x80161
leaq 0x26496(%rip), %rsi     # 0x82880
movl $0x10f1, %edx           # imm = 0x10F1
leaq 0x28a92(%rip), %rcx     # 0x84e88
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x5c404
jmp 0x5c423
leaq 0x1a151(%rip), %rdi     # 0x7655c
leaq 0x2646e(%rip), %rsi     # 0x82880
movl $0x10f2, %edx           # imm = 0x10F2
leaq 0x28a6a(%rip), %rcx     # 0x84e88
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xba0, (%rax)          # imm = 0xBA0
jne 0x5c431
jmp 0x5c450
leaq 0x1ace7(%rip), %rdi     # 0x7711f
leaq 0x26441(%rip), %rsi     # 0x82880
movl $0x10f3, %edx           # imm = 0x10F3
leaq 0x28a3d(%rip), %rcx     # 0x84e88
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x3, 0x44(%rax)
jne 0x5c45c
jmp 0x5c47b
leaq 0x1acdb(%rip), %rdi     # 0x7713e
leaq 0x26416(%rip), %rsi     # 0x82880
movl $0x10f4, %edx           # imm = 0x10F4
leaq 0x28a12(%rip), %rcx     # 0x84e88
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x5efc0
movzbl -0x20(%rbp), %edi
callq 0x4daa0
testb $0x1, %al
jne 0x5c4e3
movzbl -0x20(%rbp), %edi
callq 0x4db90
testb $0x1, %al
jne 0x5c4e3
leaq -0x430(%rbp), %rdi
leaq 0x289f6(%rip), %rsi     # 0x84eb9
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x430(%rbp), %rdx
callq *%rax
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x5c507
jmp 0x5c526
leaq 0x1ac43(%rip), %rdi     # 0x77151
leaq 0x2636b(%rip), %rsi     # 0x82880
movl $0x1103, %edx           # imm = 0x1103
leaq 0x28967(%rip), %rcx     # 0x84e88
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x438(%rbp), %rax
movq 0x10(%rax), %rcx
movl $0x4, %edx
callq 0x82f0
cmpq $0x0, %rax
jne 0x5c569
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x438(%rbp), %rcx
movq 0x10(%rcx), %rsi
leaq 0x28910(%rip), %rdx     # 0x84e77
callq *%rax
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x440(%rbp)
movq -0x440(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x5c58d
jmp 0x5c5ac
leaq 0x1abe9(%rip), %rdi     # 0x7717d
leaq 0x262e5(%rip), %rsi     # 0x82880
movl $0x110d, %edx           # imm = 0x110D
leaq 0x288e1(%rip), %rcx     # 0x84e88
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x440(%rbp), %rax
movq 0x10(%rax), %rcx
movl $0x4, %edx
callq 0x82f0
cmpq $0x0, %rax
jne 0x5c5ef
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x440(%rbp), %rcx
movq 0x10(%rcx), %rsi
leaq 0x2888a(%rip), %rdx     # 0x84e77
callq *%rax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopl (%rax,%rax)