// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: truncate_string
static char *truncate_string(char *form, s7_int len, use_write_t use_write)
                {
                    uint8_t *f;
                    f = (uint8_t *)form;

                    if (use_write != P_DISPLAY)
                    {
                        /* I guess we need to protect the outer double quotes in this case */
                        s7_int i;
                        for (i = len - 5; i >= (len / 2); i--)
                            if (is_white_space((int32_t)f[i]))
                            {
                                form[i] = '.'; form[i + 1] = '.'; form[i + 2] = '.'; form[i + 3] = '"'; form[i + 4] = '\0';
                                return(form);
                            }
                        i = len - 5;
                        if (i > 0)
                        {
                            form[i] = '.'; form[i + 1] = '.'; form[i + 2] = '.'; form[i + 3] = '"'; form[i + 4] = '\0';
                        }
                        else
                        {
                            if (len >= 2)
                            {
                                form[len - 1] = '"'; form[len] = '\0';
                            }
                        }
                    }
                    else
                    {
                        s7_int i;
                        for (i = len - 4; i >= (len / 2); i--)
                            if (is_white_space((int32_t)f[i]))
                            {
                                form[i] = '.'; form[i + 1] = '.'; form[i + 2] = '.'; form[i + 3] = '\0';
                                return(form);
                            }
                        i = len - 4;
                        if (i >= 0)
                        {
                            form[i] = '.'; form[i + 1] = '.'; form[i + 2] = '.'; form[i + 3] = '\0';
                        }
                        else form[len] = '\0';
                    }
                    return(form);
                }

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movl %edx, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x28(%rsp)
cmpl $0x0, -0x1c(%rsp)
je 0xde818
movq -0x18(%rsp), %rax
subq $0x5, %rax
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x40(%rsp)
movq -0x18(%rsp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x40(%rsp), %rax
cmpq %rcx, %rax
jl 0xde787
movq 0x143716(%rip), %rax    # 0x221e18
movq -0x28(%rsp), %rcx
movq -0x30(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
testb $0x1, (%rax,%rcx)
je 0xde772
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, 0x1(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, 0x2(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x22, 0x3(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x0, 0x4(%rax,%rcx)
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0xde936
jmp 0xde774
movq -0x30(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rsp)
jmp 0xde6d1
movq -0x18(%rsp), %rax
subq $0x5, %rax
movq %rax, -0x30(%rsp)
cmpq $0x0, -0x30(%rsp)
jle 0xde7e9
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, 0x1(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x2e, 0x2(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x22, 0x3(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movb $0x0, 0x4(%rax,%rcx)
jmp 0xde813
cmpq $0x2, -0x18(%rsp)
jl 0xde811
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
subq $0x1, %rcx
movb $0x22, (%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xde813
jmp 0xde92c
movq -0x18(%rsp), %rax
subq $0x4, %rax
movq %rax, -0x38(%rsp)
movq -0x38(%rsp), %rax
movq %rax, -0x48(%rsp)
movq -0x18(%rsp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x48(%rsp), %rax
cmpq %rcx, %rax
jl 0xde8c9
movq 0x1435c5(%rip), %rax    # 0x221e18
movq -0x28(%rsp), %rcx
movq -0x38(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
testb $0x1, (%rax,%rcx)
je 0xde8b4
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, 0x1(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, 0x2(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x0, 0x3(%rax,%rcx)
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0xde936
jmp 0xde8b6
movq -0x38(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rsp)
jmp 0xde826
movq -0x18(%rsp), %rax
subq $0x4, %rax
movq %rax, -0x38(%rsp)
cmpq $0x0, -0x38(%rsp)
jl 0xde91c
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, (%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, 0x1(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x2e, 0x2(%rax,%rcx)
movq -0x10(%rsp), %rax
movq -0x38(%rsp), %rcx
movb $0x0, 0x3(%rax,%rcx)
jmp 0xde92a
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xde92c
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax)