// File: /workspace/github_cpp_makefile_star2_O1/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 0x26c4
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 0x3788
leaq 0x80(%rsp), %rdi
callq 0x3806
leaq 0x80(%rsp), %rdi
movl $0x1, %edx
movq %r15, %rsi
callq 0x38c8
leaq 0x80(%rsp), %rdi
movl $0x69, %esi
movl %ebx, %edx
callq 0x3ffc
cmpq $0x0, 0x8(%r14)
je 0x289e
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 0x2896
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x80(%rsp), %r15
leaq 0x20(%rsp), %r13
movq (%r14), %rax
cmpb $0x69, (%rax,%rbp)
jne 0x27a1
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2784
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x2792
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %edx
movq %r15, %rdi
movl $0x69, %esi
callq 0x3ffc
movq (%r14), %rax
cmpb $0x62, (%rax,%rbp)
jne 0x27e2
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x27c3
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x27d1
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
xorl %esi, %esi
cmpl $0x0, (%rax)
setne %sil
movq %r15, %rdi
callq 0x391c
movq (%r14), %rax
cmpb $0x73, (%rax,%rbp)
jne 0x288a
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2808
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x2816
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rbx
leaq 0x30(%rsp), %rax
testq %rbx, %rbx
je 0x284c
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
callq 0x20d0
leaq (%rax,%rbx), %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x51ea
movq %r15, %rdi
movq %r13, %rsi
callq 0x397a
jmp 0x286e
movq %rax, 0x20(%rsp)
movq %r13, %rdi
leaq 0x38b5(%rip), %rdx      # 0x6110
movq %rdx, %rsi
callq 0x51ea
movq %r15, %rdi
movq %r13, %rsi
callq 0x397a
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x288a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
incq %rbp
cmpq %rbp, %r12
jne 0x2762
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 0x3ebe
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x28c9
movq %rax, 0x50(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3a28
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 0x2926
jmp 0x294f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2952
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2952
jmp 0x294f
jmp 0x294f
jmp 0x294f
jmp 0x294f
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x296f
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x298c
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29ad
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29d3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x29d3
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x29ea
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x2a01
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2350