// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_port_position
static s7_pointer g_port_position(s7_scheme *sc, s7_pointer args)
    {
#define H_port_position "(port-position input-port) returns the current location (in bytes) in the port's data where the next read will take place."
#define Q_port_position s7_make_signature(sc, 2, sc->is_integer_symbol, sc->is_input_port_symbol)
        s7_pointer port;

        port = car(args);
        if (!(is_input_port(port)))
            return(simple_wrong_type_argument(sc, sc->port_position_symbol, port, T_INPUT_PORT));
        if (port_is_closed(port))
            return(s7_wrong_type_arg_error(sc, "port-position", 0, port, "an open input port"));
        if (is_string_port(port))
            return(make_integer(sc, port_position(port)));
#if (!MS_WINDOWS)
        if (is_file_port(port))
            return(make_integer(sc, ftell(port_file(port))));
#endif
        return(small_int(0));
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
je 0x6ac15
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x1400(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x58(%rsp), %rdx
movq 0x68(%rsp), %rax
movq 0x140(%rax), %rcx
movq 0x1afaa2(%rip), %r8     # 0x21a6a8
callq 0x14a60
movq %rax, 0x70(%rsp)
jmp 0x6ae13
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x2(%rax)
je 0x6ac4f
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x189370(%rip), %rsi    # 0x1f3fa5
xorl %eax, %eax
movl %eax, %edx
leaq 0x18897f(%rip), %r8     # 0x1f35bf
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x6ae13
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x6ad28
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x6ac98
movq 0x50(%rsp), %rcx
leaq 0x1ab7f3(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0x6ad0f
jmp 0x6ac9a
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x6acbe
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq $0xb, (%rax)
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x6ae13
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0x6ae07
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x93a0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x6ad7a
movq 0x30(%rsp), %rcx
leaq 0x1ab711(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x6adf1
jmp 0x6ad7c
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x6ada0
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq $0xb, (%rax)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x6ae13
movq 0x1ab672(%rip), %rax    # 0x216480
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax)