// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: op_read_s
static goto_t op_read_s(s7_scheme *sc)
                {
                    /* another lint opt */
                    s7_pointer port, code;

                    code = sc->code;
                    port = lookup(sc, cadr(code));

                    if (!is_input_port(port)) /* was also not stdin */
                    {
                        sc->value = g_read(sc, list_1(sc, port));
                        return(goto_start);
                    }
                    /* I guess this port_is_closed check is needed because we're going down a level below */
                    if (port_is_closed(port))
                        simple_wrong_type_argument_with_type(sc, sc->read_symbol, port, an_open_port_string);

                    if (is_function_port(port))
                        sc->value = (*(port_input_function(port)))(sc, S7_READ, port);
                    else
                    {
                        if ((is_string_port(port)) &&
                                (port_data_size(port) <= port_position(port)))
                            sc->value = eof_object;
                        else
                        {
                            push_input_port(sc, port);
                            push_stack_op(sc, OP_READ_DONE); /* this stops the internal read process so we only get one form */
                            sc->tok = token(sc);
                            switch (sc->tok)
                            {
                                case TOKEN_EOF:	    return(goto_start);
                                case TOKEN_RIGHT_PAREN: read_error(sc, "unexpected close paren");
                                case TOKEN_COMMA:	    read_error(sc, "unexpected comma");
                                default:
                                                        sc->value = read_expression(sc);
                                                        sc->current_line = port_line_number(sc->input_port);  /* this info is used to track down missing close parens */
                                                        sc->current_file = port_filename(sc->input_port);
                            }
                        }
                    }
                    /* equally read-done and read-list here */
                    return(goto_start);
                }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0xde990
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x11d2d9
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x11d25c
movq 0x48(%rsp), %rdi
callq 0xc670
movq 0x48(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
callq 0x6d9f0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x11d48d
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x2(%rax)
je 0x11d31a
movq 0x48(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x1460(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rax
movq 0x140(%rax), %rcx
movq 0x104b6b(%rip), %r8     # 0x221e80
callq 0x14a60
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x2, 0x4(%rax)
jne 0x11d355
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rax), %rax
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rdx
xorl %esi, %esi
callq *%rax
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x11d485
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x11d38d
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jg 0x11d38d
movq 0xf8f11(%rip), %rcx     # 0x216290
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x11d483
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x16310
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1dc, %ecx            # imm = 0x1DC
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x48(%rsp), %rdi
callq 0xc9560
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x30(%rax)
movq 0x48(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x11d3fb
jmp 0x11d3e5
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x11d408
jmp 0x11d3f0
movl 0xc(%rsp), %eax
subl $0x8, %eax
je 0x11d419
jmp 0x11d42a
movl $0x0, 0x54(%rsp)
jmp 0x11d48d
movq 0x48(%rsp), %rdi
leaq 0xd240c(%rip), %rsi     # 0x1ef820
callq 0xdfe00
movq 0x48(%rsp), %rdi
leaq 0xd2412(%rip), %rsi     # 0x1ef837
callq 0xdfe00
movq 0x48(%rsp), %rdi
callq 0x159340
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x48(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %eax
movl %eax, %ecx
movq 0x48(%rsp), %rax
movq %rcx, 0x690(%rax)
movq 0x48(%rsp), %rax
movq 0x170(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x6a8(%rax)
jmp 0x11d483
jmp 0x11d485
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)