// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: s7_object_to_string
s7_pointer s7_object_to_string(s7_scheme *sc, s7_pointer obj, bool use_write) /* unavoidable backwards compatibility rigidity here */
    {
        s7_pointer strport, res;

        if ((sc->safety > NO_SAFETY) &&
                (!s7_is_valid(sc, obj)))
            s7_warn(sc, 256, "bad arg to %s: %p\n", __func__, obj);

        strport = open_format_port(sc);
        object_out(sc, obj, strport, (use_write) ? P_WRITE : P_DISPLAY);

        if (port_position(strport) >= port_data_size(strport))
            res = block_to_string(sc, reallocate(sc, port_data_block(strport), port_position(strport) + 1), port_position(strport));
        else res = block_to_string(sc, port_data_block(strport), port_position(strport));
        restore_format_port(sc, strport);
        return(res);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
cmpq $0x0, 0x6a0(%rdi)
jle 0x37a95
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3794a
testb %al, %al
jne 0x37a95
leaq 0xd26ff(%rip), %rdx     # 0x10a17b
leaq 0xd2721(%rip), %rcx     # 0x10a1a4
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0xeea2
movq %rbx, %rdi
callq 0x37d3b
movq %rax, %r14
movzbl %bpl, %ecx
movzbl (%r15), %eax
leaq 0x11a891(%rip), %rdx    # 0x152340
cmpb $0x1, (%rax,%rdx)
jne 0x37ada
cmpl $0x15, %eax
jne 0x37ac1
testb $0x1, 0x7(%r15)
jne 0x37ada
cmpq %r15, 0x150(%rbx)
je 0x37ada
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x95196
jmp 0x37af1
leaq 0x11a89f(%rip), %r9     # 0x152380
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %r8d, %r8d
callq *(%r9,%rax,8)
movq 0x8(%r14), %rax
movq 0x20(%r14), %rdx
movq 0x38(%rax), %rsi
cmpq 0x18(%r14), %rdx
jge 0x37b08
movq %rbx, %rdi
jmp 0x37b1d
incq %rdx
movq %rbx, %rdi
callq 0x9fd6
movq 0x20(%r14), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x37ebe
movq %rax, %r15
movq 0x870(%rbx), %r12
testq %r12, %r12
je 0x37b46
movq 0x18(%r12), %rax
movq %rax, 0x870(%rbx)
movq (%r12), %rcx
jmp 0x37bec
movq 0x838(%rbx), %r12
testq %r12, %r12
jne 0x37b91
movl $0x2800, %edi           # imm = 0x2800
callq 0x8480
movq %rax, %r12
movq %rax, 0x838(%rbx)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x37b6f
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x18(%r12), %rax
movq %rax, 0x838(%rbx)
movq 0x8c8(%rbx), %rcx
leaq 0x80(%rcx), %rdx
cmpq $0x10000, %rdx          # imm = 0x10000
jbe 0x37bce
movl $0x10000, %edi          # imm = 0x10000
callq 0x8480
movq %rax, 0x8d0(%rbx)
movl $0x80, %edx
xorl %ecx, %ecx
jmp 0x37bd5
movq 0x8d0(%rbx), %rax
addq %rax, %rcx
movq %rdx, 0x8c8(%rbx)
movq %rcx, (%r12)
movl $0x7, 0x8(%r12)
movl $0x80, %eax
movq %rax, 0x10(%r12)
movq %rcx, 0x10(%r14)
movq 0x8(%r14), %rcx
movq %r12, 0x38(%rcx)
movq 0x10(%r14), %rcx
xorl %edx, %edx
movb %dl, (%rcx)
movq $0x0, 0x20(%r14)
movq %rax, 0x18(%r14)
movq 0x8(%r14), %rax
movb %dl, (%rax)
movq 0x7e8(%rbx), %rax
movq 0x28(%r14), %rcx
movq %rax, 0x18(%rcx)
movq %r14, 0x7e8(%rbx)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq