// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/ast.c
// Function: ast_equals
bool ast_equals(struct ast *a, struct ast *b)
{
    if (a->tag != b->tag)
        return false;

    switch (a->tag) {
        case AST_NO_VAL:
            return true;
        case AST_S:
            return strcmp(ast_s(a), ast_s(b));
        case AST_I:
            return ast_i(a) == ast_i(b);
        case AST_F:
            return ast_f(a) == ast_f(b);
        case AST_AST: {
            size_t n_a_asts, n_b_asts;
            struct ast **a_asts = ast_asts(a, &n_a_asts);
            struct ast **b_asts = ast_asts(b, &n_b_asts);

            if (n_a_asts != n_b_asts)
                return false;

            for (size_t i = 0; i < n_a_asts; i++) {
                if (!ast_equals(a_asts[i], b_asts[i]))
                    return false;
            }

            return true;
        }
        case AST_CHARS: {
            size_t a_n, b_n;
            const char *a_s = ast_chars(a, &a_n);
            const char *b_s = ast_chars(b, &b_n);

            if (a_n != b_n)
                return false;

            return memcmp(a_s, b_s, a_n) == 0;
        }
    }

    bug("unknown AST-type");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %ecx
cmpl (%rsi), %ecx
jne 0x3096
movl %ecx, %edx
roll $0x14, %edx
cmpl $0x5, %edx
ja 0x315b
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, %al
leaq 0xa1f9(%rip), %rsi      # 0xd194
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x1000, %ecx           # imm = 0x1000
jne 0x30ed
movq 0x18(%r14), %rdi
movq 0x18(%rbx), %rsi
callq 0x2100
testl %eax, %eax
setne %al
jmp 0x3098
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x30a4
movq 0x18(%r14), %r15
cmpq 0x18(%rbx), %r15
jne 0x3096
testq %r15, %r15
je 0x3098
decq %r15
xorl %r12d, %r12d
movq 0x20(%r14,%r12,8), %rdi
movq 0x20(%rbx,%r12,8), %rsi
callq 0x2f6c
testb %al, %al
je 0x3098
leaq 0x1(%r12), %rcx
cmpq %r12, %r15
movq %rcx, %r12
jne 0x2ffc
jmp 0x3098
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x2000, %ecx           # imm = 0x2000
jne 0x30ca
movq 0x18(%r14), %rax
cmpq 0x18(%rbx), %rax
jmp 0x3091
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x3000, %ecx           # imm = 0x3000
jne 0x3110
movsd 0x18(%rbx), %xmm0
cmpeqsd 0x18(%r14), %xmm0
movq %xmm0, %rax
andl $0x1, %eax
jmp 0x3098
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x5000, %ecx           # imm = 0x5000
jne 0x3133
movq 0x20(%r14), %rdx
cmpq 0x20(%rbx), %rdx
jne 0x3096
movq 0x18(%r14), %rdi
movq 0x18(%rbx), %rsi
callq 0x2180
testl %eax, %eax
sete %al
jmp 0x3098
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa101(%rip), %rdi      # 0xd1ac
leaq 0xa11c(%rip), %rsi      # 0xd1ce
leaq 0xa18b(%rip), %rcx      # 0xd244
leaq 0xa1a2(%rip), %r8       # 0xd262
movl $0x99, %edx
jmp 0x3154
leaq 0xa0db(%rip), %rdi      # 0xd1ac
leaq 0xa0f6(%rip), %rsi      # 0xd1ce
leaq 0xa131(%rip), %rcx      # 0xd210
leaq 0xa13e(%rip), %r8       # 0xd224
movl $0x83, %edx
jmp 0x3154
leaq 0xa0b8(%rip), %rdi      # 0xd1ac
leaq 0xa0d3(%rip), %rsi      # 0xd1ce
leaq 0xa0d2(%rip), %rcx      # 0xd1d4
leaq 0xa0df(%rip), %r8       # 0xd1e8
movl $0x73, %edx
jmp 0x3154
leaq 0xa095(%rip), %rdi      # 0xd1ac
leaq 0xa0b0(%rip), %rsi      # 0xd1ce
leaq 0xa105(%rip), %rcx      # 0xd22a
leaq 0xa112(%rip), %r8       # 0xd23e
movl $0x8a, %edx
jmp 0x3154
leaq 0xa072(%rip), %rdi      # 0xd1ac
leaq 0xa08d(%rip), %rsi      # 0xd1ce
leaq 0xa0a6(%rip), %rcx      # 0xd1ee
leaq 0xa0b7(%rip), %r8       # 0xd206
movl $0x7a, %edx
xorl %eax, %eax
callq 0x4eac
leaq 0xa497(%rip), %rdi      # 0xd5f9
xorl %eax, %eax
callq 0x4eac
nopl (%rax)