// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonglmath/src/mat.c
// Function: ToString_
static int ToString_(lua_State *L, mat_t m, size_t nr, size_t nc)
/* With snprintf because lua_pushfstring does not support the %g conversion specifier */
    {
#define SZ 512
#define space (SZ-p)
    char str[SZ];
    int p=0;
    size_t i;
    p += snprintf(str, space, "{");
    for(i=0; i < nr; i++)
        {
        switch(nc)
            {
            case 2: p+=snprintf(str+p, space, "{ "FMT", "FMT" }, ", 
                            m[i][0], m[i][1]); break;
            case 3: p+=snprintf(str+p, space, "{ "FMT", "FMT", "FMT" }, ",
                            m[i][0], m[i][1], m[i][2]); break;
            case 4: p+=snprintf(str+p, space, "{ "FMT", "FMT", "FMT", "FMT" }, ", 
                            m[i][0], m[i][1], m[i][2], m[i][3]); break;
            default:
                return luaL_error(L, UNEXPECTED_ERROR);
            }
        if(space<0)
            { 
            /* truncate */
            p = SZ - 5; 
            p+=snprintf(str+p, space, " ...");
            lua_pushlstring(L, str, p);
            return 1;
            }
        }
    p-=2; /* strip the last separator */
    p+=snprintf(str+p, space, "}");
    lua_pushlstring(L, str, p);
    return 1;
#undef space
#undef SZ
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
movw $0x7b, 0x10(%rsp)
incq %r15
pushq $0x1
popq %r13
leaq 0x66d6(%rip), %rbx      # 0x16620
movslq %r13d, %rbp
decq %r15
je 0x10035
cmpq $0x4, %r14
je 0xffc7
cmpq $0x3, %r14
je 0xff94
cmpq $0x2, %r14
jne 0x10081
leaq (%rsp,%rbp), %rdi
addq $0x10, %rdi
movl $0x200, %esi            # imm = 0x200
subl %ebp, %esi
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
movq %rbx, %rdx
movb $0x2, %al
callq 0x8420
jmp 0xffff
leaq (%rsp,%rbp), %rdi
addq $0x10, %rdi
movl $0x200, %esi            # imm = 0x200
subl %ebp, %esi
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
movsd 0x10(%r12), %xmm2
leaq 0x666f(%rip), %rdx      # 0x1662d
movb $0x3, %al
callq 0x8420
jmp 0xffff
leaq (%rsp,%rbp), %rdi
addq $0x10, %rdi
movl $0x200, %esi            # imm = 0x200
subl %ebp, %esi
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
movsd 0x10(%r12), %xmm2
movsd 0x18(%r12), %xmm3
leaq 0x6646(%rip), %rdx      # 0x1663e
movb $0x4, %al
callq 0x8420
addq $0x20, %r12
addl %eax, %r13d
cmpl $0x201, %r13d           # imm = 0x201
jl 0xff4a
leaq 0x10(%rsp), %rsi
movb $0x0, 0x1ff(%rsi)
movl $0x2e2e2e20, 0x1fb(%rsi) # imm = 0x2E2E2E20
movl $0x1ff, %edx            # imm = 0x1FF
movq 0x8(%rsp), %rdi
jmp 0x10067
leaq 0x10(%rsp), %rbx
leaq (%rbx,%rbp), %rdi
addq $-0x2, %rdi
movl $0x202, %esi            # imm = 0x202
subl %ebp, %esi
leaq 0x6603(%rip), %rdx      # 0x16653
xorl %eax, %eax
callq 0x8420
addl %ebp, %eax
addl $-0x2, %eax
movslq %eax, %rdx
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x89d0
pushq $0x1
popq %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fec(%rip), %rsi      # 0x16074
leaq 0x658b(%rip), %rdx      # 0x1661a
movq 0x8(%rsp), %rdi
movl $0xf0, %ecx
xorl %eax, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b00