// File: /workspace/github_cpp_makefile_star2_O3/tsoding[P]wcc/src/./wcc_wat_compiler.cpp
// Function: Wat_Compiler::compile_and(Binary_Op)
S_Expr *Wat_Compiler::compile_and(Binary_Op andd)
{
    assert(andd.lhs->type == andd.rhs->type && "Type Checking step didn't work correctly.");

    switch (andd.lhs->type) {
    case Type::U0:
        assert(0 && "Type Checking step didn't work correctly. There is no and operation defined for Type::U0");
        break;
    case Type::U8:
        assert(0 && "Type Checking step didn't work correctly. There is no and operation defined for Type::U8");
        break;
    case Type::U32:
        assert(0 && "Type Checking step didn't work correctly. There is no and operation defined for Type::U32");
        break;
    case Type::U64:
        assert(0 && "Type Checking step didn't work correctly. There is no and operation defined for Type::U64");
        break;
    case Type::Bool:
        return list(atom("i32.and"_sv), compile_expression(andd.lhs), compile_expression(andd.rhs));
    case Type::Unchecked:
        assert(0 && "Type checking step didn't work correctly");
        break;
    }

    assert(0 && "Memory corruption?");
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4(%rsi), %eax
cmpl 0x4(%rdx), %eax
jne 0x59c3
cmpl $0x5, %eax
jne 0x598c
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x8296
movq %rax, %r15
movl $0x1, (%rax)
movq $0x7, 0x8(%rax)
leaq 0x4f6d(%rip), %rax      # 0xa8a7
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4f8e
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4f8e
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x7bbe
movq %rax, %r14
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x8296
movl $0x0, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jae 0x5a5e
movl %eax, %eax
leaq 0x392d(%rip), %rcx      # 0x92c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x45df(%rip), %rdi      # 0x9f8a
leaq 0x4228(%rip), %rsi      # 0x9bda
leaq 0x4d3f(%rip), %rcx      # 0xa6f8
movl $0x13c, %edx            # imm = 0x13C
callq 0x1090
leaq 0x4cde(%rip), %rdi      # 0xa6a8
leaq 0x4209(%rip), %rsi      # 0x9bda
leaq 0x4d20(%rip), %rcx      # 0xa6f8
movl $0x12a, %edx            # imm = 0x12A
callq 0x1090
leaq 0x4e5d(%rip), %rdi      # 0xa846
leaq 0x41ea(%rip), %rsi      # 0x9bda
leaq 0x4d01(%rip), %rcx      # 0xa6f8
movl $0x137, %edx            # imm = 0x137
callq 0x1090
leaq 0x4d7d(%rip), %rdi      # 0xa785
leaq 0x41cb(%rip), %rsi      # 0x9bda
leaq 0x4ce2(%rip), %rcx      # 0xa6f8
movl $0x131, %edx            # imm = 0x131
callq 0x1090
leaq 0x4dbe(%rip), %rdi      # 0xa7e5
leaq 0x41ac(%rip), %rsi      # 0x9bda
leaq 0x4cc3(%rip), %rcx      # 0xa6f8
movl $0x134, %edx            # imm = 0x134
callq 0x1090
leaq 0x4cdf(%rip), %rdi      # 0xa725
leaq 0x418d(%rip), %rsi      # 0x9bda
leaq 0x4ca4(%rip), %rcx      # 0xa6f8
movl $0x12e, %edx            # imm = 0x12E
callq 0x1090
leaq 0x43b2(%rip), %rdi      # 0x9e17
leaq 0x416e(%rip), %rsi      # 0x9bda
leaq 0x4c85(%rip), %rcx      # 0xa6f8
movl $0x140, %edx            # imm = 0x140
callq 0x1090
nop