// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: check_stat_idx_params
static bool _check_stat_idx_params(
	ParserContext *ctx,
	ParserASTNode *node,
	_ResultCheckStat_I_CI_CI *check_result
) {
	assert(ctx);
	assert(node);
	assert(check_result);

	if (_get_type_by_type_node(ctx, check_result->node_type_target) != BE_TYPE_POINTER
			|| _get_type_by_type_node(ctx, check_result->node_type_source_left) != BE_TYPE_POINTER) {
		return false;
	}

	ParserASTNode *target = check_result->node_type_target->childs[0];
	ParserASTNode *source = check_result->node_type_source_left->childs[0];

	uint8_t type_target = _get_type_by_type_node(ctx, target);
	uint8_t type_source = _get_type_by_type_node(ctx, source);

	if (type_target == BE_TYPE_ARRAY && type_source == BE_TYPE_ARRAY) {
		ParserASTNode *target_dims = target->childs[0];
		ParserASTNode *target_type = target->childs[1];
		ParserASTNode *source_dims = source->childs[0];
		ParserASTNode *source_type = source->childs[1];

		if (!_is_compatible_type(ctx, target_type, source_type, true)) {
			return false;
		}

		if (target_dims->nchilds + 1 != source_dims->nchilds) {
			return false;
		}

		for (int i = 0; i < target_dims->nchilds; i++) {
			ParserASTNode *target_dim = target_dims->childs[i];
			ParserASTNode *source_dim = source_dims->childs[1 + i];
			if (be_parser_get_uint_val(ctx, target_dim) != be_parser_get_uint_val(ctx, source_dim)) {
				return false;
			}
		}

		return true;
	} else if (type_target != BE_TYPE_ARRAY && type_source == BE_TYPE_ARRAY) {
		ParserASTNode *source_dims = source->childs[0];
		ParserASTNode *source_type = source->childs[1];

		if (!_is_compatible_type(ctx, target, source_type, true)) {
			return false;
		}

		if (source_dims->nchilds != 1) {
			return false;
		}

		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x60060
jmp 0x6007f
leaq 0x200fa(%rip), %rdi     # 0x80161
leaq 0x22812(%rip), %rsi     # 0x82880
movl $0x1454, %edx           # imm = 0x1454
leaq 0x256aa(%rip), %rcx     # 0x85724
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x60088
jmp 0x600a7
leaq 0x164cd(%rip), %rdi     # 0x7655c
leaq 0x227ea(%rip), %rsi     # 0x82880
movl $0x1455, %edx           # imm = 0x1455
leaq 0x25682(%rip), %rcx     # 0x85724
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x600b0
jmp 0x600cf
leaq 0x256c8(%rip), %rdi     # 0x8577f
leaq 0x227c2(%rip), %rsi     # 0x82880
movl $0x1456, %edx           # imm = 0x1456
leaq 0x2565a(%rip), %rcx     # 0x85724
callq 0x30a0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x56560
movzbl %al, %eax
cmpl $0x10, %eax
jne 0x60101
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x56560
movzbl %al, %eax
cmpl $0x10, %eax
je 0x6010a
movb $0x0, -0x1(%rbp)
jmp 0x602db
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x56560
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x56560
movb %al, -0x32(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0xe, %eax
jne 0x60270
movzbl -0x32(%rbp), %eax
cmpl $0xe, %eax
jne 0x60270
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl $0x1, %ecx
callq 0x50c90
testb $0x1, %al
jne 0x601cb
movb $0x0, -0x1(%rbp)
jmp 0x602db
movq -0x40(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movq -0x50(%rbp), %rcx
cmpl 0x44(%rcx), %eax
je 0x601e7
movb $0x0, -0x1(%rbp)
jmp 0x602db
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x6026a
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x3e290
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3e290
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
je 0x6025d
movb $0x0, -0x1(%rbp)
jmp 0x602db
jmp 0x6025f
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x601ee
movb $0x1, -0x1(%rbp)
jmp 0x602db
movzbl -0x31(%rbp), %eax
cmpl $0xe, %eax
je 0x602d7
movzbl -0x32(%rbp), %eax
cmpl $0xe, %eax
jne 0x602d7
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x80(%rbp), %rdx
movl $0x1, %ecx
callq 0x50c90
testb $0x1, %al
jne 0x602c1
movb $0x0, -0x1(%rbp)
jmp 0x602db
movq -0x78(%rbp), %rax
cmpl $0x1, 0x44(%rax)
je 0x602d1
movb $0x0, -0x1(%rbp)
jmp 0x602db
movb $0x1, -0x1(%rbp)
jmp 0x602db
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)