// File: /workspace/github_cpp_makefile_star2_O1/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 0x359b
cmpl $0xd, %eax
je 0x368a
jmp 0x3693
cmpl $0x20, %eax
je 0x361a
cmpl $0x23, %eax
je 0x368a
cmpl $0x7c, %eax
jne 0x36bc
movl (%r14), %ecx
cmpl %ecx, %ebp
jg 0x36c7
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
addl %eax, %edx
movslq %edx, %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
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 0x3688
movl (%r14), %ecx
cmpl %ecx, %ebp
jg 0x36da
testb $0x1, %r12b
jne 0x368a
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
addl %eax, %edx
movslq %edx, %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
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 0x3580
cmpl $0xa, %eax
jne 0x36b0
movl (%r14), %ecx
incl %ecx
cmpl %ecx, %ebp
jne 0x3703
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x36bc
xorl %edi, %edi
callq 0x2240
movl %eax, %edi
movl 0x4(%rsp), %esi
callq 0x249a
movq 0x490a(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1b76(%rip), %rsi      # 0x524e
jmp 0x36eb
movq 0x48f7(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1b93(%rip), %rsi      # 0x527e
movl %ebp, %edx
movl 0x4(%rsp), %r8d
xorl %eax, %eax
callq 0x2280
movl $0x1, %edi
callq 0x2240
movq 0x48ce(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x1b04(%rip), %rsi      # 0x5218
jmp 0x36eb