// File: /workspace/github_c_makefile_star2_O0/johnvtan[P]ccccc/parse.c
// Function: fn_def_is_equal
static bool fn_def_is_equal(fn_def_t *fn1, fn_def_t *fn2) {
    if (string_eq(fn1->name, fn2->name) != 0) {
        // Should never see this case...
        return false;
    }

    if (fn1->ret_type != fn2->ret_type) {
        debug("mismatching return types\n");
        return false;
    }

    if (fn1->params == NULL && fn2->params == NULL)
        return true;

    if ((fn1->params == NULL && fn2->params != NULL)
            || (fn1->params != NULL && fn2->params == NULL)) {

        debug("mismatching params: one has no params, but the other does\n");
        return false;
    }

    if (fn1->params->len != fn2->params->len) {
        debug("one has %u params, the other has %u\n", fn1->params->len, fn2->params->len);
        return false;
    }

    list_node_t *n1 = list_first(fn1->params);
    list_node_t *n2 = list_first(fn2->params);
    string_t *v1_name;
    string_t *v2_name;
    var_info_t *v1;
    var_info_t *v2;
    for (int i = 0; i < fn1->params->len; i++) {
        v1_name = n1->data;
        v2_name = n2->data;

        v1 = map_get(fn1->env->homes, v1_name);
        v2 = map_get(fn2->env->homes, v2_name);

        if (v1->type != v2->type) {
            debug("mismatching param types for param %s\n", string_get(v1_name));
            return false;
        }

        n1 = n1->next;
        n2 = n2->next;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x7c70
cmpl $0x0, %eax
je 0x5531
movb $0x0, -0x1(%rbp)
jmp 0x5694
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x554e
jmp 0x5543
jmp 0x5545
movb $0x0, -0x1(%rbp)
jmp 0x5694
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x556d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x556d
movb $0x1, -0x1(%rbp)
jmp 0x5694
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x5583
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x5599
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x55a6
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x55a6
jmp 0x559b
jmp 0x559d
movb $0x0, -0x1(%rbp)
jmp 0x5694
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x18(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x18(%rcx), %eax
je 0x55cb
jmp 0x55c0
jmp 0x55c2
movb $0x0, -0x1(%rbp)
jmp 0x5694
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x18(%rcx), %eax
jge 0x5690
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x4ba0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x4ba0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
je 0x566a
jmp 0x5662
jmp 0x5664
movb $0x0, -0x1(%rbp)
jmp 0x5694
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x55f8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nop