// File: /workspace/github_c_makefile_star2_O1/phase[P]o/o.c
// Function: tos
S tos(O o){
    S r,t;L z,i;switch(o->t){
    case TD:r=alc(BZ)/*hope this is big enough!*/;sprintf(r,"%f",o->d);z=strlen(r)-1;while(r[z]=='0')r[z--]=0;if(r[z]=='.')r[z]=0;BK;
    case TS:r=alc(o->s.z+1);memcpy(r,o->s.s,o->s.z);r[o->s.z]=0;BK;
    case TA:r=alc(1);r[0]='[';z=1;for(i=0;i<len(o->a);++i){L l;if(i){r=rlc(r,z+1);r[z++]=',';}t=tos(o->a->st[i]);l=strlen(t);r=rlc(r,z+l);memcpy(r+z,t,l);z+=l;DL(t);}r=rlc(r,z+2);r[z]=']';r[z+1]=0;BK;
    case TCB:r=alc(o->s.z+3);r[0]='{';memcpy(r+1,o->s.s,o->s.z);memcpy(r+1+o->s.z,"}",2);BK;
    case TR:{L lv;S tv;t=tos(o->e.k);tv=tos(o->e.v);z=strlen(t);lv=strlen(tv);r=alc(z+lv+5);sprintf(r,"{%s: %s}",t,tv);DL(t);DL(tv);}BK;
    }R r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
cmpq $0x4, %rax
ja 0x2c11
movq %rdi, %r12
leaq 0x660a(%rip), %rcx      # 0x9004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x800, %edi            # imm = 0x800
callq 0x21c0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movsd 0x8(%r12), %xmm0
leaq 0x6914(%rip), %rsi      # 0x933b
movq %rax, %rdi
movb $0x1, %al
callq 0x2230
movq %r14, %rdi
callq 0x20e0
addq %r14, %rax
decq %rax
movzbl (%rax), %ecx
cmpl $0x30, %ecx
jne 0x2c13
movb $0x0, (%rax)
decq %rax
jmp 0x2a3f
movq 0x8(%r12), %rdi
callq 0x29d3
movq %rax, %r15
movq 0x10(%r12), %rdi
callq 0x29d3
movq %rax, %rbx
movq %r15, %rdi
callq 0x20e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
leaq (%r14,%rax), %rdi
addq $0x5, %rdi
callq 0x21c0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
leaq 0x689e(%rip), %rsi      # 0x933e
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2230
movq %r15, %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
jmp 0x2c1b
movl $0x1, %r13d
movl $0x1, %edi
callq 0x21c0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movb $0x5b, (%rax)
movq 0x8(%r12), %rbx
cmpq $0x0, 0x8(%rbx)
je 0x2b8d
xorl %r15d, %r15d
movq %r12, -0x30(%rbp)
testq %r15, %r15
je 0x2b22
leaq 0x1(%r13), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x21f0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movb $0x2c, (%rax,%r13)
jmp 0x2b25
movq %r13, %r12
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x29d3
movq %rax, %r13
movq %rax, %rdi
callq 0x20e0
movq %rax, %rbx
leaq (%rax,%r12), %rsi
movq %r14, %rdi
movq %rsi, -0x38(%rbp)
callq 0x21f0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
addq %rax, %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x21b0
movq %r13, %rdi
callq 0x2030
incq %r15
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rbx
cmpq 0x8(%rbx), %r15
movq -0x38(%rbp), %r13
jb 0x2afb
leaq 0x2(%r13), %rsi
movq %r14, %rdi
callq 0x21f0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movw $0x5d, (%rax,%r13)
jmp 0x2c1b
movq 0x10(%r12), %r15
leaq 0x3(%r15), %rdi
callq 0x21c0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movb $0x7b, (%rax)
movq %rax, %rdi
incq %rdi
movq 0x8(%r12), %rsi
movq %r15, %rdx
callq 0x21b0
movw $0x7d, 0x1(%r14,%r15)
jmp 0x2c1b
movq 0x10(%r12), %rbx
leaq 0x1(%rbx), %rdi
callq 0x21c0
testq %rax, %rax
je 0x2c2d
movq %rax, %r14
movq 0x8(%r12), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x21b0
movb $0x0, (%r14,%rbx)
jmp 0x2c1b
jmp 0x2c1b
cmpl $0x2e, %ecx
jne 0x2c1b
movb $0x0, (%rax)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6903(%rip), %rdi      # 0x9537
callq 0x23bc