// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: is_compatible_func_type
static bool _is_compatible_func_type(
	ParserContext *ctx,
	ParserASTNode *target,
	ParserASTNode *source,
	bool same
) {
	assert(ctx);
	assert(target);
	assert(source);

	if (_get_type_by_type_node(ctx, target) == FE_TYPE_FUNC
			&& _get_type_by_type_node(ctx, source) == FE_TYPE_FUNC
			&& target->nchilds == source->nchilds) {
		ParserASTNode *target_params = target->childs[0];
		ParserASTNode *source_params = source->childs[0];
		if (target_params->nchilds == source_params->nchilds) {
			for (int32_t i = 0; i < target_params->nchilds; i++) {
				ParserASTNode *target_param = target_params->childs[i];
				ParserASTNode *source_param = source_params->childs[i];

				if (target_param->type == FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM
						&& source_param->type != FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM) {
					return false;
				}
				if (target_param->type != FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM
						&& source_param->type == FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM) {
					return false;
				}

				if (target_param->type != FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM
						&& source_param->type != FE_NODE_FUNC_PARAMS_ELLIPSIS_ITEM) {
					ParserASTNode *target_param_type = target_param->childs[1];
					ParserASTNode *source_param_type = source_param->childs[1];
					if (!_is_compatible_type(ctx, target_param_type, source_param_type, true)) {
						return false;
					}
				}
			}
		} else {
			return false;
		}

		if (target->nchilds == 2) {
			ParserASTNode *target_ret_type = target->childs[1];
			ParserASTNode *source_ret_type = source->childs[1];
			if (!_is_compatible_type(ctx, target_ret_type, source_ret_type, true)) {
				return false;
			}
		}

		return true;
	} else {
		return false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x33862
movq %rdx, %r14
testq %rdx, %rdx
je 0x33881
movq %rsi, %r15
movq %rdi, %rbx
callq 0x2b04a
cmpb $0xf, %al
jne 0x33851
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b04a
cmpb $0xf, %al
jne 0x33851
movl 0x44(%r15), %eax
cmpl 0x44(%r14), %eax
jne 0x33851
movq 0x48(%r15), %rax
movq (%rax), %r12
movq 0x48(%r14), %rax
movq (%rax), %rsi
movl 0x44(%r12), %eax
cmpl 0x44(%rsi), %eax
jne 0x33851
cmpl $0x0, 0x44(%r12)
jle 0x33825
xorl %r13d, %r13d
movq %rsi, -0x30(%rbp)
movq 0x48(%r12), %rax
movq (%rax,%r13,8), %rax
movq 0x48(%rsi), %rcx
movq (%rcx,%r13,8), %rcx
movl (%rax), %edx
cmpl $0xa03, %edx            # imm = 0xA03
jne 0x337db
cmpl $0xa03, (%rcx)          # imm = 0xA03
jne 0x33851
cmpl $0xa03, %edx            # imm = 0xA03
je 0x33818
cmpl $0xa03, (%rcx)          # imm = 0xA03
je 0x33851
cmpl $0xa03, %edx            # imm = 0xA03
je 0x33818
cmpl $0xa03, (%rcx)          # imm = 0xA03
je 0x33818
movq 0x48(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x48(%rcx), %rax
movq 0x8(%rax), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x2ada4
movq -0x30(%rbp), %rsi
testb %al, %al
je 0x33851
incq %r13
movslq 0x44(%r12), %rax
cmpq %rax, %r13
jl 0x337b0
cmpl $0x2, 0x44(%r15)
jne 0x3384d
movq 0x48(%r15), %rax
movq 0x8(%rax), %rsi
movq 0x48(%r14), %rax
movq 0x8(%rax), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x2ada4
testb %al, %al
je 0x33851
movb $0x1, %al
jmp 0x33853
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15323(%rip), %rdi     # 0x48b8c
leaq 0x17fea(%rip), %rsi     # 0x4b85a
leaq 0x19ef1(%rip), %rcx     # 0x4d768
movl $0x2a0, %edx            # imm = 0x2A0
callq 0x30a0
leaq 0xbcae(%rip), %rdi      # 0x3f536
leaq 0x17fcb(%rip), %rsi     # 0x4b85a
leaq 0x19ed2(%rip), %rcx     # 0x4d768
movl $0x2a1, %edx            # imm = 0x2A1
callq 0x30a0