// File: SneachChea[P]Wolf-Monte-Carlo-Cpp/model.cpp
// Function: model::init()
void model::init(){
    int row;
    int column;
    int up, right, left, dn;
    for(unsigned int i =0;i<N;i++){
        row = int(i/L);
        column = i-row*L;
        site_dic[std::make_tuple(row, column)]= i;
        x_y_dic[i] = std::make_tuple(row, column);
    }
    for(unsigned int i = 0; i<N;i++){
        row = std::get<0>(x_y_dic[i]);
        column = std::get<1>(x_y_dic[i]);
        up = site_dic[std::make_tuple((row-1+L)%L, column)];
        right = site_dic[std::make_tuple(row, (column+1)%L)];
        dn = site_dic[std::make_tuple((row+1)%L, column)];
        left = site_dic[std::make_tuple(row, (column-1+L)%L)];
        nbr[i] = std::make_tuple(right, up, left,dn);
    }
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x94(%rsp)
movq 0x38(%rsp), %rcx
movl 0x94(%rsp), %eax
cmpl 0x4(%rcx), %eax
jae 0x9137
movq 0x38(%rsp), %rcx
movl 0x94(%rsp), %eax
xorl %edx, %edx
divl (%rcx)
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0xac(%rsp)
movl 0x94(%rsp), %ecx
movl 0xac(%rsp), %edx
imull (%rax), %edx
subl %edx, %ecx
movl %ecx, 0xa8(%rsp)
movl 0x94(%rsp), %ecx
movl %ecx, 0x34(%rsp)
addq $0x10, %rax
movq %rax, 0x28(%rsp)
leaq 0x8c(%rsp), %rdi
leaq 0xac(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x9530
movq 0x28(%rsp), %rdi
leaq 0x8c(%rsp), %rsi
callq 0x9440
movl 0x34(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x84(%rsp), %rdi
leaq 0xac(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x9530
movq 0x38(%rsp), %rdi
addq $0x40, %rdi
movl 0x94(%rsp), %eax
movl %eax, %esi
callq 0x9570
movq %rax, %rdi
leaq 0x84(%rsp), %rsi
callq 0x9590
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x9047
movl $0x0, 0x80(%rsp)
movq 0x38(%rsp), %rcx
movl 0x80(%rsp), %eax
cmpl 0x4(%rcx), %eax
jae 0x9353
movq 0x38(%rsp), %rdi
addq $0x40, %rdi
movl 0x80(%rsp), %eax
movl %eax, %esi
callq 0x9570
movq %rax, %rdi
callq 0x95d0
movq 0x38(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0xac(%rsp)
addq $0x40, %rdi
movl 0x80(%rsp), %eax
movl %eax, %esi
callq 0x9570
movq %rax, %rdi
callq 0x95e0
movq 0x38(%rsp), %rcx
movl (%rax), %eax
movl %eax, 0xa8(%rsp)
movq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movl 0xac(%rsp), %eax
subl $0x1, %eax
addl (%rcx), %eax
cltd
idivl (%rcx)
movl %edx, 0x74(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x74(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x95f0
movq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x9440
movq 0x38(%rsp), %rcx
movl (%rax), %eax
movl %eax, 0xa4(%rsp)
movq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x10(%rsp)
movl 0xa8(%rsp), %eax
addl $0x1, %eax
cltd
idivl (%rcx)
movl %edx, 0x68(%rsp)
leaq 0x6c(%rsp), %rdi
leaq 0xac(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x9630
movq 0x10(%rsp), %rdi
leaq 0x6c(%rsp), %rsi
callq 0x9440
movq 0x38(%rsp), %rcx
movl (%rax), %eax
movl %eax, 0xa0(%rsp)
movq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
movl 0xac(%rsp), %eax
addl $0x1, %eax
cltd
idivl (%rcx)
movl %edx, 0x5c(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x95f0
movq 0x18(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x9440
movq 0x38(%rsp), %rcx
movl (%rax), %eax
movl %eax, 0x98(%rsp)
movq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movl 0xa8(%rsp), %eax
subl $0x1, %eax
addl (%rcx), %eax
cltd
idivl (%rcx)
movl %edx, 0x50(%rsp)
leaq 0x54(%rsp), %rdi
leaq 0xac(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x9630
movq 0x20(%rsp), %rdi
leaq 0x54(%rsp), %rsi
callq 0x9440
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xa4(%rsp), %rdx
leaq 0x9c(%rsp), %rcx
leaq 0x98(%rsp), %r8
callq 0x9670
movq 0x38(%rsp), %rdi
addq $0x58, %rdi
movl 0x80(%rsp), %eax
movl %eax, %esi
callq 0x96c0
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x96e0
movl 0x80(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80(%rsp)
jmp 0x9142
addq $0xb8, %rsp
retq
nopl (%rax,%rax)