// File: /workspace/github_cpp_makefile_star2_O2/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, %r12
movq %rdi, %r15
leaq 0x10(%rdi), %r13
movl %esi, 0x4(%rsp)
movl %esi, %eax
shll $0x8, %eax
movzwl %ax, %ebp
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x2300
cmpl $0xd, %eax
je 0x33a9
cmpl $0x20, %eax
je 0x3374
cmpl $0x23, %eax
je 0x33a9
cmpl $0x7c, %eax
jne 0x33b1
movl (%r15), %ecx
cmpl %ecx, %r14d
jg 0x33db
leal (%r14,%r14), %eax
movzbl %al, %esi
orl %ebp, %esi
orl $0x1, %esi
movq %r15, %rdi
callq 0x2b26
movslq %eax, %rsi
movq %r13, %rdi
callq 0x2b08
orq %rdx, (%rax)
jmp 0x33a6
movl (%r15), %ecx
cmpl %ecx, %r14d
jg 0x33ee
testb $0x1, %bl
jne 0x33a9
leal (%r14,%r14), %eax
movzbl %al, %esi
orl %ebp, %esi
orl $0x1, %esi
movq %r15, %rdi
callq 0x2b26
movslq %eax, %rsi
movq %r13, %rdi
callq 0x2b08
notq %rdx
andq %rdx, (%rax)
incl %r14d
xorb $0x1, %bl
jmp 0x3328
cmpl $0xa, %eax
jne 0x33cf
movl (%r15), %ecx
incl %ecx
cmpl %ecx, %r14d
jne 0x3436
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x3410
xorl %edi, %edi
callq 0x2250
movq 0x4bf6(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1e62(%rip), %rsi      # 0x524e
jmp 0x33ff
movq 0x4be3(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1e7f(%rip), %rsi      # 0x527e
movl %r14d, %edx
movl 0x4(%rsp), %r8d
xorl %eax, %eax
callq 0x2290
jmp 0x342e
movq 0x4bc1(%rip), %rcx      # 0x7fd8
movq (%rcx), %rdi
leaq 0x1e8d(%rip), %rsi      # 0x52ae
movl %eax, %edx
movl 0x4(%rsp), %ecx
xorl %eax, %eax
callq 0x2290
pushq $0x1
popq %rdi
callq 0x2250
movq 0x4b9b(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1dd1(%rip), %rsi      # 0x5218
jmp 0x33ff