// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/race/parsing.cc
// Function: grid_t::dump(std::ostream&, bool) const
void grid_t::dump(ostream &os, bool postscript) const {
    if( postscript ) ps::header(os, rows_, cols_);

    for( size_t y = 0; y < (size_t)rows_; ++y ) {
        for( size_t x = 0; x < (size_t)cols_; ++x ) {
            switch( map_[y*cols_ + x] ) {
                case Valid:
                    if( postscript )
                        ps::draw_filled_rectangle(os, x*BOXW, (rows_-1-y)*BOXW, BOXW, BOXW, 255, 255, 255);
                    else
                        os << '.';
                    break;
                case (Valid | Start):
                    if( postscript )
                        ps::draw_filled_rectangle(os, x*BOXW, (rows_-1-y)*BOXW, BOXW, BOXW, 0, 255, 255);
                    else
                        os << 's';
                    break;
                case (Valid | Goal):
                    if( postscript )
                        ps::draw_filled_rectangle(os, x*BOXW, (rows_-1-y)*BOXW, BOXW, BOXW, 255, 0, 0);
                    else
                        os << 'g';
                    break;
                default:
                    if( !postscript ) os << 'x';
                    break;
            }

#if 0
            if( postscript ) {
                // draw outer thick frame
                if( map_[y*cols_+x] & Valid ) {
                    if( (c == 0) || !(gridMap[r*cols + c - 1] & VALID) ) psDrawThickLine(x,(rows-1)*BOXW-y,0,BOXW);
                    if( c == cols - 1 ) psDrawThickLine(x+BOXW,(rows-1)*BOXW-y,0,BOXW);
                    if( (r == 0) || !(gridMap[(r-1)*cols + c] & VALID) ) psDrawThickLine(x-0.5,(rows-1)*BOXW-y+BOXW,BOXW+1,0);
                    if( r == rows - 1 ) psDrawThickLine(x-0.5,(rows-1)*BOXW-y,BOXW+1,0);
                } else {
                    if( (c != 0) && (gridMap[r*cols + c - 1] & VALID) ) psDrawThickLine(x,(rows-1)*BOXW-y,0,BOXW);
                    if( (r != 0) && (gridMap[(r-1)*cols + c] & VALID) ) psDrawThickLine(x-0.5,(rows-1)*BOXW-y+BOXW,BOXW+1,0);
                }
            }
#endif
        }
        if( !postscript ) os << endl;
    }

    if( postscript ) {
        ps::trailer(os);
    } else {
        os << "Valid positions = { ";
        for( size_t x = 0; x < (size_t)cols_; ++x ) {
            for( size_t y = 0; y < (size_t)rows_; ++y )
                if( valid_pos(x, y) ) os << "(" << x << "," << y << ") ";
        }
        os << "}" << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
testl %edx, %edx
je 0x25c76
movslq 0x10(%r14), %rsi
movslq 0x14(%r14), %rdx
movq 0x10(%rsp), %rdi
callq 0x25100
cmpl $0x0, 0x10(%r14)
je 0x25e07
xorl %r13d, %r13d
movslq 0x14(%r14), %rax
testq %rax, %rax
je 0x25dc6
movl %r13d, %r15d
notl %r15d
xorl %r12d, %r12d
xorl %ebx, %ebx
imulq %r13, %rax
addq 0x8(%r14), %rax
movzbl (%rbx,%rax), %eax
cmpl $0x5, %eax
je 0x25d19
cmpl $0x3, %eax
je 0x25ceb
cmpl $0x1, %eax
jne 0x25d52
testb %bpl, %bpl
je 0x25d99
movl 0x10(%r14), %eax
addl %r15d, %eax
addl %eax, %eax
leal (%rax,%rax,4), %edx
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl $0xa, %ecx
movl $0xa, %r8d
movl $0xff, %r9d
jmp 0x25d12
testb %bpl, %bpl
je 0x25d6d
movl 0x10(%r14), %eax
addl %r15d, %eax
addl %eax, %eax
leal (%rax,%rax,4), %edx
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl $0xa, %ecx
movl $0xa, %r8d
xorl %r9d, %r9d
movl $0xff, %eax
jmp 0x25d45
testb %bpl, %bpl
je 0x25d83
movl 0x10(%r14), %eax
addl %r15d, %eax
addl %eax, %eax
leal (%rax,%rax,4), %edx
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl $0xa, %ecx
movl $0xa, %r8d
movl $0xff, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0x25401
addq $0x10, %rsp
jmp 0x25db2
testb %bpl, %bpl
jne 0x25db2
movb $0x78, 0xf(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rsi
jmp 0x25dad
movb $0x73, 0xd(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xd(%rsp), %rsi
jmp 0x25dad
movb $0x67, 0xe(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rsi
jmp 0x25dad
movb $0x2e, 0xc(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x52d0
incq %rbx
movslq 0x14(%r14), %rax
addl $0xa, %r12d
cmpq %rax, %rbx
jb 0x25c9c
testb %bpl, %bpl
jne 0x25df7
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51b0
incq %r13
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jb 0x25c84
testb %bpl, %bpl
je 0x25e1b
movq 0x10(%rsp), %rdi
callq 0x253c4
jmp 0x25f45
leaq 0x5046(%rip), %rsi      # 0x2ae68
movl $0x14, %edx
movq 0x10(%rsp), %rdi
callq 0x52d0
movl 0x14(%r14), %edx
testl %edx, %edx
je 0x25f05
movl 0x10(%r14), %eax
xorl %r15d, %r15d
leaq 0x5032(%rip), %rbp      # 0x2ae7d
movl %eax, %ecx
movq 0x10(%rsp), %rbx
testl %ecx, %ecx
je 0x25ef4
xorl %r12d, %r12d
testl %r15d, %r15d
js 0x25edb
testl %r12d, %r12d
js 0x25edb
cmpl %r15d, %ecx
jle 0x25edb
movl 0x14(%r14), %ecx
cmpl %r12d, %ecx
jle 0x25edb
movq 0x8(%r14), %rdx
imull %r15d, %ecx
addl %r12d, %ecx
testb $0x1, (%rdx,%rcx)
je 0x25edb
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x1fd2(%rip), %rsi      # 0x27e67
callq 0x52d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51a0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1db2(%rip), %rsi      # 0x27c69
callq 0x52d0
movq %r13, %rdi
movq %r12, %rsi
callq 0x51a0
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x52d0
movl 0x10(%r14), %eax
incq %r12
movslq %eax, %rdx
movl %eax, %ecx
cmpq %rdx, %r12
jb 0x25e5d
movl 0x14(%r14), %edx
movl %eax, %ecx
jmp 0x25ef6
xorl %ecx, %ecx
incq %r15
movslq %edx, %rsi
cmpq %rsi, %r15
jb 0x25e52
leaq 0x4f74(%rip), %rsi      # 0x2ae80
movl $0x1, %edx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x52d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq