// File: /workspace/github_cpp_makefile_star2_O1/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 0x3476(%rip), %rsi      # 0x60ce
leaq 0x3474(%rip), %rdx      # 0x60d3
movq %rsp, %rdi
callq 0x51ea
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x3b4c
movl 0x30(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2c96
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
testl %ebp, %ebp
jne 0x2cdb
movq %rsp, %rsi
leaq 0x10(%rsp), %rax
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movb $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x3d12
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x6307(%rip), %rdi      # 0x8fd0
callq 0x2260
movq %rax, %rdi
callq 0x2110
jmp 0x2db2
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x33e7(%rip), %rsi      # 0x60d4
leaq 0x33e6(%rip), %rdx      # 0x60da
callq 0x51ea
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x3b4c
movl 0x30(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d28
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
testl %ebp, %ebp
jne 0x2dba
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 0x3d12
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x3d12
leaq 0x24(%rsp), %rdx
movq %rbx, %rdi
movl $0x69, %esi
callq 0x4db4
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x6265(%rip), %rdi      # 0x8ff0
callq 0x2260
cmpq $0x0, 0x30(%rsp)
jne 0x2f23
movq 0x624d(%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 0x6207(%rip), %rdi      # 0x8fd0
callq 0x2260
leaq 0x330a(%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 0x2f17
movq %rsp, %r14
movq 0x61c8(%rip), %r15      # 0x8fd0
leaq 0x32d6(%rip), %r12      # 0x60e5
leaq 0x32cc(%rip), %r13      # 0x60e2
leaq 0x32c7(%rip), %rbp      # 0x60e4
cmpl $0x0, 0x8(%rbx)
jne 0x2e6a
cmpq 0x30(%rax), %rcx
jae 0x2e63
movq 0x28(%rax), %rdx
cmpb $0x69, (%rdx,%rcx)
jne 0x2e6a
movq %rbx, %rdi
movl $0x69, %esi
movq %r14, %rdx
callq 0x4db4
movl (%rsp), %esi
movq %r15, %rdi
callq 0x2330
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2260
jmp 0x2efb
movl $0x6, 0x8(%rbx)
cmpl $0x0, 0x8(%rbx)
jne 0x2efb
cmpq 0x30(%rax), %rcx
jae 0x2ef4
movq 0x28(%rax), %rax
cmpb $0x73, (%rax,%rcx)
jne 0x2efb
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d12
movl $0x1, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2260
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x2260
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2260
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2efb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2efb
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 0x2e1d
movq 0x60b2(%rip), %rdi      # 0x8fd0
callq 0x2110
movq 0x60c6(%rip), %rdi      # 0x8ff0
leaq 0x31aa(%rip), %rsi      # 0x60db
movl $0x1, %edx
callq 0x2260
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x60a4(%rip), %rdi      # 0x8ff0
callq 0x2260
cmpl $0x0, 0x24(%rsp)
js 0x2f80
movq 0x6091(%rip), %rdi      # 0x8ff0
leaq 0x3177(%rip), %rsi      # 0x60dd
movl $0x1, %edx
callq 0x2260
movl 0x24(%rsp), %esi
movq 0x6075(%rip), %rdi      # 0x8ff0
callq 0x2330
movq 0x6069(%rip), %rdi      # 0x8ff0
leaq 0x33ae(%rip), %rsi      # 0x633c
movl $0x1, %edx
callq 0x2260
jmp 0x2d9c
jmp 0x2fc1
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x2fc4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2fc4
jmp 0x2fc1
jmp 0x2fe1
jmp 0x2fc1
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2fe4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2fe4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2350