// File: /workspace/github_cpp_makefile_star2_O3/grogers0[P]dots_and_boxes/InputOutput.cpp
// Function: Board::read_vert_edges(int, _IO_FILE*)
void Board::read_vert_edges(int y, FILE *fp)
{
    int c, x = 0;
    bool reading_cell = false;

    while ((c = fgetc(fp)) != EOF) {
        switch (c) {
            case '\r':
                break;
            case '\n':
                if (x != width + 1) {
                    fprintf(stderr, "x (%d) != width + 1 (%d) at '\\n', vert edges, y = %d\n",
                            x, width + 1, y);
                    exit(1);
                }
                return;
            case '|':
                if (x > width) {
                    fprintf(stderr, "x (%d) > width (%d) at '|', vert edges, y = %d\n",
                            x, width, y);
                    exit(1);
                }
                edges[edge_index(Edge(VERT, x, y))] = true;
                ++x;
                break;
            case ' ':
                if (x > width) {
                    fprintf(stderr, "x (%d) > width (%d) at ' ', vert edges, y = %d\n",
                            x, width, y);
                    exit(1);
                }

                if (!reading_cell) {
                    edges[edge_index(Edge(VERT, x, y))] = false;
                    ++x;
                }
                break;
            case '#':
                break;
            default:
                fprintf(stderr, "unexpected character %d reading board, vert edges, y = %d\n",
                        c, y);
                exit(1);
        }

        reading_cell = !reading_cell;
    }

    if (c == EOF)
        exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %r14
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movl %esi, 0x4(%rsp)
movsbl %sil, %r13d
xorl %ebp, %ebp
leaq 0x3f(%rax), %rbx
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x2300
cmpl $0x1f, %eax
jg 0x35fb
cmpl $0xd, %eax
je 0x36ec
jmp 0x36f5
cmpl $0x20, %eax
je 0x367b
cmpl $0x23, %eax
je 0x36ec
cmpl $0x7c, %eax
jne 0x371e
movl (%r14), %ecx
cmpl %ecx, %ebp
jg 0x3729
movl 0x4(%r14), %eax
incl %eax
imull %ecx, %eax
incl %ecx
imull %r13d, %ecx
movl %ebp, %edx
shll $0x19, %edx
sarl $0x19, %edx
addl %ecx, %edx
leal (%rdx,%rax), %ecx
movslq %ecx, %rcx
addl %edx, %eax
addl $0x3f, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0x10(%r14), %rax
movq %rcx, %rdx
andq %rbx, %rdx
xorl %esi, %esi
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
jmp 0x36ea
movl (%r14), %ecx
cmpl %ecx, %ebp
jg 0x373c
testb $0x1, %r12b
jne 0x36ec
movl 0x4(%r14), %eax
incl %eax
imull %ecx, %eax
incl %ecx
imull %r13d, %ecx
movl %ebp, %edx
shll $0x19, %edx
sarl $0x19, %edx
addl %ecx, %edx
leal (%rdx,%rax), %ecx
movslq %ecx, %rcx
addl %edx, %eax
addl $0x3f, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0x10(%r14), %rax
movq %rcx, %rdx
andq %rbx, %rdx
xorl %esi, %esi
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rdx
setbe %sil
movq $-0x2, %rdx
rolq %cl, %rdx
andq %rdx, -0x8(%rax,%rsi,8)
incl %ebp
xorb $0x1, %r12b
jmp 0x35e0
cmpl $0xa, %eax
jne 0x3712
movl (%r14), %ecx
incl %ecx
cmpl %ecx, %ebp
jne 0x3765
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x371e
xorl %edi, %edi
callq 0x2240
movl %eax, %edi
movl 0x4(%rsp), %esi
callq 0x249a
movq 0x48a8(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1b14(%rip), %rsi      # 0x524e
jmp 0x374d
movq 0x4895(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1b31(%rip), %rsi      # 0x527e
movl %ebp, %edx
movl 0x4(%rsp), %r8d
xorl %eax, %eax
callq 0x2280
movl $0x1, %edi
callq 0x2240
movq 0x486c(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1aa2(%rip), %rsi      # 0x5218
jmp 0x374d