// File: /workspace/github_c_makefile_star2_O0/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
subq $0x1080, %rsp           # imm = 0x1080
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x2aa(%rip), %rax       # 0x44e0
leaq 0x263(%rip), %rcx       # 0x44a0
cmpq $0x0, %rdx
cmoveq %rcx, %rax
movq %rax, -0x1060(%rbp)
movq -0x18(%rbp), %rdx
leaq 0x289(%rip), %rax       # 0x44e0
leaq 0x242(%rip), %rcx       # 0x44a0
cmpq $0x0, %rdx
cmoveq %rcx, %rax
movq %rax, -0x1068(%rbp)
movq -0x20(%rbp), %rdx
leaq 0x268(%rip), %rax       # 0x44e0
leaq 0x221(%rip), %rcx       # 0x44a0
cmpq $0x0, %rdx
cmoveq %rcx, %rax
movq %rax, -0x1058(%rbp)
movl $0x4, %edi
callq 0x3aa0
movq %rax, -0x1078(%rbp)
movl $0x0, -0x106c(%rbp)
movl -0x106c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x43fe
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x106c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x1070(%rbp)
movl -0x1070(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0x43cf
movq -0x28(%rbp), %rax
movl -0x1070(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x1058(%rbp), %rax
movq -0x20(%rbp), %rdi
movl -0x106c(%rbp), %ecx
movl %ecx, %esi
leaq -0x450(%rbp), %rdx
callq *%rax
movq -0x1058(%rbp), %rax
movq -0x20(%rbp), %rdi
movl -0x48(%rbp), %ecx
movl %ecx, %esi
leaq -0x850(%rbp), %rdx
callq *%rax
movq -0x1060(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %ecx
movl %ecx, %esi
leaq -0xc50(%rbp), %rdx
callq *%rax
movq -0x1068(%rbp), %rax
movq -0x18(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl %ecx, %esi
leaq -0x1050(%rbp), %rdx
callq *%rax
leaq -0x450(%rbp), %rsi
leaq -0x850(%rbp), %rdx
leaq -0xc50(%rbp), %rcx
leaq -0x1050(%rbp), %r8
movss -0x44(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3eed(%rip), %rdi      # 0x82a1
movb $0x1, %al
callq 0x10a0
movl -0x1070(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1070(%rbp)
jmp 0x42f2
cmpl $0x1, -0x2c(%rbp)
jne 0x43e8
movq -0x1078(%rbp), %rdi
leaq -0x106c(%rbp), %rsi
callq 0x3b00
jmp 0x43ea
movl -0x106c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x106c(%rbp)
jmp 0x42a9
jmp 0x4400
movq -0x1078(%rbp), %rdi
leaq -0x106c(%rbp), %rsi
callq 0x3bd0
cmpq $0x0, %rax
je 0x4484
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x106c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x1058(%rbp), %rax
movq -0x20(%rbp), %rdi
movl -0x106c(%rbp), %ecx
movl %ecx, %esi
leaq -0x450(%rbp), %rdx
callq *%rax
leaq -0x450(%rbp), %rsi
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3e3b(%rip), %rdi      # 0x82b3
movb $0x1, %al
callq 0x10a0
jmp 0x4400
movq -0x1078(%rbp), %rdi
callq 0x3cd0
addq $0x1080, %rsp           # imm = 0x1080
popq %rbp
retq
nopl (%rax)