// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, -0x80(%rsp)
addq $0x60, %rsi
movq %rsi, -0x58(%rsp)
movslq (%rdx), %rax
shlq $0x4, %rax
leaq 0x40(%rsp,%rax), %rax
movq %rax, -0x60(%rsp)
movslq 0x4(%rdx), %rax
shlq $0x4, %rax
leaq 0x40(%rsp,%rax), %rax
movq %rax, -0x68(%rsp)
movslq 0x8(%rdx), %rax
shlq $0x4, %rax
leaq 0x40(%rsp,%rax), %rax
movq %rax, -0x70(%rsp)
movslq (%rcx), %rax
shlq $0x4, %rax
leaq 0x40(%rsp), %rdi
leaq 0x30(%rax,%rdi), %rax
movq %rax, -0x78(%rsp)
movslq 0x4(%rcx), %rax
shlq $0x4, %rax
leaq 0x30(%rax,%rdi), %r11
movslq 0x8(%rcx), %rax
shlq $0x4, %rax
leaq 0x30(%rax,%rdi), %rbx
movslq (%r8), %rax
shlq $0x4, %rax
leaq 0x60(%rax,%rdi), %r14
movslq 0x4(%r8), %rax
shlq $0x4, %rax
leaq 0x60(%rax,%rdi), %r15
movslq 0x8(%r8), %rax
shlq $0x4, %rax
leaq 0x60(%rax,%rdi), %r8
xorl %r12d, %r12d
leaq 0x2f82(%rip), %r13      # 0x71a0
movq %r12, %rbp
shlq $0x4, %rbp
movq -0x58(%rsp), %rax
movq (%rax,%rbp), %rdi
movq 0x8(%rax,%rbp), %rax
movl $0x8, %ecx
xorl %r9d, %r9d
movq (%r9,%r13), %rsi
andq %rdi, %rsi
movq 0x8(%r9,%r13), %rdx
andq %rax, %rdx
shrdq %cl, %rdx, %rsi
shrxq %rcx, %rdx, %rdx
testb $0x40, %cl
cmovneq %rdx, %rsi
movl $0x0, %r10d
cmoveq %rdx, %r10
movq %r10, 0x48(%rsp,%r9)
movq %rsi, 0x40(%rsp,%r9)
addq $0x10, %r9
addq $-0x1, %rcx
jb 0x423b
movq -0x60(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
shldq $0x8, %rax, %rcx
shlq $0x8, %rax
movq %rax, -0x50(%rsp,%rbp)
movq -0x68(%rsp), %rdx
movq (%rdx), %rdi
movq 0x8(%rdx), %r9
shldq $0x7, %rdi, %r9
movq %rcx, -0x48(%rsp,%rbp)
shlq $0x7, %rdi
orq %rcx, %r9
orq %rax, %rdi
movq %rdi, -0x50(%rsp,%rbp)
movq %r9, -0x48(%rsp,%rbp)
movq -0x70(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
shldq $0x6, %rax, %rcx
shlq $0x6, %rax
orq %r9, %rcx
orq %rdi, %rax
movq %rax, -0x50(%rsp,%rbp)
movq %rcx, -0x48(%rsp,%rbp)
movq -0x78(%rsp), %rdx
movq (%rdx), %rdi
movq 0x8(%rdx), %r9
shldq $0x5, %rdi, %r9
shlq $0x5, %rdi
orq %rcx, %r9
orq %rax, %rdi
movq %rdi, -0x50(%rsp,%rbp)
movq %r9, -0x48(%rsp,%rbp)
movq (%r11), %rax
movq 0x8(%r11), %rcx
shldq $0x4, %rax, %rcx
shlq $0x4, %rax
orq %r9, %rcx
movq (%rbx), %r9
movq 0x8(%rbx), %rsi
shldq $0x3, %r9, %rsi
orq %rdi, %rax
movq %rax, -0x50(%rsp,%rbp)
movq %rcx, -0x48(%rsp,%rbp)
shlq $0x3, %r9
orq %rcx, %rsi
orq %rax, %r9
movq (%r14), %rax
movq 0x8(%r14), %rcx
shldq $0x2, %rax, %rcx
movq %r9, -0x50(%rsp,%rbp)
movq %rsi, -0x48(%rsp,%rbp)
shlq $0x2, %rax
orq %rsi, %rcx
orq %r9, %rax
movq %rax, -0x50(%rsp,%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdi
shldq $0x1, %rsi, %rdi
movq %rcx, -0x48(%rsp,%rbp)
addq %rsi, %rsi
orq %rcx, %rdi
orq %rax, %rsi
movq %rsi, -0x50(%rsp,%rbp)
movq %rdi, -0x48(%rsp,%rbp)
orq 0x8(%r8), %rdi
orq (%r8), %rsi
movq %rdi, -0x48(%rsp,%rbp)
movq %rsi, -0x50(%rsp,%rbp)
incq %r12
cmpq $0x9, %r12
jne 0x421e
vmovups -0x50(%rsp), %zmm0
vmovups -0x10(%rsp), %zmm1
vmovups (%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