// File: /workspace/github_c_makefile_star2_O0/ieyasu[P]funit/parse_test_file.c
// Function: parse_fortran
static struct Code *parse_fortran(struct ParseState *ps, int *need_array_it)
{
    struct Code *code = NEW0(struct Code);
    char *start = ps->read_pos, *tok, *save_pos;
    enum MacroType mtype;
    size_t len;

    code->type = FORTRAN_CODE;
    code->lineno = ps->lineno;

    // read lines until a recognized end sequence appears
    while (ps->read_pos < ps->file_end) {
        // look for end sequence
        save_pos = ps->read_pos;
        tok = next_token(ps, &len);
        assert(tok != NULL);
        if (is_test_token(tok, len) ||
            (same_token("end", 3, tok, len) && next_is_test_end_token(ps))) {
            break;
        } else if (ps->read_pos == ps->file_end) {
            break;
        } else { // not found, this is fortran
            ps->read_pos = save_pos;
        }

        if (find_macro(ps, &mtype, need_array_it)) {
            //  record initial fortran code
            code->u.c.str = start;
            code->u.c.len = ps->read_pos - start;
            // parse the macro
            ps->read_pos = ps->next_pos;
            code->next = parse_macro(ps, mtype, need_array_it);
            // parse_macro recurses to parse more code, so just return here
            if (!code->next)
                goto error;
            return code;
        } else {
            next_line(ps);
        }
    }
    if (ps->line_pos < ps->file_end) { // found non-fortran code
        // record bounds of fortran code
        code->u.c.str = start;
        code->u.c.len = ps->line_pos - start;
        ps->next_pos = ps->read_pos = ps->line_pos;
        return code;
    }
    syntax_error(ps);
 error:
    free_code(code);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x2180
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x7d65
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7060
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x7c56
jmp 0x7c75
leaq 0x4590(%rip), %rdi      # 0xc1ed
leaq 0x443b(%rip), %rsi      # 0xc09f
movl $0x20a, %edx            # imm = 0x20A
leaq 0x4688(%rip), %rcx      # 0xc2f8
callq 0x2120
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x8200
cmpl $0x0, %eax
jne 0x7cb3
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rcx
leaq 0x41f6(%rip), %rdi      # 0xbe8c
movl $0x3, %esi
callq 0x7090
cmpl $0x0, %eax
je 0x7cb8
movq -0x10(%rbp), %rdi
callq 0x8300
cmpl $0x0, %eax
je 0x7cb8
jmp 0x7d65
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jne 0x7ccf
jmp 0x7d65
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x7cdd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x3c(%rbp), %rsi
callq 0x8400
cmpq $0x0, %rax
je 0x7d57
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x28(%rbp), %rax
subq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x8810
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7d4d
jmp 0x7dc5
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7dd6
movq -0x10(%rbp), %rdi
callq 0x66b0
jmp 0x7c1a
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x7dbc
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x28(%rbp), %rax
subq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7dd6
movq -0x10(%rbp), %rdi
callq 0x6680
movq -0x20(%rbp), %rdi
callq 0x7630
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq