// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: string_read_line
static s7_pointer string_read_line(s7_scheme *sc, s7_pointer port, bool with_eol, bool copied)
    {
        s7_int i, port_start;
        uint8_t *port_str, *cur, *start;

        port_start = port_position(port);
        port_str = port_data(port);
        start = (uint8_t *)(port_str + port_start);

        cur = (uint8_t *)strchr((const char *)start, (int)'\n'); /* this can run off the end making valgrind unhappy, but I think it's innocuous */
        if (cur)
        {
            port_line_number(port)++;
            i = cur - port_str;
            port_position(port) = i + 1;
            if (copied)
                return(make_string_with_length(sc, (const char *)start, ((with_eol) ? i + 1 : i) - port_start));
            return(wrap_string(sc, (char *)start, ((with_eol) ? i + 1 : i) - port_start));
        }
        i = port_data_size(port);
        port_position(port) = i;
        if (i <= port_start)         /* the < part can happen -- if not caught we try to create a string of length - 1 -> segfault */
            return(eof_object);

        if (copied)
            return(make_string_with_length(sc, (const char *)start, i - port_start));
        return(wrap_string(sc, (char *)start, i - port_start));
    }

// Assembly:
subq $0x78, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
andb $0x1, %cl
movb %cl, 0x5f(%rsp)
andb $0x1, %al
movb %al, 0x5e(%rsp)
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movl $0xa, %esi
callq 0x91d0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0xc93b1
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rcx
addq $0x1, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
testb $0x1, 0x5e(%rsp)
je 0xc935f
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
testb $0x1, 0x5f(%rsp)
je 0xc9332
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xc933c
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
subq 0x48(%rsp), %rdx
callq 0x144d0
movq %rax, 0x70(%rsp)
jmp 0xc942c
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
testb $0x1, 0x5f(%rsp)
je 0xc9389
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0xc9392
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq (%rsp), %rdx
subq 0x48(%rsp), %rdx
callq 0xb880
movq %rax, 0x70(%rsp)
jmp 0xc942c
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x50(%rsp), %rax
cmpq 0x48(%rsp), %rax
jg 0xc93e7
movq 0x14ceb0(%rip), %rax    # 0x216290
movq %rax, 0x70(%rsp)
jmp 0xc942c
testb $0x1, 0x5e(%rsp)
je 0xc940e
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x50(%rsp), %rdx
subq 0x48(%rsp), %rdx
callq 0x144d0
movq %rax, 0x70(%rsp)
jmp 0xc942c
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x50(%rsp), %rdx
subq 0x48(%rsp), %rdx
callq 0xb880
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)