// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/print.c
// Function: fst_print_sym
void fst_print_sym(
                    const struct _fst * fst,
                    struct _symt * ist,
                    struct _symt * ost,
                    struct _symt * sst) 
{
    struct _state state;
    struct _arc arc;

    token_t sa, sb, li, lo;

    rtrans_f strans, itrans, otrans; 

    state_t s;
    arc_t   a;

    itrans = (ist == NULL ? trn:trt);
    otrans = (ost == NULL ? trn:trt);
    strans = (sst == NULL ? trn:trt);

    struct _queue *finals = queue_create(sizeof(state_t));
    
    for(s=0; s < fst->n_states; ++s) {
        state = fst->states[s];
        for(a=0; a < state.n_arcs; ++a) {
            arc = state.arcs[a];

            strans(sst, s, sa);
            strans(sst, arc.state, sb); 
            itrans(ist, arc.ilabel, li);
            otrans(ost, arc.olabel, lo);

            if (sa == NULL || sb == NULL || li == NULL || lo == NULL) {
                fprintf(stderr, "Invalid symbol\n");
                exit(EXIT_FAILURE);
            }

            printf("%s\t%s\t%s\t%s\t%.5f\n",
                sa,
                sb,
                li,
                lo,
                arc.weight);
        }

        if(state.final == 1) {
            queue_enque(finals, &s);
        }
    }

    while(queue_deque(finals, &s) != NULL) {
        state = fst->states[s];

        strans(sst, s, sa);

        if (sa == NULL) {
            fprintf(stderr, "Invalid symbol\n");
            exit(EXIT_FAILURE);
        }

        printf("%s\t%f\n", sa, state.weight);
    }

    queue_remove(finals);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1078, %rsp           # imm = 0x1078
movq %rsi, -0x78(%rbp)
testq %rsi, %rsi
leaq 0x1ca(%rip), %rax       # 0x31f7
leaq 0x1ea(%rip), %rsi       # 0x321e
movq %rsi, %r8
cmoveq %rax, %r8
movq %r8, -0x70(%rbp)
movq %rdx, -0x80(%rbp)
testq %rdx, %rdx
movq %rsi, %rdx
cmoveq %rax, %rdx
movq %rdx, -0x68(%rbp)
movq %rdi, %rbx
movq %rcx, -0x58(%rbp)
testq %rcx, %rcx
cmoveq %rax, %rsi
movq %rsi, -0x50(%rbp)
pushq $0x4
popq %rdi
callq 0x2c00
movq %rax, -0x38(%rbp)
xorl %eax, %eax
movq %rbx, -0x60(%rbp)
movl %eax, -0x2c(%rbp)
cmpl 0x4(%rbx), %eax
jae 0x3185
movq 0x10(%rbx), %rcx
movl %eax, %eax
imulq $0x18, %rax, %rax
movl (%rcx,%rax), %esi
movl 0xc(%rcx,%rax), %edx
movl %edx, -0x44(%rbp)
movq 0x10(%rcx,%rax), %r13
shlq $0x4, %rsi
movq %rsi, -0x88(%rbp)
xorl %ebx, %ebx
cmpq %rbx, -0x88(%rbp)
je 0x3164
movl (%r13,%rbx), %r15d
movl 0x8(%r13,%rbx), %eax
movq %rax, -0x90(%rbp)
movl 0xc(%r13,%rbx), %eax
movq %rax, -0x98(%rbp)
movl -0x2c(%rbp), %esi
cvtss2sd 0x4(%r13,%rbx), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x58(%rbp), %r12
movq %r12, %rdi
leaq -0x4a0(%rbp), %rdx
movq -0x50(%rbp), %r14
callq *%r14
movq %r12, %rdi
movq %r15, %rsi
leaq -0x10a0(%rbp), %r15
movq %r15, %rdx
callq *%r14
movq -0x78(%rbp), %rdi
movq -0x90(%rbp), %rsi
leaq -0xca0(%rbp), %r14
movq %r14, %rdx
callq *-0x70(%rbp)
movq -0x80(%rbp), %rdi
movq -0x98(%rbp), %rsi
leaq -0x8a0(%rbp), %r12
movq %r12, %rdx
callq *-0x68(%rbp)
leaq 0x3159(%rip), %rdi      # 0x6298
leaq -0x4a0(%rbp), %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %r12, %r8
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
callq 0x10b0
addq $0x10, %rbx
jmp 0x30a7
cmpl $0x1, -0x44(%rbp)
jne 0x3177
movq -0x38(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2c27
movl -0x2c(%rbp), %eax
incl %eax
movq -0x60(%rbp), %rbx
jmp 0x3075
leaq -0x2c(%rbp), %r14
leaq -0x4a0(%rbp), %r15
leaq 0x3113(%rip), %r12      # 0x62aa
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x2ca6
testq %rax, %rax
je 0x31dc
movq 0x10(%rbx), %rax
movl -0x2c(%rbp), %esi
imulq $0x18, %rsi, %rcx
cvtss2sd 0x8(%rax,%rcx), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq %r15, %rdx
callq *-0x50(%rbp)
movq %r12, %rdi
movq %r15, %rsi
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
callq 0x10b0
jmp 0x3197
movq -0x38(%rbp), %rdi
callq 0x2d4b
addq $0x1078, %rsp           # imm = 0x1078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq