LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: bool testing::internal::ParseStringFlag<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
static bool ParseStringFlag(const char* str, const char* flag, String* value) {
  // Gets the value of the flag as a string.
  const char* const value_str = ParseFlagValue(str, flag, false);

  // Aborts if the parsing failed.
  if (value_str == NULL) return false;

  // Sets *value to the value of the flag.
  *value = value_str;
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
xorl %edx, %edx
callq 0x20e85
movq %rax, %r14
testq %rax, %rax
je 0x29f09
movq 0x8(%rbx), %r15
movq %r14, %rdi
callq 0x71e0
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x7850
testq %r14, %r14
setne %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest-printers.cc
// Function: testing::internal::CharFormat testing::internal::PrintAsCharLiteralTo<wchar_t, wchar_t>(wchar_t, std::ostream*)
static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
  switch (static_cast<wchar_t>(c)) {
    case L'\0':
      *os << "\\0";
      break;
    case L'\'':
      *os << "\\'";
      break;
    case L'\\':
      *os << "\\\\";
      break;
    case L'\a':
      *os << "\\a";
      break;
    case L'\b':
      *os << "\\b";
      break;
    case L'\f':
      *os << "\\f";
      break;
    case L'\n':
      *os << "\\n";
      break;
    case L'\r':
      *os << "\\r";
      break;
    case L'\t':
      *os << "\\t";
      break;
    case L'\v':
      *os << "\\v";
      break;
    default:
      if (IsPrintableAscii(c)) {
        *os << static_cast<char>(c);
        return kAsIs;
      } else {
        ostream::fmtflags flags = os->flags();
        *os << "\\x" << std::hex << std::uppercase
            << static_cast<int>(static_cast<UnsignedChar>(c));
        os->flags(flags);
        return kHexEscape;
      }
  }
  return kSpecialEscape;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %r14d
cmpl $0xd, %edi
ja 0x2a270
movl %r14d, %eax
leaq 0xaa0a(%rip), %rcx      # 0x34c68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xbbf2(%rip), %rsi      # 0x35e60
jmp 0x2a2ed
cmpl $0x27, %r14d
je 0x2a2e6
cmpl $0x5c, %r14d
jne 0x2a285
leaq 0xd9ee(%rip), %rsi      # 0x37c71
jmp 0x2a2ed
leal -0x20(%r14), %eax
cmpl $0x5e, %eax
ja 0x2a308
leaq 0xf(%rsp), %rsi
movb %r14b, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x7560
xorl %eax, %eax
jmp 0x2a2ff
leaq 0xd9c9(%rip), %rsi      # 0x37c77
jmp 0x2a2ed
leaq 0xc433(%rip), %rsi      # 0x366ea
jmp 0x2a2ed
leaq 0xc42d(%rip), %rsi      # 0x366ed
jmp 0x2a2ed
leaq 0xd9ab(%rip), %rsi      # 0x37c74
jmp 0x2a2ed
leaq 0xc415(%rip), %rsi      # 0x366e7
jmp 0x2a2ed
leaq 0xc406(%rip), %rsi      # 0x366e1
jmp 0x2a2ed
leaq 0xc400(%rip), %rsi      # 0x366e4
jmp 0x2a2ed
leaq 0xd981(%rip), %rsi      # 0x37c6e
movl $0x2, %edx
movq %rbx, %rdi
callq 0x7560
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ebp
leaq 0xd960(%rip), %rsi      # 0x37c7a
movl $0x2, %edx
movq %rbx, %rdi
callq 0x7560
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rax
orl $0x4000, 0x18(%rbx,%rax) # imm = 0x4000
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7920
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl %ebp, 0x18(%rbx,%rax)
movl $0x1, %eax
jmp 0x2a2ff
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: testing::internal::ScopedPrematureExitFile::ScopedPrematureExitFile(char const*)
explicit ScopedPrematureExitFile(const char* premature_exit_filepath)
      : premature_exit_filepath_(premature_exit_filepath ?
                                 premature_exit_filepath : "") {
    // If a path to the premature-exit file is specified...
    if (!premature_exit_filepath_.empty()) {
      // create the file with a single "0" character in it.  I/O
      // errors are ignored as there's nothing better we can do and we
      // don't want to fail the test because of this.
      FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
      fwrite("0", 1, 1, pfile);
      fclose(pfile);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
leaq 0xa1f4(%rip), %r15      # 0x36437
cmovneq %rsi, %r15
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq %r15, %rdi
callq 0x71e0
leaq (%rax,%r15), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x30548
cmpq $0x0, 0x8(%r14)
je 0x2c298
leaq 0xa76b(%rip), %rsi      # 0x369de
movq %rbx, %rdi
callq 0x75c0
movq %rax, %rbx
movl $0x30, %edi
movq %rax, %rsi
callq 0x7650
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7440
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: testing::internal::ScopedPrematureExitFile::~ScopedPrematureExitFile()
~ScopedPrematureExitFile() {
    if (!premature_exit_filepath_.empty()) {
      int retval = remove(premature_exit_filepath_.c_str());
      if (retval) {
        GTEST_LOG_(ERROR) << "Failed to remove premature exit filepath \""
                          << premature_exit_filepath_ << "\" with error "
                          << retval;
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x2c4a9
movq (%rbx), %rdi
callq 0x7990
testl %eax, %eax
je 0x2c4a9
movl %eax, %ebp
leaq 0x980d(%rip), %rdx      # 0x35c4c
leaq 0xc(%rsp), %rdi
movl $0x2, %esi
movl $0x112d, %ecx           # imm = 0x112D
callq 0x27dfe
movq 0x1cb8e(%rip), %rdi     # 0x48fe8
leaq 0xafe9(%rip), %rsi      # 0x3744a
movl $0x2a, %edx
callq 0x7560
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x1cb6f(%rip), %rdi     # 0x48fe8
callq 0x7560
movq %rax, %r14
leaq 0xafed(%rip), %rsi      # 0x37475
movl $0xd, %edx
movq %rax, %rdi
callq 0x7560
movq %r14, %rdi
movl %ebp, %esi
callq 0x7920
leaq 0xc(%rsp), %rdi
callq 0x27f40
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0x2c4c8
movq (%rbx), %rsi
incq %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x7480
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0xbfbb
nop
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: void testing::internal::InitGoogleTestImpl<char>(int*, char**)
void InitGoogleTestImpl(int* argc, CharType** argv) {
  // We don't want to run the initialization code twice.
  if (GTestIsInitialized()) return;

  if (*argc <= 0) return;

  g_argvs.clear();
  for (int i = 0; i != *argc; i++) {
    g_argvs.push_back(StreamableToString(argv[i]));
  }

#if GTEST_HAS_ABSL
  absl::InitializeSymbolizer(g_argvs[0].c_str());
#endif  // GTEST_HAS_ABSL

  ParseGoogleTestFlagsOnly(argc, argv);
  GetUnitTestImpl()->PostFlagParsingInit();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r13
movq %rdi, %r14
leaq 0x1c82d(%rip), %rsi     # 0x49858
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2a44c
movq 0x8(%r15), %rbx
movq (%r15), %r12
movq %r15, %rdi
callq 0x2a3ee
cmpq %r12, %rbx
jne 0x2d0e7
cmpl $0x0, (%r14)
jle 0x2d0e7
movq %r13, (%rsp)
movq 0x1c7f3(%rip), %rsi     # 0x49858
leaq 0x1c7ec(%rip), %rdi     # 0x49858
callq 0x32df0
cmpl $0x0, (%r14)
je 0x2d0ca
leaq 0x18(%rsp), %rbp
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
leaq 0x1c7ce(%rip), %r12     # 0x49858
movq (%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x32cf5
movq %r12, %rdi
movq %r15, %rsi
callq 0x30a50
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2d0bb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7480
incq %rbx
movl (%r14), %eax
addq $0x8, %r13
cmpq %rax, %rbx
jne 0x2d08e
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x2cd40
callq 0xe8fa
movq 0x1c7d6(%rip), %rdi     # 0x498b8
callq 0x1fe9c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2d110
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7480
movq %rbx, %rdi
callq 0x7960
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest-internal-inl.h
// Function: testing::internal::StreamingListener::SocketWriter::Send(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
virtual void Send(const std::string& message) {
      GTEST_CHECK_(sockfd_ != -1)
          << "Send() can be called only when there is a connection.";

      const int len = static_cast<int>(message.length());
      if (write(sockfd_, message.c_str(), len) != len) {
        GTEST_LOG_(WARNING)
            << "stream_result_to: failed to stream to "
            << host_name_ << ":" << port_num_;
      }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %edi
cmpl $-0x1, %edi
jne 0x2ff47
leaq 0x73ff(%rip), %rdx      # 0x372f5
leaq 0xc(%rsp), %rdi
movl $0x3, %esi
movl $0x42d, %ecx            # imm = 0x42D
callq 0x27dfe
movq 0x190d7(%rip), %rdi     # 0x48fe8
leaq 0x756b(%rip), %rsi      # 0x37483
movl $0x20, %edx
callq 0x7560
movq 0x190bf(%rip), %rdi     # 0x48fe8
leaq 0x7574(%rip), %rsi      # 0x374a4
movl $0x35, %edx
callq 0x7560
leaq 0xc(%rsp), %rdi
callq 0x27f40
movl 0x8(%rbx), %edi
movslq 0x8(%r14), %r15
movq (%r14), %rsi
movq %r15, %rdx
callq 0x7190
cmpq %r15, %rax
je 0x2ffd3
leaq 0x7393(%rip), %rdx      # 0x372f5
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0x432, %ecx            # imm = 0x432
callq 0x27dfe
movq 0x1906b(%rip), %rdi     # 0x48fe8
leaq 0x7556(%rip), %rsi      # 0x374da
movl $0x26, %edx
callq 0x7560
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x1904b(%rip), %rdi     # 0x48fe8
callq 0x7560
movq %rax, %r14
leaq 0x6897(%rip), %rsi      # 0x36843
movl $0x1, %edx
movq %rax, %rdi
callq 0x7560
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rdx
movq %r14, %rdi
callq 0x7560
leaq 0x8(%rsp), %rdi
callq 0x27f40
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0xc(%rsp), %rdi
jmp 0x2ffef
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x27f40
movq %rbx, %rdi
callq 0x7960
// File: /workspace/github_cpp_makefile_star2_O3/ambersun1234[P]AVL_Tree/./googletest/googletest/include/gtest/gtest-printers.h
// Function: testing::internal::UniversalTersePrinter<char const*>::Print(char const*, std::ostream*)
static void Print(const char* str, ::std::ostream* os) {
    if (str == NULL) {
      *os << "NULL";
    } else {
      UniversalPrint(std::string(str), os);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0x30645
movq %rdi, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
callq 0x71e0
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x30548
movq %r15, %rdi
movq %rbx, %rsi
callq 0x28725
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x30639
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7480
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x405b(%rip), %rsi      # 0x346a7
movl $0x4, %edx
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7560
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3067e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7480
movq %rbx, %rdi
callq 0x7960
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_peeksize
int ikcp_peeksize(const ikcpcb *kcp)
{
	struct IQUEUEHEAD *p;
	IKCPSEG *seg;
	int length = 0;

	assert(kcp);

	if (iqueue_is_empty(&kcp->rcv_queue)) return -1;

	seg = iqueue_entry(kcp->rcv_queue.next, IKCPSEG, node);
	if (seg->frg == 0) return seg->len;

	if (kcp->nrcv_que < seg->frg + 1) return -1;

	for (p = kcp->rcv_queue.next; p != &kcp->rcv_queue; p = p->next) {
		seg = iqueue_entry(p, IKCPSEG, node);
		length += seg->len;
		if (seg->frg == 0) break;
	}

	return length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x2cfb
leaq 0x98(%rdi), %rdx
movq 0x98(%rdi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, %rdx
je 0x2cf9
movl 0x18(%rcx), %esi
testl %esi, %esi
je 0x2cf6
incl %esi
cmpl %esi, 0x64(%rdi)
jb 0x2cf9
xorl %eax, %eax
addl 0x2c(%rcx), %eax
cmpl $0x0, 0x18(%rcx)
je 0x2cf9
movq (%rcx), %rcx
cmpq %rdx, %rcx
jne 0x2ce3
jmp 0x2cf9
movl 0x2c(%rcx), %eax
popq %rbp
retq
leaq 0x833e(%rip), %rdi      # 0xb040
leaq 0x833b(%rip), %rsi      # 0xb044
leaq 0x83a3(%rip), %rcx      # 0xb0b3
movl $0x1bd, %edx            # imm = 0x1BD
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_parse_data(IKCPCB*, IKCPSEG*)
void ikcp_parse_data(ikcpcb *kcp, IKCPSEG *newseg)
{
	struct IQUEUEHEAD *p, *prev;
	IUINT32 sn = newseg->sn;
	int repeat = 0;
	
	if (_itimediff(sn, kcp->rcv_nxt + kcp->rcv_wnd) >= 0 ||
		_itimediff(sn, kcp->rcv_nxt) < 0) {
		ikcp_segment_delete(kcp, newseg);
		return;
	}

	for (p = kcp->rcv_buf.prev; p != &kcp->rcv_buf; p = prev) {
		IKCPSEG *seg = iqueue_entry(p, IKCPSEG, node);
		prev = p->prev;
		if (seg->sn == sn) {
			repeat = 1;
			break;
		}
		if (_itimediff(sn, seg->sn) > 0) {
			break;
		}
	}

	if (repeat == 0) {
		iqueue_init(&newseg->node);
		iqueue_add(&newseg->node, p);
		kcp->nrcv_buf++;
	}	else {
		ikcp_segment_delete(kcp, newseg);
	}

#if 0
	ikcp_qprint("rcvbuf", &kcp->rcv_buf);
	printf("rcv_nxt=%lu\n", kcp->rcv_nxt);
#endif

	// move available data from rcv_buf -> rcv_queue
	while (! iqueue_is_empty(&kcp->rcv_buf)) {
		IKCPSEG *seg = iqueue_entry(kcp->rcv_buf.next, IKCPSEG, node);
		if (seg->sn == kcp->rcv_nxt && kcp->nrcv_que < kcp->rcv_wnd) {
			iqueue_del(&seg->node);
			kcp->nrcv_buf--;
			iqueue_add_tail(&seg->node, &kcp->rcv_queue);
			kcp->nrcv_que++;
			kcp->rcv_nxt++;
		}	else {
			break;
		}
	}

#if 0
	ikcp_qprint("queue", &kcp->rcv_queue);
	printf("rcv_nxt=%lu\n", kcp->rcv_nxt);
#endif

#if 1
//	printf("snd(buf=%d, queue=%d)\n", kcp->nsnd_buf, kcp->nsnd_que);
//	printf("rcv(buf=%d, queue=%d)\n", kcp->nrcv_buf, kcp->nrcv_que);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x24(%rsi), %eax
movl 0x18(%rdi), %ecx
cmpl %ecx, %eax
js 0x3031
movq %rdi, %rbx
addl 0x3c(%rdi), %ecx
movl %eax, %edx
subl %ecx, %edx
jns 0x3031
leaq 0xb8(%rbx), %r14
leaq 0xc0(%rbx), %rdx
movq (%rdx), %rcx
cmpq %r14, %rcx
je 0x3018
movl %eax, %edi
subl 0x24(%rcx), %edi
je 0x304f
leaq 0x8(%rcx), %rdx
testl %edi, %edi
jle 0x3001
movq %rsi, (%rsi)
movq %rcx, 0x8(%rsi)
movq (%rcx), %rax
movq %rax, (%rsi)
movq %rsi, 0x8(%rax)
movq %rsi, (%rcx)
incl 0x5c(%rbx)
jmp 0x3067
movq 0xd258(%rip), %rax      # 0x10290
movq %rsi, %rdi
testq %rax, %rax
je 0x3046
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
popq %rbx
popq %r14
popq %rbp
jmp 0x2320
movq 0xd23a(%rip), %rax      # 0x10290
movq %rsi, %rdi
testq %rax, %rax
je 0x3062
callq *%rax
jmp 0x3067
callq 0x2320
movq 0xb8(%rbx), %rdx
cmpq %rdx, %r14
je 0x30cf
leaq 0x98(%rbx), %rax
movl 0x18(%rbx), %ecx
xorps %xmm0, %xmm0
cmpl 0x24(%rdx), %ecx
jne 0x30cf
movl 0x64(%rbx), %esi
cmpl 0x3c(%rbx), %esi
jae 0x30cf
movq (%rdx), %rdi
movq 0x8(%rdx), %r8
movq %r8, 0x8(%rdi)
movq %rdi, (%r8)
movups %xmm0, (%rdx)
decl 0x5c(%rbx)
movq 0xa0(%rbx), %rdi
movq %rdi, 0x8(%rdx)
movq %rax, (%rdx)
movq %rdx, (%rdi)
movq %rdx, 0xa0(%rbx)
incl %esi
movl %esi, 0x64(%rbx)
incl %ecx
movl %ecx, 0x18(%rbx)
movq 0xb8(%rbx), %rdx
cmpq %rdx, %r14
jne 0x3080
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_output(IKCPCB*, void const*, int)
static int ikcp_output(ikcpcb *kcp, const void *data, int size)
{
	assert(kcp);
	assert(kcp->output);
	if (ikcp_canlog(kcp, IKCP_LOG_OUTPUT)) {
		ikcp_log(kcp, IKCP_LOG_OUTPUT, "[RO] %ld bytes", (long)size);
	}
	if (size == 0) return 0;
	return kcp->output((const char*)data, size, kcp, kcp->user);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3cae
movq %rdi, %r14
cmpq $0x0, 0xf8(%rdi)
je 0x3ccd
movl %edx, %ebx
movq %rsi, %r15
testb $0x1, 0xf4(%r14)
je 0x3c7d
cmpq $0x0, 0x100(%r14)
je 0x3c7d
movslq %ebx, %rcx
leaq 0x7580(%rip), %rdx      # 0xb1ee
movq %r14, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2630
testl %ebx, %ebx
je 0x3ca3
movq 0xd8(%r14), %rcx
movq 0xf8(%r14), %rax
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x738b(%rip), %rdi      # 0xb040
leaq 0x7388(%rip), %rsi      # 0xb044
leaq 0x74f2(%rip), %rcx      # 0xb1b5
movl $0xcd, %edx
callq 0x21b0
leaq 0x750e(%rip), %rdi      # 0xb1e2
leaq 0x7369(%rip), %rsi      # 0xb044
leaq 0x74d3(%rip), %rcx      # 0xb1b5
movl $0xce, %edx
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_update
void ikcp_update(ikcpcb *kcp, IUINT32 current)
{
	IINT32 slap;

	kcp->current = current;

	if (kcp->updated == 0) {
		kcp->updated = 1;
		kcp->ts_flush = kcp->current;
	}

	slap = _itimediff(kcp->current, kcp->ts_flush);

	if (slap >= 10000 || slap < -10000) {
		kcp->ts_flush = kcp->current;
		slap = 0;
	}

	if (slap >= 0) {
		kcp->ts_flush += kcp->interval;
		if (_itimediff(kcp->current, kcp->ts_flush) >= 0) {
			kcp->ts_flush = kcp->current + kcp->interval;
		}
		ikcp_flush(kcp);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, 0x4c(%rdi)
cmpl $0x0, 0x70(%rdi)
je 0x3cfe
movl 0x54(%rdi), %eax
jmp 0x3d0a
movl $0x1, 0x70(%rdi)
movl %esi, 0x54(%rdi)
movl %esi, %eax
movl %esi, %edx
subl %eax, %edx
movslq %edx, %r8
addq $-0x2710, %r8           # imm = 0xD8F0
movl %esi, %ecx
cmpq $-0x4e20, %r8           # imm = 0xB1E0
jb 0x3d29
movl %eax, %ecx
testl %edx, %edx
js 0x3d3e
movl 0x50(%rdi), %eax
addl %eax, %ecx
addl %esi, %eax
cmpl %ecx, %esi
cmovsl %ecx, %eax
movl %eax, 0x54(%rdi)
popq %rbp
jmp 0x3733
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_check
IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current)
{
	IUINT32 ts_flush = kcp->ts_flush;
	IINT32 tm_flush = 0x7fffffff;
	IINT32 tm_packet = 0x7fffffff;
	IUINT32 minimal = 0;
	struct IQUEUEHEAD *p;

	if (kcp->updated == 0) {
		return current;
	}

	if (_itimediff(current, ts_flush) >= 10000 ||
		_itimediff(current, ts_flush) < -10000) {
		ts_flush = current;
	}

	if (_itimediff(current, ts_flush) >= 0) {
		return current;
	}

	tm_flush = _itimediff(ts_flush, current);

	for (p = kcp->snd_buf.next; p != &kcp->snd_buf; p = p->next) {
		const IKCPSEG *seg = iqueue_entry(p, const IKCPSEG, node);
		IINT32 diff = _itimediff(seg->resendts, current);
		if (diff <= 0) {
			return current;
		}
		if (diff < tm_packet) tm_packet = diff;
	}

	minimal = (IUINT32)(tm_packet < tm_flush ? tm_packet : tm_flush);
	if (minimal >= kcp->interval) minimal = kcp->interval;

	return current + minimal;
}

// Assembly:
movl %esi, %eax
cmpl $0x0, 0x70(%rdi)
je 0x3d62
movl 0x54(%rdi), %ecx
movl %eax, %edx
subl %ecx, %edx
addl $0xffffd8f0, %edx       # imm = 0xFFFFD8F0
cmpl $0xffffb1e0, %edx       # imm = 0xFFFFB1E0
cmovbl %eax, %ecx
cmpl %ecx, %eax
js 0x3d63
retq
pushq %rbp
movq %rsp, %rbp
subl %eax, %ecx
leaq 0xa8(%rdi), %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rsi, %r8
movq (%r8), %r8
cmpq %rsi, %r8
je 0x3d95
movl 0x30(%r8), %r9d
subl %eax, %r9d
cmpl %r9d, %edx
cmovgel %r9d, %edx
testl %r9d, %r9d
jg 0x3d78
jmp 0x3da4
cmpl %ecx, %edx
cmovll %edx, %ecx
movl 0x50(%rdi), %edx
cmpl %edx, %ecx
cmovael %edx, %ecx
addl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_setmtu
int ikcp_setmtu(ikcpcb *kcp, int mtu)
{
	char *buffer;
	if (mtu < 50 || mtu < (int)IKCP_OVERHEAD) 
		return -1;
	buffer = (char*)ikcp_malloc((mtu + IKCP_OVERHEAD) * 3);
	if (buffer == NULL) 
		return -2;
	kcp->mtu = mtu;
	kcp->mss = kcp->mtu - IKCP_OVERHEAD;
	ikcp_free(kcp->buffer);
	kcp->buffer = buffer;
	return 0;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x32, %esi
jl 0x3e26
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal (%r14,%r14,2), %edi
addl $0x48, %edi
movq 0xc4ba(%rip), %rax      # 0x10288
testq %rax, %rax
je 0x3dd7
callq *%rax
jmp 0x3ddc
callq 0x2360
movq %rax, %r15
testq %rax, %rax
je 0x3e07
movl %r14d, 0x4(%rbx)
addl $-0x18, %r14d
movl %r14d, 0x8(%rbx)
movq 0xe0(%rbx), %rdi
movq 0xc492(%rip), %rax      # 0x10290
testq %rax, %rax
je 0x3e0e
callq *%rax
jmp 0x3e13
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x3e1c
callq 0x2320
movq %r15, 0xe0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_nodelay
int ikcp_nodelay(ikcpcb *kcp, int nodelay, int interval, int resend, int nc)
{
	if (nodelay >= 0) {
		kcp->nodelay = nodelay;
		if (nodelay) {
			kcp->rx_minrto = IKCP_RTO_NDL;	
		}	
		else {
			kcp->rx_minrto = IKCP_RTO_MIN;
		}
	}
	if (interval >= 0) {
		if (interval > 5000) interval = 5000;
		else if (interval < 10) interval = 10;
		kcp->interval = interval;
	}
	if (resend >= 0) {
		kcp->fastresend = resend;
	}
	if (nc >= 0) {
		kcp->nocwnd = nc;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
js 0x3e62
movl %esi, 0x6c(%rdi)
movl $0x64, %eax
movl $0x1e, %esi
cmovel %eax, %esi
movl %esi, 0x34(%rdi)
testl %edx, %edx
js 0x3e7e
cmpl $0xb, %edx
movl $0xa, %eax
cmovael %edx, %eax
movl $0x1388, %edx           # imm = 0x1388
cmpl %edx, %eax
cmovael %edx, %eax
movl %eax, 0x50(%rdi)
testl %ecx, %ecx
js 0x3e88
movl %ecx, 0xe8(%rdi)
testl %r8d, %r8d
js 0x3e94
movl %r8d, 0xec(%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/kcp/ikcp.c
// Function: ikcp_wndsize
int ikcp_wndsize(ikcpcb *kcp, int sndwnd, int rcvwnd)
{
	if (kcp) {
		if (sndwnd > 0) {
			kcp->snd_wnd = sndwnd;
		}
		if (rcvwnd > 0) {   // must >= max fragment size
			kcp->rcv_wnd = _imax_(rcvwnd, IKCP_WND_RCV);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3ebd
testl %esi, %esi
jle 0x3ea8
movl %esi, 0x38(%rdi)
testl %edx, %edx
jle 0x3ebd
cmpl $0x81, %edx
movl $0x80, %eax
cmovael %edx, %eax
movl %eax, 0x3c(%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_init
int
mnet_init() {
   mnet_t *ss = _gmnet();
   if ( !ss->init ) {
#if MNET_OS_WIN
      WSADATA wdata;
      if (WSAStartup(MAKEWORD(2,2), &wdata) != 0) {
         mm_log(NULL, MNET_LOG_ERR, "fail to init !\n");
         return 0;
      }
      mm_log(NULL, MNET_LOG_VERBOSE, "init with select\n");
#else
      signal(SIGPIPE, SIG_IGN);
      _evt_init();
#endif
      ss->init = 1;
      return 1;
   }
   return 0;
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0xc3b7(%rip)      # 0x10298
je 0x3ee4
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, %esi
movl $0xd, %edi
callq 0x2310
cmpl $0x0, 0xc3a8(%rip)      # 0x102a8
jg 0x3f81
movl $0x100, %edi            # imm = 0x100
callq 0x2450
movl %eax, 0xc396(%rip)      # 0x102a8
leaq 0x7477(%rip), %rdx      # 0xb390
xorl %edi, %edi
movl $0x3, %esi
movl %eax, %ecx
xorl %eax, %eax
callq 0x41bd
movl $0x4, 0xc37d(%rip)      # 0x102b0
movl $0x30, %edi
callq *0xc312(%rip)           # 0x10250
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rax, 0xc365(%rip)      # 0x102b8
movl $0x100, 0xc363(%rip)    # imm = 0x100
movl $0xc00, %edi            # imm = 0xC00
callq *0xc2e8(%rip)           # 0x10250
movq %rax, %rbx
movl $0xc00, %edx            # imm = 0xC00
movq %rax, %rdi
xorl %esi, %esi
callq 0x2180
movq %rbx, 0xc347(%rip)      # 0x102c8
movl $0x1, 0xc30d(%rip)      # 0x10298
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_fini
void
mnet_fini() {
   mnet_t *ss = _gmnet();
   if ( ss->init ) {
      chann_t *n = ss->channs;
      while ( n ) {
         chann_t *next = n->next;
         _chann_disconnect_socket(ss, n);
         _chann_close_socket(ss, n);
         _chann_destroy(ss, n);
         n = next;
      }
#if MNET_OS_WIN
      WSACleanup();
#else
      _kev_get_flags(NULL); // for compile warning
      _kev_get_events(NULL);
      _evt_fini();
#endif
      ss->init = 0;
      memset(ss, 0, sizeof(*ss));
      mm_log(NULL, MNET_LOG_VERBOSE, "fini\n");
   }
}

// Assembly:
cmpl $0x0, 0xc2fa(%rip)      # 0x10298
je 0x4068
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0xc2ee(%rip), %rbx      # 0x102a0
testq %rbx, %rbx
je 0x3fdb
movq 0x58(%rbx), %r14
movq %rbx, %rdi
callq 0x4069
movq %rbx, %rdi
callq 0x40d2
movq %rbx, %rdi
callq 0x4123
movq %r14, %rbx
testq %r14, %r14
jne 0x3fb7
movl 0xc2c7(%rip), %edi      # 0x102a8
testl %edi, %edi
je 0x4030
callq 0x2470
movq 0xc2c7(%rip), %rdi      # 0x102b8
callq *0xc269(%rip)           # 0x10260
movq 0xc2ca(%rip), %rdi      # 0x102c8
callq *0xc25c(%rip)           # 0x10260
xorps %xmm0, %xmm0
movups %xmm0, 0xc2b2(%rip)     # 0x102c0
movups %xmm0, 0xc29b(%rip)     # 0x102b0
movl 0xc28d(%rip), %ecx      # 0x102a8
leaq 0x73ca(%rip), %rdx      # 0xb3ec
xorl %edi, %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x41bd
xorps %xmm0, %xmm0
movups %xmm0, 0xc28e(%rip)     # 0x102c8
movups %xmm0, 0xc277(%rip)     # 0x102b8
movups %xmm0, 0xc260(%rip)     # 0x102a8
movups %xmm0, 0xc249(%rip)     # 0x10298
leaq 0x71a7(%rip), %rdx      # 0xb1fd
xorl %edi, %edi
movl $0x3, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x41bd
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_disconnect_socket(s_mnet*, s_mchann*)
static int
_chann_disconnect_socket(mnet_t *ss, chann_t *n) {
   if (n->fd > 0) {
      mm_log(n, MNET_LOG_VERBOSE, "chann disconnect fd:%d\n", n->fd);
      close(n->fd);
      _rwb_destroy(&n->rwb_send);
      n->fd = -1;
      n->state = CHANN_STATE_DISCONNECT;
#if (MNET_OS_MACOX || MNET_OS_LINUX || MNET_OS_FreeBSD)
      n->epoll_events = 0;
#endif
      return 1;
   }
   return 0;
}

// Assembly:
movl (%rdi), %ecx
testl %ecx, %ecx
jle 0x40d1
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7328(%rip), %rdx      # 0xb3a8
movl $0x3, %esi
xorl %eax, %eax
callq 0x41bd
movl (%rbx), %edi
callq 0x2470
cmpl $0x0, 0x48(%rbx)
jle 0x40b6
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rax
movq $0x0, (%rax)
movq %r14, %rdi
callq 0x5531
cmpl $0x0, 0x48(%rbx)
jg 0x409d
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movl $0x1, 0x10(%rbx)
movl $0x0, 0x88(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_close_socket(s_mnet*, s_mchann*)
static void
_chann_close_socket(mnet_t *ss, chann_t *n) {
   if (n->state > CHANN_STATE_CLOSED) {
#if (MNET_OS_MACOX || MNET_OS_LINUX || MNET_OS_FreeBSD)
      n->del_next = ss->del_channs;
      if (ss->del_channs) {
         ss->del_channs->del_prev = n;
      }
      ss->del_channs = n;
#endif
      n->state = CHANN_STATE_CLOSED;
      n->cb = NULL;
      n->opaque = NULL;
      mm_log(n, MNET_LOG_VERBOSE, "chann close fd:%d\n", n->fd);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x10(%rdi)
jle 0x4121
movq 0xc1ed(%rip), %rax      # 0x102d0
movq %rax, 0x80(%rdi)
testq %rax, %rax
je 0x40f3
movq %rdi, 0x78(%rax)
movq %rdi, 0xc1d6(%rip)      # 0x102d0
movl $0x0, 0x10(%rdi)
xorl %eax, %eax
movq %rax, 0x18(%rdi)
movq %rax, 0x8(%rdi)
movl (%rdi), %ecx
leaq 0x72ac(%rip), %rdx      # 0xb3c0
movl $0x3, %esi
xorl %eax, %eax
popq %rbp
jmp 0x41bd
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_destroy(s_mnet*, s_mchann*)
static void
_chann_destroy(mnet_t *ss, chann_t *n) {
   if (n->state >= CHANN_STATE_CLOSED) {
      if (n->next) { n->next->prev = n->prev; }
      if (n->prev) { n->prev->next = n->next; }
      else { ss->channs = n->next; }
      _rwb_destroy(&n->rwb_send);
      ss->chann_count--;
      mm_log(n, MNET_LOG_VERBOSE, "chann destroy, count %d\n", ss->chann_count);
      n->state = (chann_state_t)-1;
      mm_free(n);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x10(%rdi)
js 0x41b8
movq %rdi, %rbx
movq 0x50(%rdi), %rcx
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x4148
movq %rcx, 0x50(%rax)
leaq 0x58(%rcx), %rdx
testq %rcx, %rcx
leaq 0xc14a(%rip), %rcx      # 0x102a0
cmovneq %rdx, %rcx
movq %rax, (%rcx)
cmpl $0x0, 0x48(%rbx)
jle 0x4180
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rax
movq $0x0, (%rax)
movq %r14, %rdi
callq 0x5531
cmpl $0x0, 0x48(%rbx)
jg 0x4167
movl 0xc116(%rip), %ecx      # 0x1029c
decl %ecx
movl %ecx, 0xc10e(%rip)      # 0x1029c
leaq 0x723e(%rip), %rdx      # 0xb3d3
movq %rbx, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x41bd
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *0xc0a8(%rip)           # 0x10260
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mm_log(s_mchann*, int, char const*, ...)
static inline void mm_log(chann_t *n, int level, const char *fmt, ...) {
   if (level <= _log_level) {
      char buf[192];
      va_list argptr;
      va_start(argptr, fmt);
      vsprintf(buf, fmt, argptr);
      va_end(argptr);
      mnet_log(n, level, buf);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
testb %al, %al
je 0x41fa
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
cmpl %esi, 0xc053(%rip)      # 0x10268
jl 0x4263
movl %esi, %ebx
movq %rdi, %r14
leaq -0xe0(%rbp), %rcx
leaq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
leaq -0x1a0(%rbp), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x2130
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq *0xc00d(%rip)           # 0x10270
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_setlog
void
mnet_setlog(int level, mnet_log_cb cb) {
   if (level >= 0) {
      _log_level = level;
   }
   if (cb) {
      mnet_log = cb;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edi, %edi
js 0x42a9
movl %edi, 0xbfbf(%rip)      # 0x10268
testq %rsi, %rsi
je 0x42b5
movq %rsi, 0xbfbb(%rip)      # 0x10270
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_report
int
mnet_report(int level) {
   mnet_t *ss = _gmnet();
   if (ss->init) {
      if (level > 0) {
         mm_log(NULL, 0, "-------- channs(%d) --------\n", ss->chann_count);
         chann_t *n = ss->channs;
         while (n) {
            mm_log(NULL, 0, "chann:%p fd:%d state:%d %s:%d\n", n, n->fd, n->state, _chann_addr(n), _chann_port(n));
            n = n->next;
         }
         mm_log(NULL, 0, "------------------------\n");
      }
      return ss->chann_count;
   }
   return -1;
}

// Assembly:
cmpl $0x0, 0xbfda(%rip)      # 0x10298
je 0x4369
testl %edi, %edi
jle 0x4362
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0xbfbf(%rip), %ecx      # 0x1029c
leaq 0x6f1f(%rip), %rdx      # 0xb203
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x41bd
movq 0xbfaa(%rip), %rbx      # 0x102a0
testq %rbx, %rbx
je 0x4348
leaq 0x6f1f(%rip), %r14      # 0xb221
movl (%rbx), %r15d
movl 0x10(%rbx), %r12d
movl 0x24(%rbx), %edi
callq 0x2120
movq %rax, %r10
movzwl 0x22(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %r11d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x41bd
addq $0x10, %rsp
movq 0x58(%rbx), %rbx
testq %rbx, %rbx
jne 0x4302
leaq 0x6ef1(%rip), %rdx      # 0xb240
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x41bd
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movl 0xbf34(%rip), %eax      # 0x1029c
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_resolve
int
mnet_resolve(char *host, int port, chann_type_t ctype, chann_addr_t *addr) {
   int ret = 0;
   if (host && addr) {
      struct sockaddr_in *valid_in = NULL;
      struct addrinfo hints, *ai=NULL, *curr=NULL;
      char buf[32] = {0};

      memset(&hints, 0, sizeof(hints));
      hints.ai_family = AF_INET;
      hints.ai_socktype = (ctype == CHANN_TYPE_DGRAM) ? SOCK_DGRAM : SOCK_STREAM;
      if (port > 0) { sprintf(buf, "%d", port); }
      if ( getaddrinfo(host, (port>0 ? buf : NULL), &hints, &ai) ) {
         mm_log(NULL, 0, "fail to resolve host !\n");
         goto fail;
      }

      for ( curr=ai; curr!=NULL; curr=curr->ai_next) {
         char ipstr[16] = {0};
         inet_ntop(AF_INET, &(((struct sockaddr_in *)(curr->ai_addr))->sin_addr), ipstr, 16);
         if (strlen(ipstr) > 7) { // '0.0.0.0'
            valid_in = (struct sockaddr_in*)curr->ai_addr;
            break;
         }
      }

      if (valid_in) {
         if (0 == getnameinfo((struct sockaddr*)valid_in, sizeof(*valid_in),
                              (char*)addr->ip, 16,NULL, 0, NI_NUMERICHOST))
         {
            ret = 1;
            addr->port = port;
         }
      }

     fail:
      freeaddrinfo(ai);
   }
   return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
testq %rdi, %rdi
sete %al
testq %rcx, %rcx
sete %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x442f
movl %esi, %r14d
movq %rdi, %r12
movq $0x0, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x50(%rbp)
movl $0x2, -0x6c(%rbp)
xorl %eax, %eax
cmpl $0x2, %edx
sete %al
incl %eax
movl %eax, -0x68(%rbp)
testl %esi, %esi
jle 0x43f7
leaq 0x6e79(%rip), %rsi      # 0xb25a
leaq -0x90(%rbp), %r15
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2090
jmp 0x43fa
xorl %r15d, %r15d
leaq -0x70(%rbp), %rdx
leaq -0x30(%rbp), %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2330
testl %eax, %eax
je 0x4441
leaq 0x6e45(%rip), %rdx      # 0xb25d
xorl %r15d, %r15d
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x41bd
movq -0x30(%rbp), %rdi
callq 0x2350
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %r13
xorl %r15d, %r15d
testq %r13, %r13
je 0x4426
leaq -0x40(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq 0x18(%r13), %rsi
addq $0x4, %rsi
movl $0x2, %edi
movq %r12, %rdx
movl $0x10, %ecx
callq 0x22d0
movq %r12, %rdi
callq 0x2110
cmpq $0x7, %rax
ja 0x448b
movq 0x28(%r13), %r13
testq %r13, %r13
jne 0x4451
jmp 0x4426
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x4426
movl $0x1, (%rsp)
xorl %r15d, %r15d
movl $0x10, %esi
movq %rbx, %rdx
movl $0x10, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x21a0
testl %eax, %eax
jne 0x4426
movl %r14d, 0x10(%rbx)
movl $0x1, %r15d
jmp 0x4426
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_parse_ipport
int
mnet_parse_ipport(const char *ipport, chann_addr_t *addr) {
   if (ipport && addr) {
      const char *p = strchr(ipport, ':');
      if (p >= ipport) {
         if ((p - ipport) >= 7) {
            addr->ip[p - ipport] = 0;
            strncpy(addr->ip, ipport, p - ipport);
         } else {
            strncpy(addr->ip, "0.0.0.0", 8);
         }
         addr->port = atoi(p+1);
         return 1;
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
xorl %r12d, %r12d
orb %al, %cl
jne 0x453e
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3a, %esi
callq 0x2100
movq %rax, %rdx
subq %r14, %rdx
jb 0x453e
movq %rax, %r15
cmpq $0x7, %rdx
jl 0x451d
movb $0x0, (%rbx,%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2170
jmp 0x452a
movabsq $0x302e302e302e30, %rax # imm = 0x302E302E302E30
movq %rax, (%rbx)
incq %r15
movq %r15, %rdi
callq 0x23c0
movl %eax, 0x10(%rbx)
movl $0x1, %r12d
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: chann_create(s_mnet*, chann_type_t, chann_state_t)
static chann_t*
_chann_create(mnet_t *ss, chann_type_t type, chann_state_t state) {
   chann_t *n = (chann_t*)mm_malloc(sizeof(*n));
   n->state = state;
   n->type = type;
   n->next = ss->channs;
   if (ss->channs) {
      ss->channs->prev = n;
   }
   ss->channs = n;
   ss->chann_count++;
   mm_log(n, MNET_LOG_VERBOSE, "chann create, type:%d, count %d\n", type, ss->chann_count);
   return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movl %edi, %r14d
movl $0x90, %edi
callq *0xbcdf(%rip)           # 0x10250
movq %rax, %rbx
movl $0x90, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2180
movl %r15d, 0x10(%rbx)
movl %r14d, 0x14(%rbx)
movq 0xbd0e(%rip), %rax      # 0x102a0
movq %rax, 0x58(%rbx)
testq %rax, %rax
je 0x459f
movq %rbx, 0x50(%rax)
movq %rbx, 0xbcfa(%rip)      # 0x102a0
movl 0xbcef(%rip), %r8d      # 0x1029c
incl %r8d
movl %r8d, 0xbce5(%rip)      # 0x1029c
leaq 0x6e4c(%rip), %rdx      # 0xb40a
movq %rbx, %rdi
movl $0x3, %esi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x41bd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_connect
int
mnet_chann_connect(chann_t *n, const char *host, int port) {
   if (n && host && port>0) {
      int fd = _chann_open_socket(n, host, port, 0);
      if (fd > 0) {
         n->fd = fd;
         if (n->type == CHANN_TYPE_STREAM) {
            int r = connect(fd, (struct sockaddr*)&n->addr, n->addr_len);
            if (r >= 0 || errno==EINPROGRESS || errno==EWOULDBLOCK) {
               n->state = CHANN_STATE_CONNECTING;
               _evt_add(n, MNET_SET_WRITE);
               mm_log(n, MNET_LOG_VERBOSE, "chann fd:%d type:%d connecting...\n", fd, n->type);
               return 1;
            }
         } else {
            n->state = CHANN_STATE_CONNECTED;
            _evt_add(n, MNET_SET_READ);
            mm_log(n, MNET_LOG_VERBOSE, "chann fd:%d type:%d connected\n", fd, n->type);
            return 1;
         }
      }
      mm_log(n, MNET_LOG_ERR, "chann %p fail to connect %d:%s\n", n, errno, strerror(errno));
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testl %edx, %edx
setle %al
xorl %r15d, %r15d
orb %cl, %al
jne 0x4712
movq %rdi, %rbx
xorl %ecx, %ecx
callq 0x473e
testl %eax, %eax
jle 0x46aa
movl %eax, %r14d
movl %eax, (%rbx)
cmpl $0x1, 0x14(%rbx)
jne 0x46de
leaq 0x20(%rbx), %rsi
movl 0x30(%rbx), %edx
movl %r14d, %edi
callq 0x2240
testl %eax, %eax
js 0x4720
movl $0x2, 0x10(%rbx)
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x496f
movl 0x14(%rbx), %r8d
leaq 0x6bdf(%rip), %rdx      # 0xb275
movq %rbx, %rdi
movl $0x3, %esi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x41bd
jmp 0x4712
callq 0x2050
movl (%rax), %r14d
movl %r14d, %edi
callq 0x20f0
leaq 0x6bf6(%rip), %rdx      # 0xb2b7
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rcx
movl %r14d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x41bd
jmp 0x4712
movl $0x3, 0x10(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x496f
movl 0x14(%rbx), %r8d
leaq 0x6b9e(%rip), %rdx      # 0xb298
movq %rbx, %rdi
movl $0x3, %esi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x41bd
movl $0x1, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2050
movl (%rax), %ecx
cmpl $0x73, %ecx
je 0x4671
cmpl $0xb, %ecx
je 0x4671
jmp 0x46af
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: evt_add(s_mchann*, int)
static int
_evt_add(chann_t *n, int set) {
   mnet_t *ss = _gmnet();
   struct s_event *chg = &ss->chg;
   if ( _evt_check_expand(chg) ) {
      mevent_t *kev = chg->array;
      memset(kev, 0, sizeof(mevent_t));
#if (MNET_OS_MACOX || MNET_OS_FreeBSD)
      kev->ident = n->fd;
      if (set == MNET_SET_READ) {
         kev->filter = EVFILT_READ;
      } else if (set == MNET_SET_WRITE) {
         kev->filter = EVFILT_WRITE;
      }
      kev->flags = EV_ADD | EV_EOF;
      kev->udata = (void*)n;
      if (kevent(ss->kq, chg->array, 1, NULL, 0, NULL) < 0) {
         mm_log(n, MNET_LOG_ERR, "kq fail to add fd:%d filter %x, errno %d:%s\n",
                n->fd, kev->filter, errno, strerror(errno));
         return 0;
      }
#else
      uint32_t events = 0;
      kev->data.ptr = (void*)n;
      if (set == MNET_SET_READ) {
         events = n->epoll_events | EPOLLIN | EPOLLRDHUP | EPOLLHUP;
      } else if (set == MNET_SET_WRITE) {
         events = n->epoll_events | EPOLLOUT | EPOLLRDHUP | EPOLLHUP;
      }
      kev->events = events;
      if (epoll_ctl(ss->kq, (n->epoll_events ? EPOLL_CTL_MOD : EPOLL_CTL_ADD), n->fd, kev) < 0) {
         mm_log(n, MNET_LOG_ERR, "epoll fail to add fd:%d filter %x, errno %d:%s\n",
                n->fd, n->epoll_events, errno, strerror(errno));
         return 0;
      }
      n->epoll_events = events;
#endif
      mm_log(n, MNET_LOG_VERBOSE, "add chann:%p fd:%d events\n", n, n->fd);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x55fe
testl %eax, %eax
je 0x4a4c
movq 0xb920(%rip), %rcx      # 0x102b8
movl $0x0, (%rcx)
movq %rbx, 0x4(%rcx)
xorl %eax, %eax
testl %r14d, %r14d
setne %al
movl 0x88(%rbx), %edx
leal (%rax,%rax,2), %r14d
addl $0x2011, %r14d          # imm = 0x2011
orl %edx, %r14d
movl %r14d, (%rcx)
movl 0xb8e1(%rip), %edi      # 0x102a8
xorl %eax, %eax
testl %edx, %edx
setne %al
leal 0x1(,%rax,2), %esi
movl (%rbx), %edx
callq 0x2370
testl %eax, %eax
js 0x4a0f
movl %r14d, 0x88(%rbx)
movl (%rbx), %r8d
leaq 0x6a9a(%rip), %rdx      # 0xb48b
movq %rbx, %rdi
movl $0x3, %esi
movq %rbx, %rcx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x41bd
movl (%rbx), %r14d
movl 0x88(%rbx), %r15d
callq 0x2050
movl (%rax), %r12d
movl %r12d, %edi
callq 0x20f0
movq %rax, (%rsp)
leaq 0x6a27(%rip), %rdx      # 0xb45b
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %ecx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41bd
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_listen
int
mnet_chann_listen(chann_t *n, const char *host, int port, int backlog) {
   if (n && port>0) {
      int fd = _chann_open_socket(n, host, port, backlog | 1);
      if (fd > 0) {
         n->fd = fd;
         n->state = CHANN_STATE_LISTENING;
         _evt_add(n, MNET_SET_READ);
         mm_log(n, MNET_LOG_VERBOSE, "chann %p, fd:%d listen\n", n, fd);
         return 1;
      }
      mm_log(n, MNET_LOG_ERR, "chann %p fail to listen\n", n);
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
sete %al
testl %edx, %edx
setle %dil
xorl %r14d, %r14d
orb %al, %dil
jne 0x4aed
orl $0x1, %ecx
movq %rbx, %rdi
callq 0x473e
testl %eax, %eax
jle 0x4ad1
movl %eax, %r14d
movl %eax, (%rbx)
movl $0x4, 0x10(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x496f
leaq 0x6823(%rip), %rdx      # 0xb2d7
movq %rbx, %rdi
movl $0x3, %esi
movq %rbx, %rcx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x41bd
movl $0x1, %r14d
jmp 0x4aed
leaq 0x6817(%rip), %rdx      # 0xb2ef
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x41bd
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: mnet_chann_active_event
void
mnet_chann_active_event(chann_t *n, chann_event_t et, int active) {
   if ( n ) {
      if (et == CHANN_EVENT_SEND) {
         n->active_send_event = active;
         if (active) {
            _evt_add(n, MNET_SET_WRITE);
         } else {
            _evt_del(n, MNET_SET_WRITE);
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
cmpl $0x2, %esi
setne %cl
orb %al, %cl
jne 0x4b2e
movl %edx, 0x70(%rdi)
testl %edx, %edx
je 0x4b30
movl $0x1, %esi
popq %rbp
jmp 0x496f
popq %rbp
retq
popq %rbp
jmp 0x4b33
// File: /workspace/github_cpp_makefile_star2_O3/xocoder[P]m_kcptun/vendor/m_net/src/mnet_core.c
// Function: evt_del(s_mchann*, int)
static int
_evt_del(chann_t *n, int set) {
   mnet_t *ss = _gmnet();
   struct s_event *chg = &ss->chg;
   if ( _evt_check_expand(chg) ) {
      mevent_t *kev = chg->array;
      memset(kev, 0, sizeof(mevent_t));
#if (MNET_OS_MACOX || MNET_OS_FreeBSD)
      kev->ident = n->fd;
      if (set == MNET_SET_READ) {
         kev->filter = EVFILT_READ;
      } else if (set == MNET_SET_WRITE) {
         kev->filter = EVFILT_WRITE;         
      }
      kev->flags = EV_DELETE;
      kev->udata = (void*)n;
      if (kevent(ss->kq, chg->array, 1, NULL, 0, NULL) < 0) {
         mm_log(n, MNET_LOG_ERR, "kq fail to delete fd:%d filter %x, errno %d:%s\n",
                n->fd, kev->filter, errno, strerror(errno));
         return 0;
      }
#else
      uint32_t events = 0;
      kev->data.ptr = (void*)n;
      if (set == MNET_SET_READ) {
         events = n->epoll_events & ~EPOLLIN;
      } else if (set == MNET_SET_WRITE) {
         events = n->epoll_events & ~EPOLLOUT;
      }
      kev->events = events;
      if (epoll_ctl(ss->kq, events ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, n->fd, kev) < 0) {
         mm_log(n, MNET_LOG_ERR, "epoll fail to add fd:%d filter %x, errno %d, %s\n",
                n->fd, n->epoll_events, errno, strerror(errno));
         return 0;
      }
      n->epoll_events = events;
#endif
      mm_log(n, MNET_LOG_VERBOSE, "del chann:%p fd:%d events\n", n, n->fd);
      return 1;
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x55fe
testl %eax, %eax
je 0x4bf7
movq 0xb75f(%rip), %rcx      # 0x102b8
movl $0x0, (%rcx)
movq %rbx, 0x4(%rcx)
movl 0x88(%rbx), %r14d
xorl %esi, %esi
andl $-0x5, %r14d
movl %r14d, (%rcx)
movl 0xb72f(%rip), %edi      # 0x102a8
sete %sil
xorl $0x3, %esi
movl (%rbx), %edx
callq 0x2370
testl %eax, %eax
js 0x4bba
movl %r14d, 0x88(%rbx)
movl (%rbx), %r8d
leaq 0x6950(%rip), %rdx      # 0xb4ec
movq %rbx, %rdi
movl $0x3, %esi
movq %rbx, %rcx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x41bd
movl (%rbx), %r14d
movl 0x88(%rbx), %r15d
callq 0x2050
movl (%rax), %r12d
movl %r12d, %edi
callq 0x20f0
movq %rax, (%rsp)
leaq 0x68dc(%rip), %rdx      # 0xb4bb
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %ecx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x41bd
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq