// File: /workspace/github_c_makefile_star2_O1/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 0x39fcd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x39e82
testb %al, %al
jne 0x39fcd
leaq 0xd90b7(%rip), %rdx     # 0x11306b
leaq 0xd90d9(%rip), %rcx     # 0x113094
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0xfc3d
movq %rbx, %rdi
callq 0x3a285
movq %rax, %r14
movzbl %bpl, %ecx
movzbl (%r15), %eax
leaq 0x120359(%rip), %rdx    # 0x15a340
cmpb $0x1, (%rax,%rdx)
jne 0x3a012
cmpl $0x15, %eax
jne 0x39ff9
testb $0x1, 0x7(%r15)
jne 0x3a012
cmpq %r15, 0x150(%rbx)
je 0x3a012
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9b866
jmp 0x3a029
leaq 0x120367(%rip), %r9     # 0x15a380
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 0x3a040
movq %rbx, %rdi
jmp 0x3a055
incq %rdx
movq %rbx, %rdi
callq 0xae0f
movq 0x20(%r14), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a419
movq %rax, %r15
movq 0x870(%rbx), %r12
testq %r12, %r12
je 0x3a07a
movq 0x18(%r12), %rax
movq %rax, 0x870(%rbx)
jmp 0x3a132
cmpq $0x0, 0x838(%rbx)
jne 0x3a0c0
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%rbx)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x3a09e
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%rbx), %r12
movq 0x18(%r12), %rax
movq %rax, 0x838(%rbx)
movl $0x0, 0x8(%r12)
movq 0x8c8(%rbx), %rax
subq $-0x80, %rax
cmpq $0x10001, %rax          # imm = 0x10001
jb 0x3a110
movl $0x10000, %edi          # imm = 0x10000
callq 0x9480
movq %rax, 0x8d0(%rbx)
movq $0x0, 0x8c8(%rbx)
movl $0x80, %eax
movq 0x8d0(%rbx), %rcx
addq 0x8c8(%rbx), %rcx
movq %rax, 0x8c8(%rbx)
movq %rcx, (%r12)
movl $0x7, 0x8(%r12)
movl $0x80, %eax
movq %rax, 0x10(%r12)
movq (%r12), %rcx
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