// File: /workspace/github_c_makefile_star2_O0/mruby-zest[P]osc-bridge/rtosc/rtosc.c
// Function: vsosc_null
static size_t vsosc_null(const char        *address,
                         const char        *arguments,
                         const rtosc_arg_t *args)
{
    unsigned pos = 0;
    pos += strlen(address);
    pos += 4-pos%4;//get 32 bit alignment
    pos += 1+strlen(arguments);
    pos += 4-pos%4;

    unsigned toparse = nreserved(arguments);
    unsigned arg_pos = 0;

    //Take care of varargs
    while(toparse)
    {
        char arg = *arguments++;
        assert(arg);
        int i;
        const char *s;
        switch(arg) {
            case 'h':
            case 't':
            case 'd':
                ++arg_pos;
                pos += 8;
                --toparse;
                break;
            case 'm':
            case 'r':
            case 'c':
            case 'f':
            case 'i':
                ++arg_pos;
                pos += 4;
                --toparse;
                break;
            case 's':
            case 'S':
                s = args[arg_pos++].s;
                assert(s && "Input strings CANNOT be NULL");
                pos += strlen(s);
                pos += 4-pos%4;
                --toparse;
                break;
            case 'b':
                i = args[arg_pos++].b.len;
                pos += 4 + i;
                if(pos%4)
                    pos += 4-pos%4;
                --toparse;
                break;
            default:
                ;
        }
    }

    return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20b0
movq %rax, %rcx
movl -0x1c(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
andl $0x3, %ecx
movl $0x4, %eax
subl %ecx, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20b0
movq %rax, %rcx
addq $0x1, %rcx
movl -0x1c(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
andl $0x3, %ecx
movl $0x4, %eax
subl %ecx, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8f20
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x977c
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x25(%rbp)
cmpb $0x0, -0x25(%rbp)
je 0x9618
jmp 0x9637
leaq 0x36f9(%rip), %rdi      # 0xcd18
leaq 0x3666(%rip), %rsi      # 0xcc8c
movl $0xc0, %edx
leaq 0x3774(%rip), %rcx      # 0xcda6
callq 0x2120
movsbl -0x25(%rbp), %eax
addl $-0x53, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x21, %eax
ja 0x9775
movq -0x40(%rbp), %rax
leaq 0x33f0(%rip), %rcx      # 0xca48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9777
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9777
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x96d1
movb $0x1, %al
testb $0x1, %al
jne 0x96cf
jmp 0x96d1
jmp 0x96f0
leaq 0x372e(%rip), %rdi      # 0xce06
leaq 0x35ad(%rip), %rsi      # 0xcc8c
movl $0xd7, %edx
leaq 0x36bb(%rip), %rcx      # 0xcda6
callq 0x2120
movq -0x38(%rbp), %rdi
callq 0x20b0
movq %rax, %rcx
movl -0x1c(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
andl $0x3, %ecx
movl $0x4, %eax
subl %ecx, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9777
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addl $0x4, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x976a
movl -0x1c(%rbp), %ecx
andl $0x3, %ecx
movl $0x4, %eax
subl %ecx, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9777
jmp 0x9777
jmp 0x95f2
movl -0x1c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)