// File: /workspace/github_cpp_makefile_star2_O3/jgeumlek[P]moltengamepadctl/source/main.cpp
// Function: handle_message(oscpkt::Message*, oscpkt::Message::ArgReader*, int)
int handle_message(oscpkt::Message* msg, oscpkt::Message::ArgReader* arg, int id) {
  if (msg->match("/text")) {
    std::string text;
    arg->popStr(text);
    std::cout << text << std::endl;
  } else if (msg->match("/error")) {
    std::string text, path;
    int line;
    arg->popStr(text);
    arg->popStr(path);
    arg->popInt32(line);
    std::cerr << text;
    if (!path.empty()) {
      std::cerr << "(" << path;
      if (line >= 0) {
        std::cerr << ":" << line;
      }
      std::cerr << ")";
    }
    std::cerr << std::endl;
  } else {
    //a generic catch-all to print something to the user.
    std::cout << msg->addressPattern() << ": ";
    while (arg->nbArgRemaining() > 0) {
      if (arg->isInt32()) {
        int i;
        arg->popInt32(i);
        std::cout << i << " ";
      } else if (arg->isStr()) {
        std::string s;
        arg->popStr(s);
        std::cout << "\"" << s << "\" ";
      }
    }
    std::cout << std::endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x34a9(%rip), %rsi      # 0x60ce
leaq 0x34a7(%rip), %rdx      # 0x60d3
movq %rsp, %rdi
callq 0x508e
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x3b0a
movl 0x30(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2c63
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
testl %ebp, %ebp
jne 0x2ca8
movq %rsp, %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movb $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x3cbe
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x633a(%rip), %rdi      # 0x8fd0
callq 0x2260
movq %rax, %rdi
callq 0x2110
jmp 0x2d7f
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x341a(%rip), %rsi      # 0x60d4
leaq 0x3419(%rip), %rdx      # 0x60da
callq 0x508e
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x3b0a
movl 0x30(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2cf5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
testl %ebp, %ebp
jne 0x2d87
movq %rsp, %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsi)
xorl %eax, %eax
movq %rax, 0x8(%rsi)
movb %al, 0x10(%rsi)
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
movq %rbx, %rdi
callq 0x3cbe
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x3cbe
leaq 0x24(%rsp), %rdx
movq %rbx, %rdi
movl $0x69, %esi
callq 0x4d0a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x6298(%rip), %rdi      # 0x8ff0
callq 0x2260
cmpq $0x0, 0x30(%rsp)
jne 0x2ecc
movq 0x6280(%rip), %rdi      # 0x8ff0
callq 0x2110
leaq 0x28(%rsp), %rdi
callq 0x20e0
movq %rsp, %rdi
callq 0x20e0
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq 0x623a(%rip), %rdi      # 0x8fd0
callq 0x2260
leaq 0x333d(%rip), %rsi      # 0x60df
movl $0x2, %edx
movq %rax, %rdi
callq 0x2260
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movq 0x50(%rax), %rdx
subq 0x48(%rax), %rdx
sarq $0x4, %rdx
cmpq %rcx, %rdx
je 0x2f46
movq %rsp, %r14
movq 0x61fb(%rip), %r15      # 0x8fd0
leaq 0x3306(%rip), %r12      # 0x60e2
leaq 0x3301(%rip), %r13      # 0x60e4
leaq 0x32fb(%rip), %rbp      # 0x60e5
cmpl $0x0, 0x8(%rbx)
jne 0x2e3c
cmpq 0x30(%rax), %rcx
jae 0x2e35
movq 0x28(%rax), %rax
movzbl (%rax,%rcx), %eax
cmpl $0x73, %eax
je 0x2e59
cmpl $0x69, %eax
jne 0x2e3c
movq %rbx, %rdi
movl $0x69, %esi
movq %r14, %rdx
callq 0x4d0a
movl (%rsp), %esi
movq %r15, %rdi
callq 0x2330
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2260
jmp 0x2e3c
movl $0x6, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movq 0x50(%rax), %rdx
subq 0x48(%rax), %rdx
sarq $0x4, %rdx
cmpq %rcx, %rdx
jne 0x2dea
jmp 0x2f46
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cbe
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2260
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x2260
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2260
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2e3c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2e3c
movq 0x611d(%rip), %rdi      # 0x8ff0
leaq 0x3201(%rip), %rsi      # 0x60db
movl $0x1, %edx
callq 0x2260
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x60fb(%rip), %rdi      # 0x8ff0
callq 0x2260
cmpl $0x0, 0x24(%rsp)
js 0x2f29
movq 0x60e8(%rip), %rdi      # 0x8ff0
leaq 0x31ce(%rip), %rsi      # 0x60dd
movl $0x1, %edx
callq 0x2260
movl 0x24(%rsp), %esi
movq 0x60cc(%rip), %rdi      # 0x8ff0
callq 0x2330
movq 0x60c0(%rip), %rdi      # 0x8ff0
leaq 0x3405(%rip), %rsi      # 0x633c
movl $0x1, %edx
callq 0x2260
jmp 0x2d69
movq 0x6083(%rip), %rdi      # 0x8fd0
callq 0x2110
jmp 0x2f76
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f79
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2f79
jmp 0x2f76
jmp 0x2f96
jmp 0x2f76
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2f99
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2f99
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2350