// File: /workspace/github_cpp_makefile_star2_O3/yupyub[P]PathFinding_Visual/Dijkstra.cpp
// Function: Dijkstra::Dijkstra_Run(int, int)
int Dijkstra::Dijkstra_Run(int tset, int mnum){
    int g;
    vv = Init(tset,mnum);
    priority_queue<tuple<int,int,int,int> >pq;
    dist[sx][sy] = 0;
    vv.state[sx][sy] = 2;
    pq.push(make_tuple(0,sx,sy,-1));
    int x,y,dir,nx,ny,itr = 0;
    while(!pq.empty()){
        x = get<1>(pq.top());
        y = get<2>(pq.top());
        dir = get<3>(pq.top());
        pq.pop();
        itr++;
        vv.state[x][y] = 3;
        if(vv.map[x][y] == 3) break;
        for(int i = 0;i<4;i++){
            if(i == dir) continue;
            nx = x+dx[i];
            ny = y+dy[i];
            if(nx<0||ny<0||nx>=vv.N||ny>=vv.M) continue;
            if(vv.map[nx][ny] != 1 && dist[nx][ny] > dist[x][y] + 1 && vv.state[nx][ny] < 2){
                dist[nx][ny] = dist[x][y] + 1;
                pq.push(make_tuple(-dist[nx][ny],nx,ny,(i+2)%4));
            }
        }
        vv.draw();
        vv.state[x][y] = 2;
        printf("Total Iteration : %d / inqueue : %d\n",itr,(int)pq.size());
        usleep(timeSet);
    }
    if(dist[ex][ey] != INF){
        sol_path(ex,ey);
        vv.draw();
        printf("Total Iteration : %d / Path Distance : %d\n",itr,dist[ex][ey]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4e238, %rsp          # imm = 0x4E238
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14ac
movl $0x4e208, %edx          # imm = 0x4E208
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movslq 0x75308(%rbx), %rax
movslq 0x7530c(%rbx), %rcx
imulq $0x320, %rax, %rax      # imm = 0x320
addq %rbx, %rax
addq $0x4e208, %rax          # imm = 0x4E208
xorl %edx, %edx
movl %edx, (%rax,%rcx,4)
movslq 0x75308(%rbx), %rax
movslq 0x7530c(%rbx), %rcx
imulq $0x320, %rax, %rax      # imm = 0x320
addq %rbx, %rax
addq $0x27100, %rax          # imm = 0x27100
movl $0x2, (%rax,%rcx,4)
leaq 0x18(%rsp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
movq 0x75308(%rbx), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x4(%rsi)
movl %edx, 0xc(%rsi)
leaq 0x30(%rsp), %rdi
callq 0x18f2
leaq 0x4e208(%rbx), %rax
movq %rax, (%rsp)
leaq 0x27100(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x187e
movslq 0x8(%rax), %r12
movslq 0x4(%rax), %r14
movl (%rax), %r15d
leaq 0x30(%rsp), %rdi
callq 0x192e
incl %ebp
imulq $0x320, %r12, %rax      # imm = 0x320
movq 0x10(%rsp), %rcx
addq %rax, %rcx
movl $0x3, (%rcx,%r14,4)
leaq (%rbx,%rax), %rdx
cmpl $0x3, (%rdx,%r14,4)
je 0x187e
movl %ebp, 0xc(%rsp)
leaq (%rcx,%r14,4), %rcx
movq %rcx, 0x28(%rsp)
addq (%rsp), %rax
leaq (%rax,%r14,4), %r13
xorl %ebp, %ebp
cmpq %rbp, %r15
jne 0x17a9
incq %rbp
cmpq $0x4, %rbp
jne 0x1796
jmp 0x1839
movl 0x7531c(%rbx,%rbp,4), %eax
addl %r12d, %eax
js 0x179b
movl 0x7532c(%rbx,%rbp,4), %ecx
addl %r14d, %ecx
js 0x179b
cmpl 0x4e200(%rbx), %eax
jge 0x179b
cmpl 0x4e204(%rbx), %ecx
jge 0x179b
movl %eax, %edx
movl %ecx, %esi
imulq $0x320, %rdx, %rdi      # imm = 0x320
leaq (%rbx,%rdi), %rdx
cmpl $0x1, (%rdx,%rsi,4)
je 0x179b
movq (%rsp), %rdx
leaq (%rdx,%rdi), %r8
movl (%r13), %edx
leal 0x1(%rdx), %r9d
cmpl %r9d, (%r8,%rsi,4)
jle 0x179b
addq 0x10(%rsp), %rdi
cmpl $0x1, (%rdi,%rsi,4)
jg 0x179b
leaq (%r8,%rsi,4), %rsi
movl %r9d, (%rsi)
notl %edx
movl %ebp, %esi
xorl $0x2, %esi
movl %esi, 0x18(%rsp)
movl %ecx, 0x1c(%rsp)
movl %eax, 0x20(%rsp)
movl %edx, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x18f2
jmp 0x179b
movq %rbx, %rdi
callq 0x30d8
movl 0xc(%rsp), %ebp
movq 0x28(%rsp), %rax
movl $0x2, (%rax)
movq 0x38(%rsp), %rdx
subq 0x30(%rsp), %rdx
shrq $0x4, %rdx
leaq 0x296b(%rip), %rdi      # 0x41d0
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
movl 0x75318(%rbx), %edi
callq 0x1150
jmp 0x1732
movl 0x75310(%rbx), %esi
movl 0x75314(%rbx), %edx
movq %rbx, %rdi
callq 0x1592
movq %rbx, %rdi
callq 0x30d8
movslq 0x75310(%rbx), %rax
movslq 0x75314(%rbx), %rcx
imulq $0x320, %rax, %rax      # imm = 0x320
movq (%rsp), %rdx
addq %rax, %rdx
movl (%rdx,%rcx,4), %edx
leaq 0x2935(%rip), %rdi      # 0x41f5
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
jmp 0x18cf
jmp 0x18cf
jmp 0x18cf
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x18e9
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq %rbx, %rdi
callq 0x1180
nop