// File: /workspace/github_c_makefile_star2_O1/mruby-zest[P]osc-bridge/src/bridge.c
// Function: run_callbacks
static void
run_callbacks(bridge_t *br, param_cache_t *line)
{
    char buffer[1024*16];
    int len = 0;
    if(line->type != 'v') {
        char args[2] = {line->type, 0};
        assert(valid_type(line->type));
        len = rtosc_amessage(buffer, sizeof(buffer), line->path, args, &line->val);
    } else {
        len = rtosc_amessage(buffer, sizeof(buffer), line->path, line->vec_type,
                line->vec_value);
    }

    if(len == 0) {
        //TODO USE DYNAMIC ALLOCATION...
        printf("[ERROR] Message Too long for cache line <%s>\n", line->path);
        if(line->type != 'v') {
            char args[2] = {line->type, 0};
            assert(valid_type(line->type));
            len = rtosc_amessage(0, 0, line->path, args, &line->val);
        } else {
            len = rtosc_amessage(0, 0, line->path, line->vec_type,
                    line->vec_value);
        }
        printf("[ERROR] Needs %d bytes of space...\n", len);
    }


    //run callbacks
    for(int i=0; i<br->callback_len; ++i)
        if(!strcmp(br->callback[i].path, line->path))
            br->callback[i].cb(buffer, br->callback[i].data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x9(%rsi), %eax
cmpl $0x76, %eax
jne 0x3fb6
movq (%rbx), %rdx
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %r8
leaq -0x4030(%rbp), %rdi
jmp 0x3fef
movb %al, -0x2a(%rbp)
movb $0x0, -0x29(%rbp)
addl $-0x46, %eax
cmpl $0x2e, %eax
ja 0x40cf
movabsq $0x708d70006109, %rcx   # imm = 0x708D70006109
btq %rax, %rcx
jae 0x40cf
movq (%rbx), %rdx
leaq 0x20(%rbx), %r8
leaq -0x4030(%rbp), %rdi
leaq -0x2a(%rbp), %rcx
movl $0x4000, %esi           # imm = 0x4000
callq 0x6b54
testl %eax, %eax
jne 0x406f
movq (%rbx), %rsi
leaq 0x53ed(%rip), %rdi      # 0x93f4
xorl %eax, %eax
callq 0x20f0
movzbl 0x9(%rbx), %eax
cmpl $0x76, %eax
jne 0x4024
movq (%rbx), %rdx
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %r8
jmp 0x4056
movb %al, -0x2a(%rbp)
movb $0x0, -0x29(%rbp)
addl $-0x46, %eax
cmpl $0x2e, %eax
ja 0x40ee
movabsq $0x708d70006109, %rcx   # imm = 0x708D70006109
btq %rax, %rcx
jae 0x40ee
movq (%rbx), %rdx
leaq 0x20(%rbx), %r8
leaq -0x2a(%rbp), %rcx
xorl %edi, %edi
xorl %esi, %esi
callq 0x6b54
leaq 0x51ad(%rip), %rdi      # 0x9213
movl %eax, %esi
xorl %eax, %eax
callq 0x20f0
cmpl $0x0, 0x128(%r14)
jle 0x40bd
movl $0x10, %r12d
xorl %r13d, %r13d
movq 0x110(%r14), %r15
movq -0x10(%r15,%r12), %rdi
movq (%rbx), %rsi
callq 0x21a0
testl %eax, %eax
jne 0x40aa
movq (%r15,%r12), %rsi
leaq -0x4030(%rbp), %rdi
callq *-0x8(%r15,%r12)
incq %r13
movslq 0x128(%r14), %rax
addq $0x18, %r12
cmpq %rax, %r13
jl 0x4082
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x52d7(%rip), %rdi      # 0x93ad
leaq 0x509f(%rip), %rsi      # 0x917c
leaq 0x52e0(%rip), %rcx      # 0x93c4
movl $0x23d, %edx            # imm = 0x23D
callq 0x2130
leaq 0x52b8(%rip), %rdi      # 0x93ad
leaq 0x5080(%rip), %rsi      # 0x917c
leaq 0x52c1(%rip), %rcx      # 0x93c4
movl $0x249, %edx            # imm = 0x249
callq 0x2130