// File: kaityo256[P]minlex/minlex.cpp
// Function: Sudoku::perm_rbox(int*)
Sudoku perm_rbox(int a[3]) {
    mbit bdata2[9];
    mbit v[3];
    mbit t0 = (mbit(1) << 27) - 1;
    mbit t1 = t0 << 27;
    mbit t2 = t0 << 54;
    for (int i = 0; i < 9; i++) {
      v[0] = bdata[i] & t0;
      v[1] = (bdata[i] & t1) >> 27;
      v[2] = (bdata[i] & t2) >> 54;
      bdata2[i] = v[2 - a[2]];
      bdata2[i] |= v[2 - a[1]] << 27;
      bdata2[i] |= v[2 - a[0]] << 54;
    }
    return Sudoku(bdata2);
  }

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdx, 0x110(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x7ffffff, 0x40(%rsp)  # imm = 0x7FFFFFF
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, %rdx
shrq $0x25, %rdx
shlq $0x1b, %rax
orq %rdx, %rax
shlq $0x1b, %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, %rdx
shrq $0xa, %rdx
shlq $0x36, %rax
orq %rdx, %rax
shlq $0x36, %rcx
movq %rcx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x9, 0x1c(%rsp)
jge 0x3605
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rdx
shlq $0x4, %rdx
movq 0x60(%rax,%rdx), %rcx
movq 0x68(%rax,%rdx), %rdx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
andq %rdi, %rcx
andq %rsi, %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
movq 0x60(%rax,%rcx), %rsi
movq 0x68(%rax,%rcx), %rdx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdi
andq %rdi, %rdx
andq %rcx, %rsi
shrq $0x1b, %rsi
movq %rdx, %rcx
shlq $0x25, %rcx
orq %rsi, %rcx
shrq $0x1b, %rdx
movq %rdx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
movq 0x60(%rax,%rcx), %rdx
movq 0x68(%rax,%rcx), %rcx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rsi
andq %rsi, %rcx
andq %rax, %rdx
shrq $0x36, %rdx
movq %rcx, %rax
shlq $0xa, %rax
orq %rdx, %rax
shrq $0x36, %rcx
movq %rcx, 0x78(%rsp)
movq %rax, 0x70(%rsp)
movq 0x110(%rsp), %rax
movl 0x8(%rax), %edx
movl $0x2, %eax
movl %eax, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movq 0x50(%rsp,%rcx), %rdx
movq 0x58(%rsp,%rcx), %rsi
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
movq %rsi, 0x88(%rsp,%rcx)
movq %rdx, 0x80(%rsp,%rcx)
movq 0x110(%rsp), %rcx
movl 0x4(%rcx), %edx
movl %eax, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movq 0x50(%rsp,%rcx), %rdi
movq 0x58(%rsp,%rcx), %r8
movq %rdi, %rcx
shrq $0x25, %rcx
shlq $0x1b, %r8
orq %rcx, %r8
shlq $0x1b, %rdi
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
movq 0x80(%rsp,%rcx), %rsi
movq 0x88(%rsp,%rcx), %rdx
orq %r8, %rdx
orq %rdi, %rsi
movq %rsi, 0x80(%rsp,%rcx)
movq %rdx, 0x88(%rsp,%rcx)
movq 0x110(%rsp), %rcx
movl (%rcx), %ecx
subl %ecx, %eax
cltq
shlq $0x4, %rax
movq 0x50(%rsp,%rax), %rsi
movq 0x58(%rsp,%rax), %rdi
movq %rsi, %rax
shrq $0xa, %rax
shlq $0x36, %rdi
orq %rax, %rdi
shlq $0x36, %rsi
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x80(%rsp,%rax), %rdx
movq 0x88(%rsp,%rax), %rcx
orq %rdi, %rcx
orq %rsi, %rdx
movq %rdx, 0x80(%rsp,%rax)
movq %rcx, 0x88(%rsp,%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x343e
movq (%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3f20
movq 0x8(%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
retq
nopw %cs:(%rax,%rax)
nopl (%rax)