// File: /workspace/github_c_makefile_star2_O0/mruby-zest[P]osc-bridge/rtosc/rtosc.c
// Function: rtosc_vmessage
size_t rtosc_vmessage(char   *buffer,
                      size_t      len,
                      const char *address,
                      const char *arguments,
                      va_list ap)
{
    const unsigned nargs = nreserved(arguments);
    if(!nargs)
        return rtosc_amessage(buffer,len,address,arguments,NULL);

    rtosc_arg_t args[nargs];

    unsigned arg_pos = 0;
    const char *arg_str = arguments;
    uint8_t *midi_tmp;
    while(arg_pos < nargs)
    {
        switch(*arg_str++) {
            case 'h':
            case 't':
                args[arg_pos++].h = va_arg(ap, int64_t);
                break;
            case 'd':
                args[arg_pos++].d = va_arg(ap, double);
                break;
            case 'c':
            case 'i':
            case 'r':
                args[arg_pos++].i = va_arg(ap, int);
                break;
            case 'm':
                midi_tmp = va_arg(ap, uint8_t *);
                args[arg_pos].m[0] = midi_tmp[0];
                args[arg_pos].m[1] = midi_tmp[1];
                args[arg_pos].m[2] = midi_tmp[2];
                args[arg_pos++].m[3] = midi_tmp[3];
                break;
            case 'S':
            case 's':
                args[arg_pos++].s = va_arg(ap, const char *);
                break;
            case 'b':
                args[arg_pos].b.len = va_arg(ap, int);
                args[arg_pos].b.data = va_arg(ap, unsigned char *);
                arg_pos++;
                break;
            case 'f':
                args[arg_pos++].f = va_arg(ap, double);
                break;
            default:
                ;
        }
    }

    return rtosc_amessage(buffer,len,address,arguments,args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8f20
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x8a04
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x8f70
movq %rax, -0x8(%rbp)
jmp 0x8f12
movl -0x34(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x40(%rbp)
movq %rax, %rdx
shlq $0x4, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x8eee
movq -0x58(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x58(%rbp)
movsbl (%rax), %eax
addl $-0x53, %eax
movl %eax, %ecx
movq %rcx, -0x70(%rbp)
subl $0x21, %eax
ja 0x8ee7
movq -0x70(%rbp), %rax
leaq 0x3ec9(%rip), %rcx      # 0xc938
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movl (%rax), %eax
movl %eax, -0x74(%rbp)
cmpl $0x28, %eax
ja 0x8aa6
movq -0x80(%rbp), %rcx
movl -0x74(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x88(%rbp)
jmp 0x8ac0
movq -0x80(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rax
movq -0x88(%rbp), %rcx
movq (%rcx), %rcx
movl -0x4c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x4c(%rbp)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x98(%rbp)
movl 0x4(%rax), %eax
movl %eax, -0x8c(%rbp)
cmpl $0xa0, %eax
ja 0x8b3c
movq -0x98(%rbp), %rcx
movl -0x8c(%rbp), %edx
movq -0xa0(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0xa8(%rbp)
jmp 0x8b59
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rax
movq -0xa8(%rbp), %rcx
movsd (%rcx), %xmm0
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl (%rax), %eax
movl %eax, -0xac(%rbp)
cmpl $0x28, %eax
ja 0x8bbf
movq -0xb8(%rbp), %rcx
movl -0xac(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xc0(%rbp)
jmp 0x8bdc
movq -0xb8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xc0(%rbp)
movq -0x68(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
movl -0x4c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x4c(%rbp)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl (%rax), %eax
movl %eax, -0xc4(%rbp)
cmpl $0x28, %eax
ja 0x8c3e
movq -0xd0(%rbp), %rcx
movl -0xc4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xd8(%rbp)
jmp 0x8c5b
movq -0xd0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xd8(%rbp)
movq -0x68(%rbp), %rax
movq -0xd8(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, -0x60(%rbp)
movq -0x60(%rbp), %rcx
movb (%rcx), %dl
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
shlq $0x4, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movb %dl, (%rcx)
movq -0x60(%rbp), %rcx
movb 0x1(%rcx), %dl
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
shlq $0x4, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movb %dl, 0x1(%rcx)
movq -0x60(%rbp), %rcx
movb 0x2(%rcx), %dl
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
shlq $0x4, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movb %dl, 0x2(%rcx)
movq -0x60(%rbp), %rcx
movb 0x3(%rcx), %cl
movl -0x4c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x4c(%rbp)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movb %cl, 0x3(%rax)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
cmpl $0x28, %eax
ja 0x8d13
movq -0xe8(%rbp), %rcx
movl -0xdc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xf0(%rbp)
jmp 0x8d30
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xf0(%rbp)
movq -0x68(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq (%rcx), %rcx
movl -0x4c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x4c(%rbp)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0x100(%rbp)
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x28, %eax
ja 0x8d94
movq -0x100(%rbp), %rcx
movl -0xf4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x108(%rbp)
jmp 0x8db1
movq -0x100(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x108(%rbp)
movq -0x68(%rbp), %rax
movq -0x108(%rbp), %rcx
movl (%rcx), %ecx
movl -0x4c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x118(%rbp)
movl (%rax), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x28, %eax
ja 0x8e04
movq -0x118(%rbp), %rcx
movl -0x10c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x120(%rbp)
jmp 0x8e21
movq -0x118(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x120(%rbp)
movq -0x68(%rbp), %rax
movq -0x120(%rbp), %rcx
movq (%rcx), %rcx
movl -0x4c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8ee9
movq -0x30(%rbp), %rax
movq %rax, -0x138(%rbp)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x130(%rbp)
movl 0x4(%rax), %eax
movl %eax, -0x124(%rbp)
cmpl $0xa0, %eax
ja 0x8e9d
movq -0x130(%rbp), %rcx
movl -0x124(%rbp), %edx
movq -0x138(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0x140(%rbp)
jmp 0x8eba
movq -0x138(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x140(%rbp)
movq -0x68(%rbp), %rax
movq -0x140(%rbp), %rcx
movsd (%rcx), %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4c(%rbp)
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
jmp 0x8ee9
jmp 0x8ee9
jmp 0x8a35
movq -0x68(%rbp), %r8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x8f70
movq %rax, -0x8(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rsp
movq -0x8(%rbp), %rax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)