// File: /workspace/github_cpp_makefile_star2_O2/jgeumlek[P]moltengamepadctl/source/main.cpp
// Function: osc_msg(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, ...)
int osc_msg(int fd, const std::string& path, int id, const std::string& argtypes, ...) {
  oscpkt::PacketWriter pw;
  oscpkt::Message msg;
  msg.init(path);
  msg.pushInt32(id);
  if (!argtypes.empty()) {
    va_list arglist;
    va_start(arglist, argtypes);
    int n = argtypes.size();
    for (int i = 0; i < n; i++) {
      if (argtypes[i] == 'i') {
        int arg = va_arg(arglist, int);
        msg.pushInt32(arg);
      }
      if (argtypes[i] == 'b') {
        int arg = va_arg(arglist, int);
        msg.pushBool(arg != 0);
      }
      if (argtypes[i] == 's') {
        const char* arg = va_arg(arglist, const char*);
        if (!arg) {
          msg.pushStr("");
        } else {
          std::string str(arg);
          msg.pushStr(str);
        }
      }
    }
  }
  add_pending(id);
  pw.init().addMessage(msg);
  uint32_t size = pw.packetSize();
  write(fd, &size, sizeof(size));
  write(fd, pw.packetData(), size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %ebp
movq %r8, 0x130(%rsp)
movq %r9, 0x138(%rsp)
testb %al, %al
je 0x2611
movaps %xmm0, 0x140(%rsp)
movaps %xmm1, 0x150(%rsp)
movaps %xmm2, 0x160(%rsp)
movaps %xmm3, 0x170(%rsp)
movaps %xmm4, 0x180(%rsp)
movaps %xmm5, 0x190(%rsp)
movaps %xmm6, 0x1a0(%rsp)
movaps %xmm7, 0x1b0(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x32f6
leaq 0x90(%rsp), %rdi
callq 0x3344
leaq 0x90(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x33e0
leaq 0x90(%rsp), %rdi
movl %r15d, %esi
callq 0x3434
cmpq $0x0, 0x8(%r14)
je 0x27bd
movl %r15d, 0x30(%rsp)
movl %ebp, 0x34(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x200(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, 0x10(%rsp)
movl 0x8(%r14), %ebp
xorl %r12d, %r12d
testl %ebp, %ebp
cmovlel %r12d, %ebp
leaq 0x90(%rsp), %r15
leaq 0x70(%rsp), %r13
leaq 0xf(%rsp), %rbx
cmpq %r12, %rbp
je 0x27b4
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x69, %al
jne 0x26f5
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x26d6
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x26e4
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movl (%rax), %esi
movq %r15, %rdi
callq 0x3434
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x62, %al
jne 0x273a
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2714
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x2722
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
xorl %esi, %esi
cmpl $0x0, (%rax)
setne %sil
movq %r15, %rdi
callq 0x343e
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x73, %al
jne 0x27ac
movl 0x10(%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2759
movq %rcx, %rax
addq 0x20(%rsp), %rax
addl $0x8, %ecx
movl %ecx, 0x10(%rsp)
jmp 0x2767
movq 0x18(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq (%rax), %rsi
testq %rsi, %rsi
je 0x2787
movq %r13, %rdi
movq %rbx, %rdx
callq 0x20c0
movq %r15, %rdi
movq %r13, %rsi
callq 0x347e
jmp 0x27a4
movq %r13, %rdi
leaq 0x297f(%rip), %rsi      # 0x5110
movq %rbx, %rdx
callq 0x20c0
movq %r15, %rdi
movq %r13, %rsi
callq 0x347e
movq %r13, %rdi
callq 0x20f0
incq %r12
jmp 0x26a7
movl 0x34(%rsp), %ebp
movl 0x30(%rsp), %r15d
movl %r15d, %edi
callq 0x24dc
leaq 0x38(%rsp), %rdi
callq 0x3510
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x3534
movl 0x58(%rsp), %eax
subl 0x50(%rsp), %eax
xorl %ebx, %ebx
cmpl $0x0, 0x68(%rsp)
cmovel %eax, %ebx
leaq 0x70(%rsp), %rsi
movl %ebx, (%rsi)
pushq $0x4
popq %rdx
movl %ebp, %edi
callq 0x2090
movq 0x50(%rsp), %rsi
xorl %eax, %eax
cmpq %rsi, 0x58(%rsp)
cmoveq %rax, %rsi
cmpl $0x0, 0x68(%rsp)
cmovneq %rax, %rsi
movl %ebx, %edx
movl %ebp, %edi
callq 0x2090
jmp 0x2828
jmp 0x283f
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x20f0
jmp 0x2842
jmp 0x283f
jmp 0x283f
jmp 0x283f
jmp 0x283f
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x359a
jmp 0x2854
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x35c6
movq %rbx, %rdi
callq 0x2340