// File: vsklad[P]cgen/./bal/cnf/processor/cnfoptimizer.cpp
// Function: bal::__reduce_clause_flags(unsigned short&, unsigned short, unsigned int)
inline void __reduce_clause_flags(uint16_t& flags, const clause_size_t index, const literalid_t value) {
        switch ((index << 1) + value) {
            case 0: // variable 0, value 0
                flags =
                (flags & 0x0002) >> 1 | (flags & 0x0008) >> 2 |
                (flags & 0x0020) >> 3 | (flags & 0x0080) >> 4 |
                (flags & 0x0200) >> 5 | (flags & 0x0800) >> 6 |
                (flags & 0x2000) >> 7 | (flags & 0x8000) >> 8;
                break;
            case 1: // variable 0, value 1
                flags =
                (flags & 0x0001)      | (flags & 0x0004) >> 1 |
                (flags & 0x0010) >> 2 | (flags & 0x0040) >> 3 |
                (flags & 0x0100) >> 4 | (flags & 0x0400) >> 5 |
                (flags & 0x1000) >> 6 | (flags & 0x4000) >> 7;
                break;
            case 2: // variable 1, value 0
                flags =
                (flags & 0x000C) >> 2 | (flags & 0x00C0) >> 4 |
                (flags & 0x0C00) >> 6 | (flags & 0xC000) >> 8;
                break;
            case 3: // variable 1, value 1
                flags =
                (flags & 0x0003)      | (flags & 0x0030) >> 2 |
                (flags & 0x0300) >> 4 | (flags & 0x3000) >> 6;
                break;
            case 4: // variable 2, value 0
                flags = (flags & 0x00F0) >> 4 | (flags & 0xF000) >> 8;
                break;
            case 5: // variable 2, value 1
                flags = (flags & 0x000F)      | (flags & 0x0F00) >> 4;
                break;
            case 6: // variable 3, value 0
                flags = (flags & 0xFFFF) >> 8;
                break;
            case 7: // variable 3, value 1
                flags = (flags & 0x00FF);
                break;
        };
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movl %edx, -0x10(%rbp)
movzwl -0xa(%rbp), %eax
movl -0x10(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x7, %eax
ja 0x190d7
movq -0x18(%rbp), %rax
leaq 0x4502e(%rip), %rcx     # 0x5deb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0x2, %eax
sarl %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x8, %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x20, %ecx
sarl $0x3, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x80, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x200, %ecx            # imm = 0x200
sarl $0x5, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x800, %ecx            # imm = 0x800
sarl $0x6, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x2000, %ecx           # imm = 0x2000
sarl $0x7, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x8000, %ecx           # imm = 0x8000
sarl $0x8, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0x1, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x4, %ecx
sarl %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x10, %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x40, %ecx
sarl $0x3, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x100, %ecx            # imm = 0x100
sarl $0x4, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x400, %ecx            # imm = 0x400
sarl $0x5, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x1000, %ecx           # imm = 0x1000
sarl $0x6, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x4000, %ecx           # imm = 0x4000
sarl $0x7, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0xc, %eax
sarl $0x2, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0xc0, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0xc00, %ecx            # imm = 0xC00
sarl $0x6, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0xc000, %ecx           # imm = 0xC000
sarl $0x8, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0x3, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x30, %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x300, %ecx            # imm = 0x300
sarl $0x4, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0x3000, %ecx           # imm = 0x3000
sarl $0x6, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0xf0, %eax
sarl $0x4, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0xf000, %ecx           # imm = 0xF000
sarl $0x8, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0xf, %eax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
andl $0xf00, %ecx            # imm = 0xF00
sarl $0x4, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
sarl $0x8, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x190d7
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
andl $0xff, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
popq %rbp
retq
nopl (%rax)