// File: /workspace/github_cpp_makefile_star2_O3/kaityo256[P]minlex/minlex.cpp
// Function: Sudoku::perm_columns(int*, int*, int*)
Sudoku perm_columns(int ai[3], int aj[3], int ak[3]) {
    mbit bdata2[9];
    mbit v[9];
    for (int i = 0; i < 9; i++) {
      for (int j = 0; j < 9; j++) {
        v[j] = (bdata[i] & column_bits[j]) >> (8 - j);
      }
      bdata2[i] = v[ai[0]] << 8;
      bdata2[i] |= v[ai[1]] << 7;
      bdata2[i] |= v[ai[2]] << 6;
      bdata2[i] |= v[aj[0] + 3] << 5;
      bdata2[i] |= v[aj[1] + 3] << 4;
      bdata2[i] |= v[aj[2] + 3] << 3;
      bdata2[i] |= v[ak[0] + 6] << 2;
      bdata2[i] |= v[ak[1] + 6] << 1;
      bdata2[i] |= v[ak[2] + 6] << 0;
    }
    return Sudoku(bdata2);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movslq (%rdx), %rax
movq %rdi, -0x80(%rsp)
addq $0x60, %rsi
leaq -0x50(%rsp), %rdi
leaq 0x3125(%rip), %r13      # 0x71a0
xorl %r12d, %r12d
movq %rsi, -0x58(%rsp)
movslq 0x4(%rcx), %rsi
shlq $0x4, %rax
leaq -0x50(%rsp,%rax), %rax
shlq $0x4, %rsi
leaq 0x30(%rsi,%rdi), %r11
movq %rax, -0x60(%rsp)
movslq 0x4(%rdx), %rax
shlq $0x4, %rax
leaq -0x50(%rsp,%rax), %rax
movq %rax, -0x68(%rsp)
movslq 0x8(%rdx), %rax
movslq (%rcx), %rdx
shlq $0x4, %rax
shlq $0x4, %rdx
leaq -0x50(%rsp,%rax), %rax
movq %rax, -0x70(%rsp)
leaq 0x30(%rdx,%rdi), %rax
movslq 0x8(%rcx), %rdx
movslq (%r8), %rcx
movq %rax, -0x78(%rsp)
shlq $0x4, %rdx
shlq $0x4, %rcx
leaq 0x30(%rdx,%rdi), %rbx
movslq 0x4(%r8), %rdx
leaq 0x60(%rcx,%rdi), %r14
movslq 0x8(%r8), %rcx
shlq $0x4, %rdx
shlq $0x4, %rcx
leaq 0x60(%rdx,%rdi), %r15
leaq 0x60(%rcx,%rdi), %r8
movq -0x58(%rsp), %rax
movq %r12, %rbp
shlq $0x4, %rbp
movl $0x8, %ecx
xorl %r9d, %r9d
movq (%rax,%rbp), %rdi
movq 0x8(%rax,%rbp), %rax
movq (%r9,%r13), %rdx
movq 0x8(%r9,%r13), %rsi
movl $0x0, %r10d
andq %rdi, %rdx
andq %rax, %rsi
shrdq %cl, %rsi, %rdx
shrxq %rcx, %rsi, %rsi
testb $0x40, %cl
cmoveq %rsi, %r10
cmovneq %rsi, %rdx
movq %r10, -0x48(%rsp,%r9)
movq %rdx, -0x50(%rsp,%r9)
addq $0x10, %r9
addq $-0x1, %rcx
jb 0x4123
movq -0x60(%rsp), %rax
movq -0x68(%rsp), %rdx
movq -0x78(%rsp), %r10
incq %r12
movq (%rax), %rcx
movq 0x8(%rax), %rdi
movq (%rdx), %r9
movq 0x8(%rdx), %rax
movq -0x70(%rsp), %rdx
shldq $0x8, %rcx, %rdi
shldq $0x7, %r9, %rax
shlq $0x8, %rcx
shlq $0x7, %r9
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
orq %rcx, %r9
movq 0x8(%r10), %rcx
orq %rdi, %rax
movq (%r10), %rdi
movq (%r11), %r10
shldq $0x6, %rsi, %rdx
shlq $0x6, %rsi
shldq $0x5, %rdi, %rcx
shlq $0x5, %rdi
orq %rsi, %rdi
movq (%rbx), %rsi
orq %r9, %rdi
movq 0x8(%rbx), %r9
orq %rdx, %rcx
movq 0x8(%r11), %rdx
orq %rax, %rcx
movq (%r14), %rax
shldq $0x3, %rsi, %r9
leaq (,%rsi,8), %rsi
shldq $0x4, %r10, %rdx
shlq $0x4, %r10
orq %r10, %rsi
movq 0x8(%r14), %r10
orq %rdx, %r9
shldq $0x2, %rax, %r10
shlq $0x2, %rax
orq %rsi, %rax
orq %r9, %r10
orq %rdi, %rax
movq 0x8(%r15), %rdi
orq %rcx, %r10
movq (%r15), %rcx
shldq $0x1, %rcx, %rdi
leaq (%rcx,%rcx), %rsi
orq %rax, %rsi
orq (%r8), %rsi
orq %r10, %rdi
orq 0x8(%r8), %rdi
movq %rsi, 0x40(%rsp,%rbp)
movq %rdi, 0x48(%rsp,%rbp)
cmpq $0x9, %r12
jne 0x4106
vmovups 0x40(%rsp), %zmm0
vmovups 0x80(%rsp), %zmm1
vmovups 0x90(%rsp), %zmm2
movq -0x80(%rsp), %rax
vmovups %zmm2, 0xb0(%rax)
vmovups %zmm1, 0xa0(%rax)
vmovups %zmm0, 0x60(%rax)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
nop