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

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdx, 0x120(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0x10(%rsp)
movabsq $0x3fffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFF
movq %rax, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x1ff00, 0x78(%rsp)    # imm = 0x1FF00
movq $0x0, 0x70(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x60(%rsp)
movq $0xff, 0x68(%rsp)
movabsq $0x7fc0000000000000, %rax # imm = 0x7FC0000000000000
movq %rax, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x9, 0x1c(%rsp)
jge 0x73b2
movq 0x10(%rsp), %rdx
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x60(%rdx,%rax), %rsi
movq 0x68(%rdx,%rax), %rcx
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rdi
andq %rdi, %rcx
andq %rax, %rsi
shrq $0x12, %rsi
movq %rcx, %rax
shlq $0x2e, %rax
orq %rsi, %rax
shrq $0x12, %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x60(%rdx,%rax), %rsi
movq 0x68(%rdx,%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rdi
andq %rdi, %rcx
andq %rax, %rsi
shrq $0x9, %rsi
movq %rcx, %rax
shlq $0x37, %rax
orq %rsi, %rax
shrq $0x9, %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
movq 0x60(%rdx,%rcx), %rax
movq 0x68(%rdx,%rcx), %rcx
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
andq %rdi, %rax
andq %rsi, %rcx
movq %rcx, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x60(%rdx,%rax), %rcx
movq 0x68(%rdx,%rax), %rdx
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
andq %rdi, %rcx
andq %rsi, %rdx
movq %rdx, 0x98(%rsp,%rax)
movq %rcx, 0x90(%rsp,%rax)
movq 0x120(%rsp), %rax
movslq (%rax), %rax
shlq $0x4, %rax
movq 0x20(%rsp,%rax), %rsi
movq 0x28(%rsp,%rax), %rdi
movq %rsi, %rax
shrq $0x2e, %rax
shlq $0x12, %rdi
orq %rax, %rdi
shlq $0x12, %rsi
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x90(%rsp,%rax), %rdx
movq 0x98(%rsp,%rax), %rcx
orq %rdi, %rcx
orq %rsi, %rdx
movq %rdx, 0x90(%rsp,%rax)
movq %rcx, 0x98(%rsp,%rax)
movq 0x120(%rsp), %rax
movslq 0x4(%rax), %rax
shlq $0x4, %rax
movq 0x20(%rsp,%rax), %rsi
movq 0x28(%rsp,%rax), %rdi
movq %rsi, %rax
shrq $0x37, %rax
shlq $0x9, %rdi
orq %rax, %rdi
shlq $0x9, %rsi
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x90(%rsp,%rax), %rdx
movq 0x98(%rsp,%rax), %rcx
orq %rdi, %rcx
orq %rsi, %rdx
movq %rdx, 0x90(%rsp,%rax)
movq %rcx, 0x98(%rsp,%rax)
movq 0x120(%rsp), %rax
movslq 0x8(%rax), %rax
shlq $0x4, %rax
movq 0x20(%rsp,%rax), %rdi
movq 0x28(%rsp,%rax), %rsi
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
movq 0x90(%rsp,%rax), %rcx
movq 0x98(%rsp,%rax), %rdx
orq %rdi, %rcx
orq %rsi, %rdx
movq %rdx, 0x98(%rsp,%rax)
movq %rcx, 0x90(%rsp,%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x71b0
movq (%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3f20
movq 0x8(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
retq