// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1b8, %rsp            # imm = 0x1B8
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %r15
movl %edi, %ebp
movq %r8, 0x120(%rsp)
movq %r9, 0x128(%rsp)
testb %al, %al
je 0x26c0
movaps %xmm0, 0x130(%rsp)
movaps %xmm1, 0x140(%rsp)
movaps %xmm2, 0x150(%rsp)
movaps %xmm3, 0x160(%rsp)
movaps %xmm4, 0x170(%rsp)
movaps %xmm5, 0x180(%rsp)
movaps %xmm6, 0x190(%rsp)
movaps %xmm7, 0x1a0(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x373a
leaq 0x80(%rsp), %rdi
callq 0x37b8
leaq 0x80(%rsp), %rdi
movl $0x1, %edx
movq %r15, %rsi
callq 0x387a
leaq 0x80(%rsp), %rdi
movl $0x69, %esi
movl %ebx, %edx
callq 0x3f9a
cmpq $0x0, 0x8(%r14)
je 0x289d
movl %ebx, 0x40(%rsp)
movl %ebp, 0x44(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x1f0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%rsp)
movq 0x8(%r14), %r12
testl %r12d, %r12d
jle 0x2895
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x80(%rsp), %r15
leaq 0x20(%rsp), %r13
movq (%r14), %rax
movb (%rax,%rbp), %al
cmpb $0x69, %al
jne 0x27a4
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2781
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x278f
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %edx
movq %r15, %rdi
movl $0x69, %esi
callq 0x3f9a
movq (%r14), %rax
movb (%rax,%rbp), %al
cmpb $0x62, %al
jne 0x27e6
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x27c1
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x27cf
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
xorl %esi, %esi
cmpl $0x0, (%rax)
setne %sil
movq %r15, %rdi
callq 0x38ce
movq (%r14), %rax
movb (%rax,%rbp), %al
cmpb $0x73, %al
jne 0x2889
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2807
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x2815
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rbx
leaq 0x30(%rsp), %rax
testq %rbx, %rbx
je 0x284b
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
callq 0x20d0
leaq (%rax,%rbx), %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x508e
movq %r15, %rdi
movq %r13, %rsi
callq 0x392c
jmp 0x286d
movq %rax, 0x20(%rsp)
movq %r13, %rdi
leaq 0x38b6(%rip), %rdx      # 0x6110
movq %rdx, %rsi
callq 0x508e
movq %r15, %rdi
movq %r13, %rsi
callq 0x392c
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2889
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
incq %rbp
cmpq %rbp, %r12
jne 0x275e
movl 0x44(%rsp), %ebp
movl 0x40(%rsp), %ebx
movl %ebx, %edi
callq 0x254c
leaq 0x60(%rsp), %rdi
movl $0x0, 0x18(%rdi)
xorl %esi, %esi
callq 0x3e6a
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x28c8
movq %rax, 0x50(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x39da
movl 0x68(%rsp), %eax
subl 0x60(%rsp), %eax
xorl %ebx, %ebx
cmpl $0x0, 0x78(%rsp)
cmovel %eax, %ebx
leaq 0x20(%rsp), %rsi
movl %ebx, (%rsi)
movl $0x4, %edx
movl %ebp, %edi
callq 0x2090
movq 0x60(%rsp), %rsi
xorl %eax, %eax
cmpq %rsi, 0x68(%rsp)
cmoveq %rax, %rsi
cmpl $0x0, 0x78(%rsp)
cmovneq %rax, %rsi
movl %ebx, %edx
movl %ebp, %edi
callq 0x2090
jmp 0x2925
jmp 0x294e
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2951
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2951
jmp 0x294e
jmp 0x294e
jmp 0x294e
jmp 0x294e
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x296e
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x298b
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29ac
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29d2
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x29d2
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x29e9
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x2a00
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2350